精选优质文档-倾情为你奉上from math import logfrom math import sin,cosimport random#Q1def bifection(f,a,b,error,n):f stands for the function we want to approximate to, while a and b are theleft and right number of the interval where the f effects in, and n means for thetime we have tried to make a approximationbifection(f,0,1,10*-6,20)FA = f(a)for i in range(n):p = a + (b-a)/2FP = f(p)if FP = 0 or (b - a)/2 0:a = pelse:b = p
Copyright © 2018-2021 Wenke99.com All rights reserved
工信部备案号:浙ICP备20026746号-2
公安局备案号:浙公网安备33038302330469号
本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。