
(FPCore (g h a) :precision binary64 (let* ((t_0 (/ 1.0 (* 2.0 a))) (t_1 (sqrt (- (* g g) (* h h))))) (+ (cbrt (* t_0 (+ (- g) t_1))) (cbrt (* t_0 (- (- g) t_1))))))
double code(double g, double h, double a) {
double t_0 = 1.0 / (2.0 * a);
double t_1 = sqrt(((g * g) - (h * h)));
return cbrt((t_0 * (-g + t_1))) + cbrt((t_0 * (-g - t_1)));
}
public static double code(double g, double h, double a) {
double t_0 = 1.0 / (2.0 * a);
double t_1 = Math.sqrt(((g * g) - (h * h)));
return Math.cbrt((t_0 * (-g + t_1))) + Math.cbrt((t_0 * (-g - t_1)));
}
function code(g, h, a) t_0 = Float64(1.0 / Float64(2.0 * a)) t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h))) return Float64(cbrt(Float64(t_0 * Float64(Float64(-g) + t_1))) + cbrt(Float64(t_0 * Float64(Float64(-g) - t_1)))) end
code[g_, h_, a_] := Block[{t$95$0 = N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(t$95$0 * N[((-g) + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$0 * N[((-g) - t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{2 \cdot a}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
\sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (g h a) :precision binary64 (let* ((t_0 (/ 1.0 (* 2.0 a))) (t_1 (sqrt (- (* g g) (* h h))))) (+ (cbrt (* t_0 (+ (- g) t_1))) (cbrt (* t_0 (- (- g) t_1))))))
double code(double g, double h, double a) {
double t_0 = 1.0 / (2.0 * a);
double t_1 = sqrt(((g * g) - (h * h)));
return cbrt((t_0 * (-g + t_1))) + cbrt((t_0 * (-g - t_1)));
}
public static double code(double g, double h, double a) {
double t_0 = 1.0 / (2.0 * a);
double t_1 = Math.sqrt(((g * g) - (h * h)));
return Math.cbrt((t_0 * (-g + t_1))) + Math.cbrt((t_0 * (-g - t_1)));
}
function code(g, h, a) t_0 = Float64(1.0 / Float64(2.0 * a)) t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h))) return Float64(cbrt(Float64(t_0 * Float64(Float64(-g) + t_1))) + cbrt(Float64(t_0 * Float64(Float64(-g) - t_1)))) end
code[g_, h_, a_] := Block[{t$95$0 = N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(t$95$0 * N[((-g) + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$0 * N[((-g) - t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{2 \cdot a}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
\sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)}
\end{array}
\end{array}
(FPCore (g h a)
:precision binary64
(let* ((t_0 (sqrt (- (pow g 2.0) (pow h 2.0)))))
(if (<= g -2e-99)
(+
(* (cbrt (/ 0.5 a)) (cbrt (- t_0 g)))
(cbrt (* (/ (pow h 2.0) a) (/ -0.5 (- g t_0)))))
(+ (/ (cbrt (- g)) (cbrt a)) (cbrt (* (- g g) (/ -0.5 a)))))))
double code(double g, double h, double a) {
double t_0 = sqrt((pow(g, 2.0) - pow(h, 2.0)));
double tmp;
if (g <= -2e-99) {
tmp = (cbrt((0.5 / a)) * cbrt((t_0 - g))) + cbrt(((pow(h, 2.0) / a) * (-0.5 / (g - t_0))));
} else {
tmp = (cbrt(-g) / cbrt(a)) + cbrt(((g - g) * (-0.5 / a)));
}
return tmp;
}
public static double code(double g, double h, double a) {
double t_0 = Math.sqrt((Math.pow(g, 2.0) - Math.pow(h, 2.0)));
double tmp;
if (g <= -2e-99) {
tmp = (Math.cbrt((0.5 / a)) * Math.cbrt((t_0 - g))) + Math.cbrt(((Math.pow(h, 2.0) / a) * (-0.5 / (g - t_0))));
} else {
tmp = (Math.cbrt(-g) / Math.cbrt(a)) + Math.cbrt(((g - g) * (-0.5 / a)));
}
return tmp;
}
function code(g, h, a) t_0 = sqrt(Float64((g ^ 2.0) - (h ^ 2.0))) tmp = 0.0 if (g <= -2e-99) tmp = Float64(Float64(cbrt(Float64(0.5 / a)) * cbrt(Float64(t_0 - g))) + cbrt(Float64(Float64((h ^ 2.0) / a) * Float64(-0.5 / Float64(g - t_0))))); else tmp = Float64(Float64(cbrt(Float64(-g)) / cbrt(a)) + cbrt(Float64(Float64(g - g) * Float64(-0.5 / a)))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Sqrt[N[(N[Power[g, 2.0], $MachinePrecision] - N[Power[h, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[g, -2e-99], N[(N[(N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(t$95$0 - g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(N[Power[h, 2.0], $MachinePrecision] / a), $MachinePrecision] * N[(-0.5 / N[(g - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[(-g), 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(g - g), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{g}^{2} - {h}^{2}}\\
\mathbf{if}\;g \leq -2 \cdot 10^{-99}:\\
\;\;\;\;\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{t\_0 - g} + \sqrt[3]{\frac{{h}^{2}}{a} \cdot \frac{-0.5}{g - t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{-g}}{\sqrt[3]{a}} + \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}}\\
\end{array}
\end{array}
if g < -2e-99Initial program 62.4%
Simplified62.4%
cbrt-prod65.0%
pow265.0%
pow265.0%
Applied egg-rr65.0%
flip-+65.5%
frac-2neg65.5%
metadata-eval65.5%
frac-times62.2%
add-sqr-sqrt62.4%
associate--r-74.2%
pow274.2%
pow274.2%
pow274.2%
Applied egg-rr74.2%
times-frac81.1%
distribute-frac-neg281.1%
distribute-neg-frac81.1%
metadata-eval81.1%
times-frac74.2%
*-commutative74.2%
times-frac75.5%
+-inverses75.5%
+-lft-identity75.5%
Simplified75.5%
if -2e-99 < g Initial program 46.0%
Simplified46.0%
Taylor expanded in g around -inf 11.6%
*-commutative11.6%
Simplified11.6%
Taylor expanded in g around -inf 74.5%
neg-mul-174.5%
Simplified74.5%
associate-*l/74.5%
cbrt-div94.4%
*-commutative94.4%
associate-*r*94.4%
metadata-eval94.4%
neg-mul-194.4%
Applied egg-rr94.4%
Final simplification93.1%
(FPCore (g h a) :precision binary64 (if (<= a 3.3e+269) (- (cbrt (* (- g g) (/ -0.5 a))) (cbrt (/ g a))) (+ (/ (cbrt (- g)) (cbrt a)) (cbrt (/ g (- a))))))
double code(double g, double h, double a) {
double tmp;
if (a <= 3.3e+269) {
tmp = cbrt(((g - g) * (-0.5 / a))) - cbrt((g / a));
} else {
tmp = (cbrt(-g) / cbrt(a)) + cbrt((g / -a));
}
return tmp;
}
public static double code(double g, double h, double a) {
double tmp;
if (a <= 3.3e+269) {
tmp = Math.cbrt(((g - g) * (-0.5 / a))) - Math.cbrt((g / a));
} else {
tmp = (Math.cbrt(-g) / Math.cbrt(a)) + Math.cbrt((g / -a));
}
return tmp;
}
function code(g, h, a) tmp = 0.0 if (a <= 3.3e+269) tmp = Float64(cbrt(Float64(Float64(g - g) * Float64(-0.5 / a))) - cbrt(Float64(g / a))); else tmp = Float64(Float64(cbrt(Float64(-g)) / cbrt(a)) + cbrt(Float64(g / Float64(-a)))); end return tmp end
code[g_, h_, a_] := If[LessEqual[a, 3.3e+269], N[(N[Power[N[(N[(g - g), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[(-g), 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.3 \cdot 10^{+269}:\\
\;\;\;\;\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} - \sqrt[3]{\frac{g}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{-g}}{\sqrt[3]{a}} + \sqrt[3]{\frac{g}{-a}}\\
\end{array}
\end{array}
if a < 3.2999999999999998e269Initial program 48.1%
Simplified48.1%
Taylor expanded in g around -inf 14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in g around -inf 74.5%
neg-mul-174.5%
Simplified74.5%
Taylor expanded in g around -inf 74.6%
mul-1-neg16.0%
Simplified74.6%
if 3.2999999999999998e269 < a Initial program 23.4%
Simplified23.4%
Taylor expanded in g around -inf 7.5%
*-commutative7.5%
Simplified7.5%
Taylor expanded in g around inf 7.5%
mul-1-neg7.5%
distribute-frac-neg7.5%
Simplified7.5%
associate-*l/23.4%
cbrt-div85.5%
*-commutative85.5%
associate-*r*85.5%
metadata-eval85.5%
neg-mul-185.5%
Applied egg-rr69.6%
Final simplification74.4%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (cbrt (/ g a))))
(if (<= a 3.3e+269)
(- (cbrt (* (- g g) (/ -0.5 a))) t_0)
(+ t_0 (/ (cbrt g) (cbrt (- a)))))))
double code(double g, double h, double a) {
double t_0 = cbrt((g / a));
double tmp;
if (a <= 3.3e+269) {
tmp = cbrt(((g - g) * (-0.5 / a))) - t_0;
} else {
tmp = t_0 + (cbrt(g) / cbrt(-a));
}
return tmp;
}
public static double code(double g, double h, double a) {
double t_0 = Math.cbrt((g / a));
double tmp;
if (a <= 3.3e+269) {
tmp = Math.cbrt(((g - g) * (-0.5 / a))) - t_0;
} else {
tmp = t_0 + (Math.cbrt(g) / Math.cbrt(-a));
}
return tmp;
}
function code(g, h, a) t_0 = cbrt(Float64(g / a)) tmp = 0.0 if (a <= 3.3e+269) tmp = Float64(cbrt(Float64(Float64(g - g) * Float64(-0.5 / a))) - t_0); else tmp = Float64(t_0 + Float64(cbrt(g) / cbrt(Float64(-a)))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[a, 3.3e+269], N[(N[Power[N[(N[(g - g), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$0 + N[(N[Power[g, 1/3], $MachinePrecision] / N[Power[(-a), 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{g}{a}}\\
\mathbf{if}\;a \leq 3.3 \cdot 10^{+269}:\\
\;\;\;\;\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{\sqrt[3]{g}}{\sqrt[3]{-a}}\\
\end{array}
\end{array}
if a < 3.2999999999999998e269Initial program 48.1%
Simplified48.1%
Taylor expanded in g around -inf 14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in g around -inf 74.5%
neg-mul-174.5%
Simplified74.5%
Taylor expanded in g around -inf 74.6%
mul-1-neg16.0%
Simplified74.6%
if 3.2999999999999998e269 < a Initial program 23.4%
Simplified23.4%
Taylor expanded in g around -inf 7.5%
*-commutative7.5%
Simplified7.5%
Taylor expanded in g around inf 7.5%
mul-1-neg7.5%
distribute-frac-neg7.5%
Simplified7.5%
associate-*l/7.5%
*-commutative7.5%
associate-*r*7.5%
metadata-eval7.5%
neg-mul-17.5%
add-sqr-sqrt0.5%
sqrt-unprod4.5%
sqr-neg4.5%
sqrt-prod4.6%
add-sqr-sqrt4.5%
Applied egg-rr4.5%
frac-2neg4.5%
cbrt-div67.9%
remove-double-neg67.9%
Applied egg-rr67.9%
Final simplification74.3%
(FPCore (g h a) :precision binary64 (+ (/ (cbrt (- g)) (cbrt a)) (cbrt (* (- g g) (/ -0.5 a)))))
double code(double g, double h, double a) {
return (cbrt(-g) / cbrt(a)) + cbrt(((g - g) * (-0.5 / a)));
}
public static double code(double g, double h, double a) {
return (Math.cbrt(-g) / Math.cbrt(a)) + Math.cbrt(((g - g) * (-0.5 / a)));
}
function code(g, h, a) return Float64(Float64(cbrt(Float64(-g)) / cbrt(a)) + cbrt(Float64(Float64(g - g) * Float64(-0.5 / a)))) end
code[g_, h_, a_] := N[(N[(N[Power[(-g), 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(g - g), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{-g}}{\sqrt[3]{a}} + \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around -inf 72.5%
neg-mul-172.5%
Simplified72.5%
associate-*l/72.6%
cbrt-div91.4%
*-commutative91.4%
associate-*r*91.4%
metadata-eval91.4%
neg-mul-191.4%
Applied egg-rr91.4%
Final simplification91.4%
(FPCore (g h a) :precision binary64 (- (cbrt (* (- g g) (/ -0.5 a))) (cbrt (/ g a))))
double code(double g, double h, double a) {
return cbrt(((g - g) * (-0.5 / a))) - cbrt((g / a));
}
public static double code(double g, double h, double a) {
return Math.cbrt(((g - g) * (-0.5 / a))) - Math.cbrt((g / a));
}
function code(g, h, a) return Float64(cbrt(Float64(Float64(g - g) * Float64(-0.5 / a))) - cbrt(Float64(g / a))) end
code[g_, h_, a_] := N[(N[Power[N[(N[(g - g), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} - \sqrt[3]{\frac{g}{a}}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around -inf 72.5%
neg-mul-172.5%
Simplified72.5%
Taylor expanded in g around -inf 72.6%
mul-1-neg15.6%
Simplified72.6%
Final simplification72.6%
(FPCore (g h a) :precision binary64 (+ (cbrt (/ g (- a))) (cbrt (/ -1.0 (/ a g)))))
double code(double g, double h, double a) {
return cbrt((g / -a)) + cbrt((-1.0 / (a / g)));
}
public static double code(double g, double h, double a) {
return Math.cbrt((g / -a)) + Math.cbrt((-1.0 / (a / g)));
}
function code(g, h, a) return Float64(cbrt(Float64(g / Float64(-a))) + cbrt(Float64(-1.0 / Float64(a / g)))) end
code[g_, h_, a_] := N[(N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(-1.0 / N[(a / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{-a}} + \sqrt[3]{\frac{-1}{\frac{a}{g}}}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around inf 15.6%
mul-1-neg15.6%
distribute-frac-neg15.6%
Simplified15.6%
associate-*l/15.6%
*-commutative15.6%
associate-*r*15.6%
metadata-eval15.6%
neg-mul-115.6%
clear-num15.7%
frac-2neg15.7%
metadata-eval15.7%
add-sqr-sqrt1.5%
sqrt-unprod8.6%
sqr-neg8.6%
sqrt-prod3.0%
add-sqr-sqrt3.0%
distribute-frac-neg23.0%
add-sqr-sqrt0.4%
sqrt-unprod15.7%
sqr-neg15.7%
sqrt-prod14.3%
add-sqr-sqrt15.7%
Applied egg-rr15.7%
Final simplification15.7%
(FPCore (g h a) :precision binary64 (+ (cbrt (/ g a)) (cbrt (/ g (- a)))))
double code(double g, double h, double a) {
return cbrt((g / a)) + cbrt((g / -a));
}
public static double code(double g, double h, double a) {
return Math.cbrt((g / a)) + Math.cbrt((g / -a));
}
function code(g, h, a) return Float64(cbrt(Float64(g / a)) + cbrt(Float64(g / Float64(-a)))) end
code[g_, h_, a_] := N[(N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{a}} + \sqrt[3]{\frac{g}{-a}}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around inf 15.6%
mul-1-neg15.6%
distribute-frac-neg15.6%
Simplified15.6%
associate-*l/15.6%
*-commutative15.6%
associate-*r*15.6%
metadata-eval15.6%
neg-mul-115.6%
add-sqr-sqrt1.5%
sqrt-unprod8.4%
sqr-neg8.4%
sqrt-prod2.8%
add-sqr-sqrt2.6%
Applied egg-rr2.6%
Final simplification2.6%
(FPCore (g h a) :precision binary64 (- (cbrt (/ g (- a))) (cbrt (/ g a))))
double code(double g, double h, double a) {
return cbrt((g / -a)) - cbrt((g / a));
}
public static double code(double g, double h, double a) {
return Math.cbrt((g / -a)) - Math.cbrt((g / a));
}
function code(g, h, a) return Float64(cbrt(Float64(g / Float64(-a))) - cbrt(Float64(g / a))) end
code[g_, h_, a_] := N[(N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{-a}} - \sqrt[3]{\frac{g}{a}}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around inf 15.6%
mul-1-neg15.6%
distribute-frac-neg15.6%
Simplified15.6%
Taylor expanded in g around -inf 15.6%
mul-1-neg15.6%
Simplified15.6%
Final simplification15.6%
(FPCore (g h a) :precision binary64 (let* ((t_0 (cbrt (/ g a)))) (+ t_0 t_0)))
double code(double g, double h, double a) {
double t_0 = cbrt((g / a));
return t_0 + t_0;
}
public static double code(double g, double h, double a) {
double t_0 = Math.cbrt((g / a));
return t_0 + t_0;
}
function code(g, h, a) t_0 = cbrt(Float64(g / a)) return Float64(t_0 + t_0) end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$0 + t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{g}{a}}\\
t\_0 + t\_0
\end{array}
\end{array}
Initial program 47.1%
Simplified47.1%
Taylor expanded in g around -inf 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in g around inf 15.6%
mul-1-neg15.6%
distribute-frac-neg15.6%
Simplified15.6%
associate-*l/15.6%
*-commutative15.6%
associate-*r*15.6%
metadata-eval15.6%
neg-mul-115.6%
add-sqr-sqrt1.5%
sqrt-unprod8.4%
sqr-neg8.4%
sqrt-prod2.8%
add-sqr-sqrt2.6%
Applied egg-rr2.6%
div-inv2.9%
neg-mul-12.9%
metadata-eval2.9%
associate-*r*2.9%
*-commutative2.9%
div-inv2.6%
associate-*l/2.9%
*-un-lft-identity2.9%
associate-*l/2.6%
*-commutative2.6%
associate-*r*2.6%
metadata-eval2.6%
neg-mul-12.6%
add-sqr-sqrt0.2%
sqrt-unprod1.4%
sqr-neg1.4%
sqrt-prod1.3%
add-sqr-sqrt1.4%
Applied egg-rr1.4%
*-lft-identity1.4%
Simplified1.4%
Final simplification1.4%
herbie shell --seed 2024073
(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))))))))