Skip to content

Instantly share code, notes, and snippets.

@danielcristofani
Last active August 10, 2020 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielcristofani/2cc18b756a31f81367c5f158b7fd88a6 to your computer and use it in GitHub Desktop.
Save danielcristofani/2cc18b756a31f81367c5f158b7fd88a6 to your computer and use it in GitHub Desktop.
Compute pi by Bailey-Borwein-Plouffe formula
+7 +4 +3 :10
=2:2
=3:3
=4:4
=5:5
=6:6
=7:7
=8:8
=9:9
-8 =120 +12 *11 . =151 *11 . =47 *11 -3 $ *3 -7 $ *7 . -0 *8 :13
. . *11 !
-2 $ . . $ *2 !
=512 +14 *11 . =1024 *11 . =712 *11 . =194 *11 . =15 *11 -4 $ *15 . -0 *9 :16
-2 $ . . $ . . $ . . $ *2 +2 !
=16 . *4 !
-6 *17 -7 *18 -9 $ . . -8 *6 *8 :19
. . . . *6 !
. . *7 !
=0 +21 -6 *6 . . . . *20 -6 +5 :19
:6
-7 *7 ~ . . -0 =6 . -8 *8 *6 =0 +23 -6 *6 . . . . -0 +22 -6 . *6 :10
-8 ~ *8 !
-7 *7 ~ . . -0 . +25 -6 . *24 . -5 w -3 *27 :19
=10 *6 !
-8 ~ *26 !
=10 *8 !
=10 *3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment