piano imagemap test

piano H-1 C0 CIS0 > D0 DIS0 E0 F0 FIS0 G0 GIS0 A0 B0 H0 C1 CIS1 D1 DIS1 E1 F1 FIS1 G1 GIS1 A1 B1 H1 C2 CIS2 D2 DIS2 E2 F2

Labels

Wirtschaft (156) Pressefreiheit (151) Österreich (125) IT (110) code (70) Staatsschulden (37) EZB (27) Pensionssystem (16) Geopolitik (12)

2023-12-09

¼ π

¼ π = arctan(1) = arctan(45°) ✓

mathematical proof still required for:
¼ π = 1 - ⅓ + ⅕ - ¹/₇ + ¹/₉ - ¹/₁₁ + (1/13) - ...
¼ π = (n=0;n→∞)∑ (-1)ⁿ / (2n + 1)
better way to approximate π is to add iteration m=n-1 and iteration n and double it.

pi.c

a computing approach in simple ansi c:
#include <stdlib.h> #include <stdint.h> #include <stdio.h> #include <math.h> int main(int argc, char **argv) { long l = 0, loopmax = (argc > 1) ? atol(argv[1]) : 32;
double m = 0, n = 0, pi = 0;
for (l = 0; l < (INT16_MAX * loopmax); l++) {
m = n; n += (pow((-1), l) / (2*l + 1)); } pi = 2 * (m + n); printf("loops \t: %ld\npi \t= %.16f\n", l, pi);
printf("pi_m \t= %.16f\npi_n \t= %.16f\n", (4*m), (4*n));
return 0; }     

compilation & linkage

gcc -o pi pi.c -lm; time ./pi; time ./pi 256
gcc -o pi pi.c -lm; time ./pi; time ./pi 256

[ to be continued  ... ]

Keine Kommentare:

Kommentar veröffentlichen