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



Bits error versus g



Bits error versus h



Bits error versus a
Initial program 36.0
Applied associate-*l/_binary6436.0
Applied cbrt-div_binary6434.1
Simplified34.1
Applied cbrt-prod_binary6432.4
Simplified32.4
Simplified32.4
Applied prod-diff_binary6432.4
Final simplification32.4
herbie shell --seed 2022077
(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))))))))