\\ newton(v,epsilon): given a vector v with F(v) small,
\\ perform an approximate Newton iteration step,
\\ using difference quotients of size epsilon
\\ instead of derivatives. This assumes that F
\\ has alrady been defined and is a C1 function
\\ taking vectors to vectors of the same length.
\\ If v is within O(|epsilon|) of a zero of F
\\ where F' is invertible then newton(v,epsilon)
\\ is within O(|epsilon|^2), assuming the precision
\\ is sufficient to accommodate such a good approximation.
\\ --Noam D. Elkies, 2003-6
{
newton(v,epsilon, n,fv,v1,fv1,i,j)= n=length(v); fv=F(v);
m = matrix(n,n);
for(i=1,n, v1=v; v1[i]+=epsilon; fv1=F(v1)-fv;
for(j=1,n,m[i,j]=fv1[j]));
v - epsilon*matsolve(m~,fv~)~
}