Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
import math
oldPhi = 1.0
phi = 1.0
iters = 0
limit = 1e-5
while True:
phi = 1.0 + 1.0 / oldPhi
iters += 1
if math.fabs(phi - oldPhi) <= limit: break
oldPhi = phi
print(f'Final value of phi : {phi:16.14f}')
actualPhi = (1.0 + math.sqrt(5.0)) / 2.0
print(f'Number of iterations : {iters}')
print(f'Error (approx) : {phi - actualPhi:16.14f}')