Code covered by the BSD License  

Highlights from
Calculate pi decimals

5.0

5.0 | 2 ratings Rate this file 23 Downloads (last 30 days) File Size: 2.38 KB File ID: #19265
image thumbnail

Calculate pi decimals

by Jonas Lundgren

 

19 Mar 2008 (Updated 14 Nov 2011)

Calculate pi decimals with Machin's formula pi = 16*acot(5) - 4*acot(239)

| Watch this File

File Information
Description

MACHIN0 is the original and handsome code.

MACHIN is a faster version (at least a factor pi) but a less readable code. MACHIN gives you 100000 digits in a minute.

MACHIN is correct at least up to 10 million digits (~ 3 days). If you try 100 million digits you will get the wrong answer after one year.

Do you need more digits faster? Try
http://numbers.computation.free.fr/Constants/PiProgram/pifast.html

MATLAB release MATLAB 7.11 (2010b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
20 Mar 2008 John D'Errico

A nice code. Well written. Simple, descriptive help. And its surprisingly fast, generating 4000 digits of pi in under a second on my slow CPU. I picked some random digits to verify, all were correct. Well done.

12 Nov 2011 Thomas  
Please login to add a comment or rating.
Updates
26 Sep 2011

New contact information

14 Nov 2011

Faster version

Tag Activity for this File
Tag Applied By Date/Time
pi decimals Jonas Lundgren 22 Oct 2008 09:54:13
machins formula Jonas Lundgren 22 Oct 2008 09:54:13
mathematics Jonas Lundgren 22 Oct 2008 09:54:13
general Jonas Lundgren 22 Oct 2008 09:54:13
general manfred 11 Nov 2011 11:46:28
pi Jonas Lundgren 14 Nov 2011 10:01:21
decimals Jonas Lundgren 14 Nov 2011 10:01:21
digits Jonas Lundgren 14 Nov 2011 10:01:21

Contact us at files@mathworks.com