\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{\frac{\frac{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right), \sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)}, b \cdot \left(b \cdot \left(-b\right)\right)\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right), \sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)}, b \cdot \left(b \cdot \left(-b\right)\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right), \sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)}, b \cdot \left(b \cdot \left(-b\right)\right)\right)\right)}}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + b, \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)\right)\right)\right)}}{a}}{2}double f(double a, double b, double c) {
double r1887652 = b;
double r1887653 = -r1887652;
double r1887654 = r1887652 * r1887652;
double r1887655 = 4.0;
double r1887656 = a;
double r1887657 = r1887655 * r1887656;
double r1887658 = c;
double r1887659 = r1887657 * r1887658;
double r1887660 = r1887654 - r1887659;
double r1887661 = sqrt(r1887660);
double r1887662 = r1887653 + r1887661;
double r1887663 = 2.0;
double r1887664 = r1887663 * r1887656;
double r1887665 = r1887662 / r1887664;
return r1887665;
}
double f(double a, double b, double c) {
double r1887666 = -4.0;
double r1887667 = a;
double r1887668 = r1887666 * r1887667;
double r1887669 = c;
double r1887670 = b;
double r1887671 = r1887670 * r1887670;
double r1887672 = fma(r1887668, r1887669, r1887671);
double r1887673 = sqrt(r1887672);
double r1887674 = -r1887670;
double r1887675 = r1887670 * r1887674;
double r1887676 = r1887670 * r1887675;
double r1887677 = fma(r1887672, r1887673, r1887676);
double r1887678 = r1887677 * r1887677;
double r1887679 = r1887677 * r1887678;
double r1887680 = cbrt(r1887679);
double r1887681 = r1887673 + r1887670;
double r1887682 = log1p(r1887672);
double r1887683 = expm1(r1887682);
double r1887684 = fma(r1887670, r1887681, r1887683);
double r1887685 = r1887680 / r1887684;
double r1887686 = r1887685 / r1887667;
double r1887687 = 2.0;
double r1887688 = r1887686 / r1887687;
return r1887688;
}



Bits error versus a



Bits error versus b



Bits error versus c
Initial program 28.3
Simplified28.3
rmApplied flip3--28.4
Simplified27.6
Simplified27.6
rmApplied fma-neg27.0
rmApplied expm1-log1p-u27.1
rmApplied add-cbrt-cube27.1
Final simplification27.1
herbie shell --seed 2019165 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))