\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\sqrt[3]{\sqrt{g \cdot g - h \cdot h} - g} \cdot \sqrt[3]{\frac{0.5}{a}} + \frac{\sqrt[3]{\left(g + \sqrt{g \cdot g - h \cdot h}\right) \cdot -0.5}}{\sqrt[3]{a}}(FPCore (g h a) :precision binary64 (+ (cbrt (* (/ 1.0 (* 2.0 a)) (+ (- g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1.0 (* 2.0 a)) (- (- g) (sqrt (- (* g g) (* h h))))))))
(FPCore (g h a) :precision binary64 (+ (* (cbrt (- (sqrt (- (* g g) (* h h))) g)) (cbrt (/ 0.5 a))) (/ (cbrt (* (+ g (sqrt (- (* g g) (* h h)))) -0.5)) (cbrt a))))
double code(double g, double h, double a) {
return cbrt((1.0 / (2.0 * a)) * (-g + sqrt((g * g) - (h * h)))) + cbrt((1.0 / (2.0 * a)) * (-g - sqrt((g * g) - (h * h))));
}
double code(double g, double h, double a) {
return (cbrt(sqrt((g * g) - (h * h)) - g) * cbrt(0.5 / a)) + (cbrt((g + sqrt((g * g) - (h * h))) * -0.5) / cbrt(a));
}



Bits error versus g



Bits error versus h



Bits error versus a
Results
Initial program 35.3
Simplified35.3
rmApplied div-inv_binary6435.3
Applied cbrt-prod_binary6433.4
Simplified33.4
rmApplied associate-*l/_binary6433.4
Applied cbrt-div_binary6431.8
Final simplification31.8
herbie shell --seed 2020273
(FPCore (g h a)
:name "2-ancestry mixing, positive discriminant"
:precision binary64
(+ (cbrt (* (/ 1.0 (* 2.0 a)) (+ (- g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1.0 (* 2.0 a)) (- (- g) (sqrt (- (* g g) (* h h))))))))