Update newton_raphson.py

This commit is contained in:
Christian Clauss 2023-07-16 17:16:21 +02:00 committed by GitHub
parent 8d6f837303
commit cbaeaa035c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,8 @@ def newton_raphson(
>>> newton_raphson("log(x)- 1", 2)
2.718281828458938
>>> from scipy.optimize import newton
>>> all(newton_raphson("log(x)- 1", 2) == newton("log(x)- 1", 2) for precision in 10, 100, 1000, 10000))
>>> all(newton_raphson("log(x)- 1", 2) == newton("log(x)- 1", 2)
... for precision in 10, 100, 1000, 10000))
True
>>> newton_raphson("log(x)- 1", 2, 0)
Traceback (most recent call last):