Skip to content

Instantly share code, notes, and snippets.

@RomainL972
Created December 10, 2019 03:35
Show Gist options
  • Save RomainL972/825a735c70c5295f821a1bd7b7143150 to your computer and use it in GitHub Desktop.
Save RomainL972/825a735c70c5295f821a1bd7b7143150 to your computer and use it in GitHub Desktop.
from math import exp
u = 1/2
p=0
uplus1= (7*exp(u)+1)/(exp(u)+3)
while uplus1 - u >= pow(10,-5):
u = uplus1
uplus1 = (7*exp(u)+1)/(exp(u)+3)
p += 1
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment