mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-25 22:38:04 +02:00
12 lines
225 B
Python
12 lines
225 B
Python
|
from math import exp, log
|
||
|
|
||
|
def iterate(x):
|
||
|
#return x - (2.0*x - exp(-x))/(2.0+exp(-x)) #Newton
|
||
|
#return 0.5*exp(-x) #F_1
|
||
|
return (-1)*log(2.0*x) #F_2
|
||
|
|
||
|
x = 0.9
|
||
|
for i in range(10):
|
||
|
print (i, x)
|
||
|
x = iterate(x)
|