public static double invert(InvertDelegate fn, double low, double high, double i) { double probe; while (high - low > 0.001) { probe = (low + high) / 2; if (fn(probe) > i) { high = probe; } else { low = probe; } } return(low); }
public static double invert(InvertDelegate fn, double low, double high, double i) { double probe; while (high - low > 0.001) { probe = (low + high) / 2; if (fn(probe) > i) high = probe; else low = probe; } return low; }