Last active
November 22, 2018 12:37
-
-
Save dmishin/5baff0f2aa1ce90213162c10aedb10a1 to your computer and use it in GitHub Desktop.
Numerically calculate fractional iterate of x^2-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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