Newton's Method for approximating a solution of f(x)=0.
After entering your function, initial appropximation, 
number of iterations, and precision, press Enter.

/* User input comes first */
f: x^3-8*x^2+7*x-10  $/* Function f(x) */
x0: 1   $/* Initial estimate */
N: 15   $/* Number of iterations */
fpprec: 32   $/* Precision - Number of significant digits used in computations */
/* End of user input */

set_display(ascii)$
fp: diff(f,x,1)$
xn: bfloat(x0)$
print("x", 0, "=", xn)$
for i: 1 thru N do
(
   xn: bfloat( xn - at(f,x=xn) / at(fp,x=xn) ),
   print("x", i, "=", xn)
);