Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Numerically calculate fractional iterate of x^2-2
def approxfi(x, n):
#Apply x -> F(x) mapping until x is sufficiently large
k = 0
while (x < 1e14) and (k<100):
x = x**2-2
k += 1
#Calculate approximate fractional iterate for large argument
x = x**(2**n)
#Apply reverse mapping x -> F[-1](x)
for _ in range(k):
x = (x+2)**0.5
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.