
(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 8 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 (/ -1.0 (* (cbrt a) (/ 1.0 (cbrt g)))))
double code(double g, double h, double a) {
return -1.0 / (cbrt(a) * (1.0 / cbrt(g)));
}
public static double code(double g, double h, double a) {
return -1.0 / (Math.cbrt(a) * (1.0 / Math.cbrt(g)));
}
function code(g, h, a) return Float64(-1.0 / Float64(cbrt(a) * Float64(1.0 / cbrt(g)))) end
code[g_, h_, a_] := N[(-1.0 / N[(N[Power[a, 1/3], $MachinePrecision] * N[(1.0 / N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{\sqrt[3]{a} \cdot \frac{1}{\sqrt[3]{g}}}
\end{array}
Initial program 41.7%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6470.9%
Simplified70.9%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.0%
Applied egg-rr96.0%
frac-2negN/A
div-invN/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f6496.1%
Applied egg-rr96.1%
*-commutativeN/A
sub0-negN/A
distribute-rgt-neg-outN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sub0-negN/A
frac-2negN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.1%
Applied egg-rr96.1%
Final simplification96.1%
(FPCore (g h a) :precision binary64 (/ -1.0 (/ (cbrt a) (cbrt g))))
double code(double g, double h, double a) {
return -1.0 / (cbrt(a) / cbrt(g));
}
public static double code(double g, double h, double a) {
return -1.0 / (Math.cbrt(a) / Math.cbrt(g));
}
function code(g, h, a) return Float64(-1.0 / Float64(cbrt(a) / cbrt(g))) end
code[g_, h_, a_] := N[(-1.0 / N[(N[Power[a, 1/3], $MachinePrecision] / N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}
\end{array}
Initial program 41.7%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6470.9%
Simplified70.9%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.0%
Applied egg-rr96.0%
Final simplification96.0%
(FPCore (g h a) :precision binary64 (/ (cbrt g) (- 0.0 (cbrt a))))
double code(double g, double h, double a) {
return cbrt(g) / (0.0 - cbrt(a));
}
public static double code(double g, double h, double a) {
return Math.cbrt(g) / (0.0 - Math.cbrt(a));
}
function code(g, h, a) return Float64(cbrt(g) / Float64(0.0 - cbrt(a))) end
code[g_, h_, a_] := N[(N[Power[g, 1/3], $MachinePrecision] / N[(0.0 - N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{g}}{0 - \sqrt[3]{a}}
\end{array}
Initial program 41.7%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6470.9%
Simplified70.9%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6471.6%
Applied egg-rr71.6%
cbrt-divN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.0%
Applied egg-rr96.0%
Final simplification96.0%
(FPCore (g h a)
:precision binary64
(if (<= a 7.2e-159)
(/ -1.0 (cbrt (/ a g)))
(if (<= a 3.5e-12)
(/ -1.0 (/ 1.0 (/ (cbrt (* g (* a a))) a)))
(- 0.0 (cbrt (/ g a))))))
double code(double g, double h, double a) {
double tmp;
if (a <= 7.2e-159) {
tmp = -1.0 / cbrt((a / g));
} else if (a <= 3.5e-12) {
tmp = -1.0 / (1.0 / (cbrt((g * (a * a))) / a));
} else {
tmp = 0.0 - cbrt((g / a));
}
return tmp;
}
public static double code(double g, double h, double a) {
double tmp;
if (a <= 7.2e-159) {
tmp = -1.0 / Math.cbrt((a / g));
} else if (a <= 3.5e-12) {
tmp = -1.0 / (1.0 / (Math.cbrt((g * (a * a))) / a));
} else {
tmp = 0.0 - Math.cbrt((g / a));
}
return tmp;
}
function code(g, h, a) tmp = 0.0 if (a <= 7.2e-159) tmp = Float64(-1.0 / cbrt(Float64(a / g))); elseif (a <= 3.5e-12) tmp = Float64(-1.0 / Float64(1.0 / Float64(cbrt(Float64(g * Float64(a * a))) / a))); else tmp = Float64(0.0 - cbrt(Float64(g / a))); end return tmp end
code[g_, h_, a_] := If[LessEqual[a, 7.2e-159], N[(-1.0 / N[Power[N[(a / g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-12], N[(-1.0 / N[(1.0 / N[(N[Power[N[(g * N[(a * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{-159}:\\
\;\;\;\;\frac{-1}{\sqrt[3]{\frac{a}{g}}}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\frac{1}{\frac{\sqrt[3]{g \cdot \left(a \cdot a\right)}}{a}}}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt[3]{\frac{g}{a}}\\
\end{array}
\end{array}
if a < 7.20000000000000042e-159Initial program 39.5%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6468.4%
Simplified68.4%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.4%
Applied egg-rr96.4%
sub0-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
cbrt-undivN/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6470.1%
Applied egg-rr70.1%
if 7.20000000000000042e-159 < a < 3.5e-12Initial program 36.0%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6449.0%
Simplified49.0%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6493.6%
Applied egg-rr93.6%
frac-2negN/A
div-invN/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f6493.6%
Applied egg-rr93.6%
flip3--N/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr81.3%
if 3.5e-12 < a Initial program 52.8%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6491.1%
Simplified91.1%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6491.9%
Applied egg-rr91.9%
Final simplification75.4%
(FPCore (g h a)
:precision binary64
(if (<= a 8e-158)
(/ -1.0 (cbrt (/ a g)))
(if (<= a 1.3e-10)
(/ -1.0 (/ a (cbrt (* g (* a a)))))
(- 0.0 (cbrt (/ g a))))))
double code(double g, double h, double a) {
double tmp;
if (a <= 8e-158) {
tmp = -1.0 / cbrt((a / g));
} else if (a <= 1.3e-10) {
tmp = -1.0 / (a / cbrt((g * (a * a))));
} else {
tmp = 0.0 - cbrt((g / a));
}
return tmp;
}
public static double code(double g, double h, double a) {
double tmp;
if (a <= 8e-158) {
tmp = -1.0 / Math.cbrt((a / g));
} else if (a <= 1.3e-10) {
tmp = -1.0 / (a / Math.cbrt((g * (a * a))));
} else {
tmp = 0.0 - Math.cbrt((g / a));
}
return tmp;
}
function code(g, h, a) tmp = 0.0 if (a <= 8e-158) tmp = Float64(-1.0 / cbrt(Float64(a / g))); elseif (a <= 1.3e-10) tmp = Float64(-1.0 / Float64(a / cbrt(Float64(g * Float64(a * a))))); else tmp = Float64(0.0 - cbrt(Float64(g / a))); end return tmp end
code[g_, h_, a_] := If[LessEqual[a, 8e-158], N[(-1.0 / N[Power[N[(a / g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e-10], N[(-1.0 / N[(a / N[Power[N[(g * N[(a * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8 \cdot 10^{-158}:\\
\;\;\;\;\frac{-1}{\sqrt[3]{\frac{a}{g}}}\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\frac{a}{\sqrt[3]{g \cdot \left(a \cdot a\right)}}}\\
\mathbf{else}:\\
\;\;\;\;0 - \sqrt[3]{\frac{g}{a}}\\
\end{array}
\end{array}
if a < 8.00000000000000052e-158Initial program 39.5%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6468.4%
Simplified68.4%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.4%
Applied egg-rr96.4%
sub0-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
cbrt-undivN/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6470.1%
Applied egg-rr70.1%
if 8.00000000000000052e-158 < a < 1.29999999999999991e-10Initial program 36.0%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6449.0%
Simplified49.0%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6493.6%
Applied egg-rr93.6%
frac-2negN/A
div-invN/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
cbrt-lowering-cbrt.f6493.6%
Applied egg-rr93.6%
flip3--N/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
/-lowering-/.f64N/A
metadata-evalN/A
rem-cube-cbrtN/A
neg-sub0N/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
Applied egg-rr81.2%
if 1.29999999999999991e-10 < a Initial program 52.8%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6491.1%
Simplified91.1%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6491.9%
Applied egg-rr91.9%
Final simplification75.4%
(FPCore (g h a) :precision binary64 (/ -1.0 (cbrt (/ a g))))
double code(double g, double h, double a) {
return -1.0 / cbrt((a / g));
}
public static double code(double g, double h, double a) {
return -1.0 / Math.cbrt((a / g));
}
function code(g, h, a) return Float64(-1.0 / cbrt(Float64(a / g))) end
code[g_, h_, a_] := N[(-1.0 / N[Power[N[(a / g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{\sqrt[3]{\frac{a}{g}}}
\end{array}
Initial program 41.7%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6470.9%
Simplified70.9%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6496.0%
Applied egg-rr96.0%
sub0-negN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
cbrt-undivN/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6471.8%
Applied egg-rr71.8%
(FPCore (g h a) :precision binary64 (- 0.0 (cbrt (/ g a))))
double code(double g, double h, double a) {
return 0.0 - cbrt((g / a));
}
public static double code(double g, double h, double a) {
return 0.0 - Math.cbrt((g / a));
}
function code(g, h, a) return Float64(0.0 - cbrt(Float64(g / a))) end
code[g_, h_, a_] := N[(0.0 - N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 - \sqrt[3]{\frac{g}{a}}
\end{array}
Initial program 41.7%
Taylor expanded in g around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6470.9%
Simplified70.9%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f6471.6%
Applied egg-rr71.6%
Final simplification71.6%
(FPCore (g h a) :precision binary64 (cbrt (/ g a)))
double code(double g, double h, double a) {
return cbrt((g / a));
}
public static double code(double g, double h, double a) {
return Math.cbrt((g / a));
}
function code(g, h, a) return cbrt(Float64(g / a)) end
code[g_, h_, a_] := N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{a}}
\end{array}
Initial program 41.7%
Taylor expanded in g around inf
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6471.0%
Simplified71.0%
*-commutativeN/A
*-commutativeN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
*-commutativeN/A
pow1/3N/A
pow1/3N/A
pow-prod-downN/A
metadata-evalN/A
pow1/3N/A
unpow-prod-downN/A
clear-numN/A
div-invN/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
/-lowering-/.f641.3%
Applied egg-rr1.3%
herbie shell --seed 2024155
(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))))))))