This commit is contained in:
lwj
2025-06-14 11:40:57 +08:00
parent b509f51ceb
commit 852ee942ef
5 changed files with 15 additions and 9 deletions

View File

@@ -17,11 +17,11 @@ def SecantSolve(fx, x0, x1, err=1e-10, N0=100):
x1 = x2
return x2,1
#把精度要求改成题干要求的##########################
if __name__ == "__main__":
err = 1e-5
N0 = 100
##把初始函数和初始值改成题干要求的##########################
x0 = 0.3
x1 = 0.4
fx = lambda x: x**4 - 3*x + 1