map214nw.py
import math as m # metodo de newton-raphson def newton_raphson(x0,f,df, eps): print "{0:2} {1:20}\n".format("N", "raiz") N=0 x1=x0 - f(x0)/df(x0) while (df(x0)!=0) & (abs(f(x0))>eps): x1=x0 - f(x0)/df(x0) if abs(x1-x0)<= eps : break else: x0=x1 N+=1 print "{0:2} {1:20}\n".format( str(N) , str(x1)) return x1
Generated by GNU Enscript 1.6.5.2.