|
!'Householder's Method
INPUT PROMPT "X=":T
LET XX=T
DO
LET X=XX
LET XX=X-F(X)/DF1(X)*(1+F(X)*DF2(X)/2/DF1(X)^2)
PRINT XX
LOOP UNTIL ABS(X-XX)<1E-13
PRINT X;X^3
FUNCTION F(X)
LET F=X*X*X-T
END FUNCTION
FUNCTION DF1(X)
LET DF1=3*X^2
END FUNCTION
FUNCTION DF2(X)
LET DF2=6*X
END FUNCTION
END
|
|