Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def secant(p, pOld, tol, iters):
iters -= 1
pOld = p
pNew = p - (f(p))*(p - pOld)
if abs(pNew - p) < tol or iters == 0:
return pNew
secant(pNew, pOld, tol)
def f(x):
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment