aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--std/Math.bruijn11
1 files changed, 6 insertions, 5 deletions
diff --git a/std/Math.bruijn b/std/Math.bruijn
index 3b3bca8..7346978 100644
--- a/std/Math.bruijn
+++ b/std/Math.bruijn
@@ -97,16 +97,17 @@ fib [fibs !! ++0] ⧗ Number
# TODO: something is wrong in here
pascal iterate [zip-with …+… ({}(+0) ++ 0) (0 ; (+0))] ({}(+1))
-# π
-# q 3, r 2, t 1, i 0
+# π as a list of decimal digits
# translation of unbounded spigot algorithm by Jeremy Gibbons
-# TODO: Fix/faster
+# TODO: faster!
+# → BBP/Bellard's formula with ternary base?
+# TODO: |log|, better primes/mod/div
π g (+1) (+180) (+60) (+2) ⧗ (List Number)
- g y [[[[[calc]]]]]
+ g z [[[[[calc]]]]]
calc b : (4 q r t i)
a ↑⁰(↑⁺0 ⋅ (↑⁰0 + (+2)))
b (3 ⋅ ↑⁰(↑⁻(↑⁻0)) + ((+5) ⋅ 2)) /! ((+5) ⋅ 1)
q (+10) ⋅ 3 ⋅ 0 ⋅ --((+2) ⋅ 0)
- r (+10) ⋅ a ⋅ (3 ⋅ ((+5) ⋅ 0 - (+2)) + 2 - (b ⋅ 1)
+ r (+10) ⋅ a ⋅ (3 ⋅ ((+5) ⋅ 0 - (+2)) + 2 - (b ⋅ 1))
t 1 ⋅ a
i ++0