Search Results
6/22/2025, 12:11:34 PM
In my chase to make the computational implementation of the Wallis method (via an SICP problem) as simple as possible, I derived a completely tortured and ridiculously opaque permutation of the Wallis thing. It's fucking stupid and completely worthless, but I had fun and it appears to be novel by virtue of obscurity.
(define (pi-est n)
(let ((scalar (/ (sqrt (+ (* 4 n) 8))
(+ (* 2 n) 3))))
(square (* scalar
(product (lambda (x) (+ 1 (/ 1 (+ (* 2 x) 3))))
0
(lambda (x) (+ 1 x))
n)))))
(define (product term a next b)
(if (> a b)
1
(* (term a)
(product term (next a) next b))))
Picrel is an informal outline of the math behind it. Sorry for the handwriting, I'm a lefty
(define (pi-est n)
(let ((scalar (/ (sqrt (+ (* 4 n) 8))
(+ (* 2 n) 3))))
(square (* scalar
(product (lambda (x) (+ 1 (/ 1 (+ (* 2 x) 3))))
0
(lambda (x) (+ 1 x))
n)))))
(define (product term a next b)
(if (> a b)
1
(* (term a)
(product term (next a) next b))))
Picrel is an informal outline of the math behind it. Sorry for the handwriting, I'm a lefty
Page 1