18 lines
335 B
Python
18 lines
335 B
Python
import math
|
|
|
|
try:
|
|
x_zero = float(input("X0 eingeben: "))
|
|
except ValueError as error:
|
|
print(f"Value {error} is not a number")
|
|
quit()
|
|
|
|
n = 1
|
|
T = math.e ** x_zero + 2 * x_zero
|
|
print(T)
|
|
while(T>10**-16):
|
|
f_a2 = math.e ** x_zero + 2
|
|
x_zero -= T/f_a2
|
|
T = math.e ** x_zero + 2 * x_zero
|
|
n += 1
|
|
print(T)
|
|
print(n) |