pi
- From
- Alexey Burdin (2:5012/32.768)
- To
- Mike Kolesoff
- Date
- 2002-11-03T21:59:55Z
- Area
- RU.ALGORITHMS
Как после вчерашнего, Mike ?
MK> Сорри, если тема уже пролетала, но я тут недавно...
MK> Как вычислить сабж с точностью до N'ого знака после запятой?
Привожу оригинал. Перевод на русский, по-моему, формул не меняет :)
=== Iтiть ===
The calculatoin of 2000 digits of number pi on the computer ENIAC in 1949
took 70 hours (not includnig programming!). Modern computers (and
programmers) can find 2000 digits of number pi much faster.
For calculation a series should be used
pi/4=1-1/3+1/5-1/7+1/9-...
But this series converges slowly. Much better is series of an arctangent
arctg x = x - x^3/3 + x^5/5 - x^7/7 + ..., |x|<1.
Combine it with the formula for addition of a tangent
tg(a+b) = (tg a + tg b)/(1 - tg a · tg b)
and select a and b so that tg (a+b) = 1 = tg pi/4. In practice usually use
the following formulas
pi = 16 arctg (1/5) - 4 arctg (1/239).
pi = 32 arctg (1/10) - 16 arctg (1/515) - 4 arctg (1/239).
pi = 12 arctg (1/4) + 4 arctg (1/20) + 4 arctg (1/1985).
In all formulas it is necessary to calculate arctg (1/k), where k Є 2.
Write the program that fulfills this calculation.
=== Та вже прийшли ===
Всего хорошего. Alexey.
... А что подyмал кpолик, никто не yзнал,
--- потомy что кpолик был очень воспитанный.
* Origin: Megabyte (2:5012/32.768)