44 double xa, xb, xm, x_b;
47 long s_fa, s_fb, s_fm;
75 f_bdd = 1000 * fabs(fa);
76 fm = (*fn)(xm = (xa + xb) / 2) - value;
82 else if (s_fm != s_fa) {
91 fm = (*fn)(xm = (xa + xb) / 2) - value;
94 }
while (f_abs > _zero && f_abs < f_bdd);
double zeroIntHalve(double(*fn)(), double value, double x_i, double x_f, double dx, double _zero)
Finds the zero of a function within a specified interval using interval halving.