using System; using static System.Math; public static partial class roots{ public static readonly double DELTA = Pow(2,-26); public static matrix jacobian (Func f,vector x,vector fx=null,vector dx=null){ int n=x.size; // if(dx==null) dx = x.map(t => Max(Abs(t),1)*DELTA); if(dx==null) dx = x.map(t => Abs(t)*DELTA); matrix J=new matrix(n,n); if(fx == null)fx=f(x); for(int j=0;j