\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)}\frac{\sqrt[3]{0.5 \cdot \left(\sqrt{g \cdot g - h \cdot h} - g\right)}}{\sqrt[3]{a}} + \sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}(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 (* 0.5 (- (sqrt (- (* g g) (* h h))) g))) (cbrt a)) (* (cbrt (/ 0.5 a)) (cbrt (- (- g) (sqrt (- (* g g) (* h h))))))))
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(0.5 * (sqrt((g * g) - (h * h)) - g)) / cbrt(a)) + (cbrt(0.5 / a) * cbrt(-g - sqrt((g * g) - (h * h))));
}



Bits error versus g



Bits error versus h



Bits error versus a
Results
Initial program 35.9
rmApplied cbrt-prod_binary64_54133.7
Simplified33.7
rmApplied add-cbrt-cube_binary64_54633.7
Simplified33.7
rmApplied associate-*l/_binary64_63633.7
Applied cbrt-div_binary64_54233.7
Applied cube-div_binary64_54833.7
Applied cbrt-div_binary64_54231.7
Simplified31.7
Simplified31.7
Final simplification31.7
herbie shell --seed 2020231
(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))))))))