2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)2 \cdot \left(2 \cdot \log \left(\sqrt[3]{e^{\cos \left(\frac{3 \cdot \left(\cos^{-1} \left(\frac{-g}{h}\right) + 2 \cdot \pi\right)}{3 \cdot 3}\right)}}\right) + \log \left(\sqrt[3]{e^{\cos \left(\frac{3 \cdot \left(\cos^{-1} \left(\frac{-g}{h}\right) + 2 \cdot \pi\right)}{3 \cdot 3}\right)}}\right)\right)double code(double g, double h) {
return (2.0 * cos((((2.0 * ((double) M_PI)) / 3.0) + (acos((-g / h)) / 3.0))));
}
double code(double g, double h) {
return (2.0 * ((2.0 * log(cbrt(exp(cos(((3.0 * (acos((-g / h)) + (2.0 * ((double) M_PI)))) / (3.0 * 3.0))))))) + log(cbrt(exp(cos(((3.0 * (acos((-g / h)) + (2.0 * ((double) M_PI)))) / (3.0 * 3.0))))))));
}



Bits error versus g



Bits error versus h
Results
Initial program 1.0
rmApplied frac-add1.0
Simplified1.0
rmApplied add-log-exp1.0
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020049
(FPCore (g h)
:name "2-ancestry mixing, negative discriminant"
:precision binary64
(* 2 (cos (+ (/ (* 2 PI) 3) (/ (acos (/ (- g) h)) 3)))))