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



Bits error versus g



Bits error versus h



Bits error versus a
Results
Initial program 36.0
rmApplied associate-*l/_binary64_479536.0
Applied cbrt-div_binary64_488434.1
Simplified34.1
Taylor expanded around -inf 49.1
Simplified32.2
Final simplification32.2
herbie shell --seed 2021044
(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))))))))