\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)}
\begin{array}{l}
t_0 := \sqrt{g \cdot g - h \cdot h}\\
\sqrt[3]{t_0 - g} \cdot \sqrt[3]{\frac{0.5}{a}} + \left(\sqrt[3]{g + t_0} \cdot \sqrt[3]{\frac{1}{a}}\right) \cdot \sqrt[3]{-0.5}
\end{array}
(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
(let* ((t_0 (sqrt (- (* g g) (* h h)))))
(+
(* (cbrt (- t_0 g)) (cbrt (/ 0.5 a)))
(* (* (cbrt (+ g t_0)) (cbrt (/ 1.0 a))) (cbrt -0.5)))))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) {
double t_0 = sqrt((g * g) - (h * h));
return (cbrt(t_0 - g) * cbrt(0.5 / a)) + ((cbrt(g + t_0) * cbrt(1.0 / a)) * cbrt(-0.5));
}



Bits error versus g



Bits error versus h



Bits error versus a
Results
Initial program 36.3
Simplified36.3
Applied div-inv_binary6436.3
Applied cbrt-prod_binary6434.3
Simplified34.3
Applied cbrt-prod_binary6434.3
Applied div-inv_binary6434.3
Applied cbrt-prod_binary6432.7
Final simplification32.7
herbie shell --seed 2021357
(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))))))))