[Python] 纯文本查看 复制代码{lamb} python
Python 2.7.11 |Anaconda 2.4.1 (64-bit)| (default, Dec 7 2015, 14:10:42) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: [url=http://continuum.io/thanks]http://continuum.io/thanks[/url] and [url=https://anaconda.org]https://anaconda.org[/url]
>>> import newton
>>> print newton.__doc__
This module 'newton' is auto-generated with f2py (version:2).
Functions:
f = f(x)
df = df(x)
newton_raphson()
.
>>> newton.newton_raphson()
Enter origin x0 :
5
f(x)= 23.064 when x= 3.589 at iteration 1
f(x)= 6.533 when x= 2.677 at iteration 2
f(x)= 1.680 when x= 2.124 at iteration 3
f(x)= 0.317 when x= 1.845 at iteration 4
f(x)= 0.024 when x= 1.762 at iteration 5
f(x)= 0.000 when x= 1.755 at iteration 6
f(x)= -0.000 when x= 1.755 at iteration 7
1.754878
>>>