/******************************************************************************/ /* # A SLICE OF PI - XXX # # On the Origin of the Truncated Northian Series for Pi # # Joseph Roy D. North # 2008 Jan. 23 d # # */ scale = 200; pi = 0; pin = 0; ll = 10000000000; for(lc = ll - 1; lc >= 1; lc -= 2) { pin += 1.0 / (4 * lc * lc - 1); /* print"pin = ", pin, "\n"; */ } pin = 8 * pin; print"lc = ", lc, "\n"; print"pin = ", pin, "\n"; pi = 4 * a(1.0); print"pi = ", pi, "\n\a"; halt; /******************************************************************************/ /* SESSION OUTPUT: */ Wed Jan 23 03:27:44 CST 2008 lc = -1 pin = 3.141592653489793238462643383279752884197169399375102695974944\ 59230781650159870899862803481993196081798214808700665144727209384454\ 35651085989128594202965097429385653497430285868709405049153375471373\ 2768 pi = 3.141592653589793238462643383279502884197169399375105820974944\ 59230781640628620899862803482534211706798214808651328230664709384460\ 95505822317253594081284811174502841027019385211055596446229489549303\ 8196 Fri Jan 25 11:20:52 CST 2008 #!/bin/bash # File name: "pi30.com". # This script automates the evaluation of the truncated Northian Series. date > pi30.out time bc -l < pi30.bc >> pi30.out date >> pi30.out exit address@hidden n1]$ date Wed Jan 23 03:27:32 CST 2008 address@hidden n1]$ ./pi30.com & [2] 12545 address@hidden n1]$ ps PID TTY TIME CMD 5018 pts/2 00:00:00 bash 12545 pts/2 00:00:00 pi30.com 12547 pts/2 00:01:06 bc 12596 pts/2 00:00:00 ps [1]- Done gedit pi29.txt address@hidden n1]$ ps PID TTY TIME CMD 5018 pts/2 00:00:00 bash 12545 pts/2 00:00:00 pi30.com 12547 pts/2 1-00:03:27 bc 29298 pts/2 00:00:00 ps address@hidden n1]$ address@hidden n1]$ ps PID TTY TIME CMD 5018 pts/2 00:00:00 bash 12545 pts/2 00:00:00 pi30.com 12547 pts/2 1-07:07:24 bc 31512 pts/2 00:00:00 ps address@hidden n1]$ address@hidden n1]$ ps PID TTY TIME CMD 5018 pts/2 00:00:00 bash 7691 pts/2 00:00:00 ps 12545 pts/2 00:00:00 pi30.com 12547 pts/2 2-01:01:37 bc address@hidden n1]$ address@hidden n1]$ date Fri Jan 25 10:02:45 CST 2008 address@hidden n1]$ ps PID TTY TIME CMD 5018 pts/2 00:00:00 bash 12545 pts/2 00:00:00 pi30.com 12547 pts/2 2-06:30:58 bc 26870 pts/2 00:00:00 ps address@hidden n1]$ real 3353m7.614s user 3346m37.085s sys 2m7.798s [2]+ Done ./pi30.com address@hidden n1]$ date Fri Jan 25 11:36:26 CST 2008 /******************************************************************************/ /* DETAILS: */ 1: Purpose: To introduce the truncated Northian Series for pi. 2: Host: Generic PC, RAM = 4.0 GB. 3: CPU: AMD Athlon 64 X2 Dual-Core Processor 5600+, 2.80 GHz. 4: OS: Red Hat Linux Fedora 8, updated. 5: Author: Joseph Roy D. North, V: (512) 835-0982 (C), E: address@hidden, E: address@hidden /******************************************************************************/