This page contains some easy C source code for constants computation.

- Computation of p : piclassic.c implements a classical approach based on Machin like formulae to compute p (see The constant p).
- Computation of e : eclassic.c implements the classical method described in The constant e.
- Computation of Ö2 : sqrt2series.c implements a classical approach on an accelerated version of the Ö2 series (see The square root of 2).
- Computation of log(2) : log2classic.c implements a classical approach described in The logarithmic constant log(2).

Any comments are welcome : sebah.pascal@fnac.net.

The following `C` files contain a short and very basic approach of
the binary splitting method to compute e (see the algorithm
description in Binary splitting
method).

- FFT files FFT.c, FFT.h ;
- Large integers library BigInt.c, BigInt.h ;
- Binary splitting technique to compute e : e.c.

Those C codes are just learning programs to permit a better understanding of the techniques used (FFT and binary splitting). Many speed or memory optimizations can be done. A really efficient program (such as the one used for PiFast for example) could save a factor of order 10 for the time and 4 for the memory.

The program runs in quasi-linear time. Here are the timings on my machine (PentiumII 350) :

Number of digits | Memory used | Time |

250000 | 9.2 Mo | 24 seconds |

500000 | 18.4 Mo | 54 seconds |

1 million | 36.8 Mo | 124 seconds |

2 millions | 73.7 Mo | 286 seconds |

Any comments are welcome : xgourdon@yahoo.fr,

*mathematical
constants and computation*

File translated from T

On 7 Jul 2000, 00:56.