RosettaCodeData/Task/Trabb-Pardo-Knuth-algorithm/EchoLisp/trabb-pardo-knuth-algorithm...

21 lines
449 B
Plaintext

(trabb)
;; input : (0 4 1 8 5 9 10 3 6 7 2)
🌱 f(2) = 41.41421356237309
❌ f(7) = 1717.6457513110645
❌ f(6) = 1082.4494897427833
🌱 f(3) = 136.73205080756887
❌ f(10) = 5003.162277660168
❌ f(9) = 3648
❌ f(5) = 627.2360679774998
❌ f(8) = 2562.828427124746
🌱 f(1) = 6
🌱 f(4) = 322
🌱 f(0) = 0
;; extra credit : let's find the threshold
(lib 'math)
(define (g x) (- (trabb-fun x) 400))
(root g 0 10)
→ 4.301409367213084