-->
0 Members and 1 Guest are viewing this topic.
ClrHomeInput "X0:",AInput "X1:",BInput "F(X):",Str1Input "ITERATIONS:",I{A,B->L1For(Q,2,I+1L1(Q)->Xexpr(Str1->AL1(Q-1)->Xexpr(Str1->B(L1(Q-1)A-L1(Q)B)/(A-B->L1(Q+1EndL1
In other news, Frey continues kicking unprecedented levels of ass.
Define LibPub secant(a,b,c)=Prgm:© A program to carry out the secant method:setMode(1,1):Disp "When r = 0":Disp "x0 = ",a:Disp "f(x0) =",f1(a):Disp "":Disp "When r = 1":Disp "x1 = ",b:Disp "f(x1) =",f1(b):Disp "":For d,1,c,1:Local e:e:=((a*f1(b)-b*f1(a))/(f1(b)-f1(a))):Disp "When r =",1+d:Disp "x",1+d," = ",e▶Decimal:Disp "f(x",1+d,") = ",f1(e):Disp "":a:=b:b:=e:EndFor::EndPrgm