
(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 12 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 (cbrt (/ (- g) a)))
(t_1 (sqrt (- g h)))
(t_2 (* (+ h g) (- g h)))
(t_3 (sqrt t_2))
(t_4 (- t_3 g))
(t_5 (sqrt (+ h g))))
(if (<= g -1.32e+154)
(+ (cbrt (* (/ h a) (* -0.25 (/ h g)))) t_0)
(if (<= g -6e-114)
(+
(cbrt (/ (* (- t_2 (* g g)) (/ 0.5 a)) (- g t_3)))
(* (cbrt t_4) (cbrt (/ 0.5 a))))
(if (<= g 1.05e-154)
(+ (* (cbrt (* (/ -0.25 a) (/ h g))) (cbrt h)) t_0)
(if (<= g 1.7e+153)
(fma
(cbrt (/ -1.0 a))
(cbrt (/ (fma t_1 t_5 g) 2.0))
(cbrt (* t_4 (/ 0.5 a))))
(+
(/ 1.0 (cbrt (/ (* (- 2.0) a) (fma t_5 t_1 g))))
(/
1.0
(cbrt
(/
(* -2.0 a)
(*
(*
(-
(/ (* (- (/ (* (pow (* 0.0 g) 2.0) 0.25) (* g g)) -1.0) h) g)
(/ (* 0.0 g) g))
0.5)
h)))))))))))
double code(double g, double h, double a) {
double t_0 = cbrt((-g / a));
double t_1 = sqrt((g - h));
double t_2 = (h + g) * (g - h);
double t_3 = sqrt(t_2);
double t_4 = t_3 - g;
double t_5 = sqrt((h + g));
double tmp;
if (g <= -1.32e+154) {
tmp = cbrt(((h / a) * (-0.25 * (h / g)))) + t_0;
} else if (g <= -6e-114) {
tmp = cbrt((((t_2 - (g * g)) * (0.5 / a)) / (g - t_3))) + (cbrt(t_4) * cbrt((0.5 / a)));
} else if (g <= 1.05e-154) {
tmp = (cbrt(((-0.25 / a) * (h / g))) * cbrt(h)) + t_0;
} else if (g <= 1.7e+153) {
tmp = fma(cbrt((-1.0 / a)), cbrt((fma(t_1, t_5, g) / 2.0)), cbrt((t_4 * (0.5 / a))));
} else {
tmp = (1.0 / cbrt(((-2.0 * a) / fma(t_5, t_1, g)))) + (1.0 / cbrt(((-2.0 * a) / ((((((((pow((0.0 * g), 2.0) * 0.25) / (g * g)) - -1.0) * h) / g) - ((0.0 * g) / g)) * 0.5) * h))));
}
return tmp;
}
function code(g, h, a) t_0 = cbrt(Float64(Float64(-g) / a)) t_1 = sqrt(Float64(g - h)) t_2 = Float64(Float64(h + g) * Float64(g - h)) t_3 = sqrt(t_2) t_4 = Float64(t_3 - g) t_5 = sqrt(Float64(h + g)) tmp = 0.0 if (g <= -1.32e+154) tmp = Float64(cbrt(Float64(Float64(h / a) * Float64(-0.25 * Float64(h / g)))) + t_0); elseif (g <= -6e-114) tmp = Float64(cbrt(Float64(Float64(Float64(t_2 - Float64(g * g)) * Float64(0.5 / a)) / Float64(g - t_3))) + Float64(cbrt(t_4) * cbrt(Float64(0.5 / a)))); elseif (g <= 1.05e-154) tmp = Float64(Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(h / g))) * cbrt(h)) + t_0); elseif (g <= 1.7e+153) tmp = fma(cbrt(Float64(-1.0 / a)), cbrt(Float64(fma(t_1, t_5, g) / 2.0)), cbrt(Float64(t_4 * Float64(0.5 / a)))); else tmp = Float64(Float64(1.0 / cbrt(Float64(Float64(Float64(-2.0) * a) / fma(t_5, t_1, g)))) + Float64(1.0 / cbrt(Float64(Float64(-2.0 * a) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64((Float64(0.0 * g) ^ 2.0) * 0.25) / Float64(g * g)) - -1.0) * h) / g) - Float64(Float64(0.0 * g) / g)) * 0.5) * h))))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(g - h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - g), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(h + g), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[g, -1.32e+154], N[(N[Power[N[(N[(h / a), $MachinePrecision] * N[(-0.25 * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, -6e-114], N[(N[Power[N[(N[(N[(t$95$2 - N[(g * g), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision] / N[(g - t$95$3), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[t$95$4, 1/3], $MachinePrecision] * N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[g, 1.05e-154], N[(N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[h, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, 1.7e+153], N[(N[Power[N[(-1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(t$95$1 * t$95$5 + g), $MachinePrecision] / 2.0), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$4 * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Power[N[(N[((-2.0) * a), $MachinePrecision] / N[(t$95$5 * t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[N[(N[(-2.0 * a), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(N[(N[Power[N[(0.0 * g), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] / N[(g * g), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] * h), $MachinePrecision] / g), $MachinePrecision] - N[(N[(0.0 * g), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{-g}{a}}\\
t_1 := \sqrt{g - h}\\
t_2 := \left(h + g\right) \cdot \left(g - h\right)\\
t_3 := \sqrt{t\_2}\\
t_4 := t\_3 - g\\
t_5 := \sqrt{h + g}\\
\mathbf{if}\;g \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{h}{a} \cdot \left(-0.25 \cdot \frac{h}{g}\right)} + t\_0\\
\mathbf{elif}\;g \leq -6 \cdot 10^{-114}:\\
\;\;\;\;\sqrt[3]{\frac{\left(t\_2 - g \cdot g\right) \cdot \frac{0.5}{a}}{g - t\_3}} + \sqrt[3]{t\_4} \cdot \sqrt[3]{\frac{0.5}{a}}\\
\mathbf{elif}\;g \leq 1.05 \cdot 10^{-154}:\\
\;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h}{g}} \cdot \sqrt[3]{h} + t\_0\\
\mathbf{elif}\;g \leq 1.7 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{-1}{a}}, \sqrt[3]{\frac{\mathsf{fma}\left(t\_1, t\_5, g\right)}{2}}, \sqrt[3]{t\_4 \cdot \frac{0.5}{a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{\left(-2\right) \cdot a}{\mathsf{fma}\left(t\_5, t\_1, g\right)}}} + \frac{1}{\sqrt[3]{\frac{-2 \cdot a}{\left(\left(\frac{\left(\frac{{\left(0 \cdot g\right)}^{2} \cdot 0.25}{g \cdot g} - -1\right) \cdot h}{g} - \frac{0 \cdot g}{g}\right) \cdot 0.5\right) \cdot h}}}\\
\end{array}
\end{array}
if g < -1.31999999999999998e154Initial program 0.0%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6461.8
Applied rewrites61.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -1.31999999999999998e154 < g < -6.0000000000000003e-114Initial program 85.1%
lift-cbrt.f64N/A
pow1/3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
pow1/3N/A
lower-cbrt.f6497.7
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6497.7
Applied rewrites97.7%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
sub-negN/A
lift--.f64N/A
Applied rewrites97.8%
if -6.0000000000000003e-114 < g < 1.04999999999999992e-154Initial program 25.8%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6416.2
Applied rewrites16.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6479.0
Applied rewrites79.0%
Applied rewrites80.3%
Applied rewrites80.4%
if 1.04999999999999992e-154 < g < 1.6999999999999999e153Initial program 86.9%
Applied rewrites86.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites87.7%
Applied rewrites97.9%
if 1.6999999999999999e153 < g Initial program 1.9%
Applied rewrites1.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites2.2%
Taylor expanded in h around 0
lower-*.f64N/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites65.1%
Final simplification82.7%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (/ -1.0 (* a 2.0))) (t_1 (sqrt (- (* g g) (* h h)))))
(if (<= (+ (cbrt (* t_0 (+ t_1 g))) (cbrt (* (- g t_1) t_0))) (- INFINITY))
(*
(fma
(* (cbrt -0.5) (cbrt (/ 1.0 (* (* g g) a))))
(cbrt 2.0)
(* (/ (pow (cbrt 0.5) 2.0) g) (cbrt (/ (* 0.0 h) a))))
g)
(+ (cbrt (/ (- g) a)) (* (cbrt (/ -0.25 a)) (cbrt (* (/ h g) h)))))))
double code(double g, double h, double a) {
double t_0 = -1.0 / (a * 2.0);
double t_1 = sqrt(((g * g) - (h * h)));
double tmp;
if ((cbrt((t_0 * (t_1 + g))) + cbrt(((g - t_1) * t_0))) <= -((double) INFINITY)) {
tmp = fma((cbrt(-0.5) * cbrt((1.0 / ((g * g) * a)))), cbrt(2.0), ((pow(cbrt(0.5), 2.0) / g) * cbrt(((0.0 * h) / a)))) * g;
} else {
tmp = cbrt((-g / a)) + (cbrt((-0.25 / a)) * cbrt(((h / g) * h)));
}
return tmp;
}
function code(g, h, a) t_0 = Float64(-1.0 / Float64(a * 2.0)) t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h))) tmp = 0.0 if (Float64(cbrt(Float64(t_0 * Float64(t_1 + g))) + cbrt(Float64(Float64(g - t_1) * t_0))) <= Float64(-Inf)) tmp = Float64(fma(Float64(cbrt(-0.5) * cbrt(Float64(1.0 / Float64(Float64(g * g) * a)))), cbrt(2.0), Float64(Float64((cbrt(0.5) ^ 2.0) / g) * cbrt(Float64(Float64(0.0 * h) / a)))) * g); else tmp = Float64(cbrt(Float64(Float64(-g) / a)) + Float64(cbrt(Float64(-0.25 / a)) * cbrt(Float64(Float64(h / g) * h)))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[(-1.0 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(t$95$0 * N[(t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(g - t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(N[(N[Power[-0.5, 1/3], $MachinePrecision] * N[Power[N[(1.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision] + N[(N[(N[Power[N[Power[0.5, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / g), $MachinePrecision] * N[Power[N[(N[(0.0 * h), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * g), $MachinePrecision], N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(-0.25 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{a \cdot 2}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
\mathbf{if}\;\sqrt[3]{t\_0 \cdot \left(t\_1 + g\right)} + \sqrt[3]{\left(g - t\_1\right) \cdot t\_0} \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{-0.5} \cdot \sqrt[3]{\frac{1}{\left(g \cdot g\right) \cdot a}}, \sqrt[3]{2}, \frac{{\left(\sqrt[3]{0.5}\right)}^{2}}{g} \cdot \sqrt[3]{\frac{0 \cdot h}{a}}\right) \cdot g\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-0.25}{a}} \cdot \sqrt[3]{\frac{h}{g} \cdot h}\\
\end{array}
\end{array}
if (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) < -inf.0Initial program 4.2%
lift-cbrt.f64N/A
pow1/3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
pow1/3N/A
lower-cbrt.f6467.3
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6467.3
Applied rewrites67.3%
Taylor expanded in g around inf
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
Applied rewrites98.7%
if -inf.0 < (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) Initial program 48.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6430.1
Applied rewrites30.1%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6477.5
Applied rewrites77.5%
Applied rewrites77.7%
Final simplification78.2%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (/ -1.0 (* a 2.0)))
(t_1 (sqrt (- (* g g) (* h h))))
(t_2 (cbrt (* t_0 (+ t_1 g)))))
(if (<= (+ t_2 (cbrt (* (- g t_1) t_0))) -1e+61)
(+ (/ (cbrt (- (sqrt (* (+ h g) (- g h))) g)) (cbrt (* a 2.0))) t_2)
(+ (cbrt (/ (- g) a)) (* (cbrt (/ -0.25 a)) (cbrt (* (/ h g) h)))))))
double code(double g, double h, double a) {
double t_0 = -1.0 / (a * 2.0);
double t_1 = sqrt(((g * g) - (h * h)));
double t_2 = cbrt((t_0 * (t_1 + g)));
double tmp;
if ((t_2 + cbrt(((g - t_1) * t_0))) <= -1e+61) {
tmp = (cbrt((sqrt(((h + g) * (g - h))) - g)) / cbrt((a * 2.0))) + t_2;
} else {
tmp = cbrt((-g / a)) + (cbrt((-0.25 / a)) * cbrt(((h / g) * h)));
}
return tmp;
}
public static double code(double g, double h, double a) {
double t_0 = -1.0 / (a * 2.0);
double t_1 = Math.sqrt(((g * g) - (h * h)));
double t_2 = Math.cbrt((t_0 * (t_1 + g)));
double tmp;
if ((t_2 + Math.cbrt(((g - t_1) * t_0))) <= -1e+61) {
tmp = (Math.cbrt((Math.sqrt(((h + g) * (g - h))) - g)) / Math.cbrt((a * 2.0))) + t_2;
} else {
tmp = Math.cbrt((-g / a)) + (Math.cbrt((-0.25 / a)) * Math.cbrt(((h / g) * h)));
}
return tmp;
}
function code(g, h, a) t_0 = Float64(-1.0 / Float64(a * 2.0)) t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h))) t_2 = cbrt(Float64(t_0 * Float64(t_1 + g))) tmp = 0.0 if (Float64(t_2 + cbrt(Float64(Float64(g - t_1) * t_0))) <= -1e+61) tmp = Float64(Float64(cbrt(Float64(sqrt(Float64(Float64(h + g) * Float64(g - h))) - g)) / cbrt(Float64(a * 2.0))) + t_2); else tmp = Float64(cbrt(Float64(Float64(-g) / a)) + Float64(cbrt(Float64(-0.25 / a)) * cbrt(Float64(Float64(h / g) * h)))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[(-1.0 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t$95$0 * N[(t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$2 + N[Power[N[(N[(g - t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], -1e+61], N[(N[(N[Power[N[(N[Sqrt[N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(-0.25 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{a \cdot 2}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
t_2 := \sqrt[3]{t\_0 \cdot \left(t\_1 + g\right)}\\
\mathbf{if}\;t\_2 + \sqrt[3]{\left(g - t\_1\right) \cdot t\_0} \leq -1 \cdot 10^{+61}:\\
\;\;\;\;\frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}} + t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-0.25}{a}} \cdot \sqrt[3]{\frac{h}{g} \cdot h}\\
\end{array}
\end{array}
if (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) < -9.99999999999999949e60Initial program 60.3%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
cbrt-divN/A
*-lft-identityN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites85.7%
if -9.99999999999999949e60 < (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) Initial program 46.4%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.2
Applied rewrites29.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6476.9
Applied rewrites76.9%
Applied rewrites77.1%
Final simplification77.6%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (/ -1.0 (* a 2.0)))
(t_1 (sqrt (- (* g g) (* h h))))
(t_2 (cbrt (* t_0 (+ t_1 g)))))
(if (<= (+ t_2 (cbrt (* (- g t_1) t_0))) -4e+55)
(+ (* (cbrt (- (sqrt (* (+ h g) (- g h))) g)) (cbrt (/ 0.5 a))) t_2)
(+ (cbrt (/ (- g) a)) (* (cbrt (/ -0.25 a)) (cbrt (* (/ h g) h)))))))
double code(double g, double h, double a) {
double t_0 = -1.0 / (a * 2.0);
double t_1 = sqrt(((g * g) - (h * h)));
double t_2 = cbrt((t_0 * (t_1 + g)));
double tmp;
if ((t_2 + cbrt(((g - t_1) * t_0))) <= -4e+55) {
tmp = (cbrt((sqrt(((h + g) * (g - h))) - g)) * cbrt((0.5 / a))) + t_2;
} else {
tmp = cbrt((-g / a)) + (cbrt((-0.25 / a)) * cbrt(((h / g) * h)));
}
return tmp;
}
public static double code(double g, double h, double a) {
double t_0 = -1.0 / (a * 2.0);
double t_1 = Math.sqrt(((g * g) - (h * h)));
double t_2 = Math.cbrt((t_0 * (t_1 + g)));
double tmp;
if ((t_2 + Math.cbrt(((g - t_1) * t_0))) <= -4e+55) {
tmp = (Math.cbrt((Math.sqrt(((h + g) * (g - h))) - g)) * Math.cbrt((0.5 / a))) + t_2;
} else {
tmp = Math.cbrt((-g / a)) + (Math.cbrt((-0.25 / a)) * Math.cbrt(((h / g) * h)));
}
return tmp;
}
function code(g, h, a) t_0 = Float64(-1.0 / Float64(a * 2.0)) t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h))) t_2 = cbrt(Float64(t_0 * Float64(t_1 + g))) tmp = 0.0 if (Float64(t_2 + cbrt(Float64(Float64(g - t_1) * t_0))) <= -4e+55) tmp = Float64(Float64(cbrt(Float64(sqrt(Float64(Float64(h + g) * Float64(g - h))) - g)) * cbrt(Float64(0.5 / a))) + t_2); else tmp = Float64(cbrt(Float64(Float64(-g) / a)) + Float64(cbrt(Float64(-0.25 / a)) * cbrt(Float64(Float64(h / g) * h)))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[(-1.0 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t$95$0 * N[(t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$2 + N[Power[N[(N[(g - t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], -4e+55], N[(N[(N[Power[N[(N[Sqrt[N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(-0.25 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{a \cdot 2}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
t_2 := \sqrt[3]{t\_0 \cdot \left(t\_1 + g\right)}\\
\mathbf{if}\;t\_2 + \sqrt[3]{\left(g - t\_1\right) \cdot t\_0} \leq -4 \cdot 10^{+55}:\\
\;\;\;\;\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g} \cdot \sqrt[3]{\frac{0.5}{a}} + t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-0.25}{a}} \cdot \sqrt[3]{\frac{h}{g} \cdot h}\\
\end{array}
\end{array}
if (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) < -4.00000000000000004e55Initial program 62.7%
lift-cbrt.f64N/A
pow1/3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
pow1/3N/A
lower-cbrt.f6486.3
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6486.3
Applied rewrites86.3%
if -4.00000000000000004e55 < (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) Initial program 46.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.2
Applied rewrites29.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6476.8
Applied rewrites76.8%
Applied rewrites77.0%
Final simplification77.6%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (cbrt (/ (- g) a)))
(t_1 (sqrt (- g h)))
(t_2 (* (+ h g) (- g h)))
(t_3 (sqrt t_2))
(t_4 (- t_3 g))
(t_5 (sqrt (+ h g))))
(if (<= g -1.32e+154)
(+ (cbrt (* (/ h a) (* -0.25 (/ h g)))) t_0)
(if (<= g -6e-114)
(+
(cbrt (/ (* (- t_2 (* g g)) (/ 0.5 a)) (- g t_3)))
(* (cbrt t_4) (cbrt (/ 0.5 a))))
(if (<= g 1.05e-154)
(+ (* (cbrt (* (/ -0.25 a) (/ h g))) (cbrt h)) t_0)
(if (<= g 1.7e+153)
(fma
(cbrt (/ -1.0 a))
(cbrt (/ (fma t_1 t_5 g) 2.0))
(cbrt (* t_4 (/ 0.5 a))))
(+
(/ 1.0 (cbrt (/ (* -2.0 a) (* (* 0.0 h) -0.5))))
(/ 1.0 (cbrt (/ (* (- 2.0) a) (fma t_5 t_1 g)))))))))))
double code(double g, double h, double a) {
double t_0 = cbrt((-g / a));
double t_1 = sqrt((g - h));
double t_2 = (h + g) * (g - h);
double t_3 = sqrt(t_2);
double t_4 = t_3 - g;
double t_5 = sqrt((h + g));
double tmp;
if (g <= -1.32e+154) {
tmp = cbrt(((h / a) * (-0.25 * (h / g)))) + t_0;
} else if (g <= -6e-114) {
tmp = cbrt((((t_2 - (g * g)) * (0.5 / a)) / (g - t_3))) + (cbrt(t_4) * cbrt((0.5 / a)));
} else if (g <= 1.05e-154) {
tmp = (cbrt(((-0.25 / a) * (h / g))) * cbrt(h)) + t_0;
} else if (g <= 1.7e+153) {
tmp = fma(cbrt((-1.0 / a)), cbrt((fma(t_1, t_5, g) / 2.0)), cbrt((t_4 * (0.5 / a))));
} else {
tmp = (1.0 / cbrt(((-2.0 * a) / ((0.0 * h) * -0.5)))) + (1.0 / cbrt(((-2.0 * a) / fma(t_5, t_1, g))));
}
return tmp;
}
function code(g, h, a) t_0 = cbrt(Float64(Float64(-g) / a)) t_1 = sqrt(Float64(g - h)) t_2 = Float64(Float64(h + g) * Float64(g - h)) t_3 = sqrt(t_2) t_4 = Float64(t_3 - g) t_5 = sqrt(Float64(h + g)) tmp = 0.0 if (g <= -1.32e+154) tmp = Float64(cbrt(Float64(Float64(h / a) * Float64(-0.25 * Float64(h / g)))) + t_0); elseif (g <= -6e-114) tmp = Float64(cbrt(Float64(Float64(Float64(t_2 - Float64(g * g)) * Float64(0.5 / a)) / Float64(g - t_3))) + Float64(cbrt(t_4) * cbrt(Float64(0.5 / a)))); elseif (g <= 1.05e-154) tmp = Float64(Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(h / g))) * cbrt(h)) + t_0); elseif (g <= 1.7e+153) tmp = fma(cbrt(Float64(-1.0 / a)), cbrt(Float64(fma(t_1, t_5, g) / 2.0)), cbrt(Float64(t_4 * Float64(0.5 / a)))); else tmp = Float64(Float64(1.0 / cbrt(Float64(Float64(-2.0 * a) / Float64(Float64(0.0 * h) * -0.5)))) + Float64(1.0 / cbrt(Float64(Float64(Float64(-2.0) * a) / fma(t_5, t_1, g))))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(g - h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - g), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(h + g), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[g, -1.32e+154], N[(N[Power[N[(N[(h / a), $MachinePrecision] * N[(-0.25 * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, -6e-114], N[(N[Power[N[(N[(N[(t$95$2 - N[(g * g), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision] / N[(g - t$95$3), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[t$95$4, 1/3], $MachinePrecision] * N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[g, 1.05e-154], N[(N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[h, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, 1.7e+153], N[(N[Power[N[(-1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(t$95$1 * t$95$5 + g), $MachinePrecision] / 2.0), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$4 * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Power[N[(N[(-2.0 * a), $MachinePrecision] / N[(N[(0.0 * h), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[N[(N[((-2.0) * a), $MachinePrecision] / N[(t$95$5 * t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{-g}{a}}\\
t_1 := \sqrt{g - h}\\
t_2 := \left(h + g\right) \cdot \left(g - h\right)\\
t_3 := \sqrt{t\_2}\\
t_4 := t\_3 - g\\
t_5 := \sqrt{h + g}\\
\mathbf{if}\;g \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{h}{a} \cdot \left(-0.25 \cdot \frac{h}{g}\right)} + t\_0\\
\mathbf{elif}\;g \leq -6 \cdot 10^{-114}:\\
\;\;\;\;\sqrt[3]{\frac{\left(t\_2 - g \cdot g\right) \cdot \frac{0.5}{a}}{g - t\_3}} + \sqrt[3]{t\_4} \cdot \sqrt[3]{\frac{0.5}{a}}\\
\mathbf{elif}\;g \leq 1.05 \cdot 10^{-154}:\\
\;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h}{g}} \cdot \sqrt[3]{h} + t\_0\\
\mathbf{elif}\;g \leq 1.7 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{-1}{a}}, \sqrt[3]{\frac{\mathsf{fma}\left(t\_1, t\_5, g\right)}{2}}, \sqrt[3]{t\_4 \cdot \frac{0.5}{a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{-2 \cdot a}{\left(0 \cdot h\right) \cdot -0.5}}} + \frac{1}{\sqrt[3]{\frac{\left(-2\right) \cdot a}{\mathsf{fma}\left(t\_5, t\_1, g\right)}}}\\
\end{array}
\end{array}
if g < -1.31999999999999998e154Initial program 0.0%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6461.8
Applied rewrites61.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -1.31999999999999998e154 < g < -6.0000000000000003e-114Initial program 85.1%
lift-cbrt.f64N/A
pow1/3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
pow1/3N/A
lower-cbrt.f6497.7
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6497.7
Applied rewrites97.7%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
sub-negN/A
lift--.f64N/A
Applied rewrites97.8%
if -6.0000000000000003e-114 < g < 1.04999999999999992e-154Initial program 25.8%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6416.2
Applied rewrites16.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6479.0
Applied rewrites79.0%
Applied rewrites80.3%
Applied rewrites80.4%
if 1.04999999999999992e-154 < g < 1.6999999999999999e153Initial program 86.9%
Applied rewrites86.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites87.7%
Applied rewrites97.9%
if 1.6999999999999999e153 < g Initial program 1.9%
Applied rewrites1.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites2.2%
Taylor expanded in g around inf
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6463.1
Applied rewrites63.1%
Final simplification82.3%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (cbrt (/ (- g) a)))
(t_1 (sqrt (- g h)))
(t_2 (- (sqrt (* (+ h g) (- g h))) g))
(t_3 (sqrt (+ h g))))
(if (<= g -1.32e+154)
(+ (cbrt (* (/ h a) (* -0.25 (/ h g)))) t_0)
(if (<= g -6e-114)
(+ (/ (cbrt t_2) (cbrt (* a 2.0))) (cbrt (* (/ (* h h) g) (/ -0.25 a))))
(if (<= g 1.05e-154)
(+ (* (cbrt (* (/ -0.25 a) (/ h g))) (cbrt h)) t_0)
(if (<= g 1.7e+153)
(fma
(cbrt (/ -1.0 a))
(cbrt (/ (fma t_1 t_3 g) 2.0))
(cbrt (* t_2 (/ 0.5 a))))
(+
(/ 1.0 (cbrt (/ (* -2.0 a) (* (* 0.0 h) -0.5))))
(/ 1.0 (cbrt (/ (* (- 2.0) a) (fma t_3 t_1 g)))))))))))
double code(double g, double h, double a) {
double t_0 = cbrt((-g / a));
double t_1 = sqrt((g - h));
double t_2 = sqrt(((h + g) * (g - h))) - g;
double t_3 = sqrt((h + g));
double tmp;
if (g <= -1.32e+154) {
tmp = cbrt(((h / a) * (-0.25 * (h / g)))) + t_0;
} else if (g <= -6e-114) {
tmp = (cbrt(t_2) / cbrt((a * 2.0))) + cbrt((((h * h) / g) * (-0.25 / a)));
} else if (g <= 1.05e-154) {
tmp = (cbrt(((-0.25 / a) * (h / g))) * cbrt(h)) + t_0;
} else if (g <= 1.7e+153) {
tmp = fma(cbrt((-1.0 / a)), cbrt((fma(t_1, t_3, g) / 2.0)), cbrt((t_2 * (0.5 / a))));
} else {
tmp = (1.0 / cbrt(((-2.0 * a) / ((0.0 * h) * -0.5)))) + (1.0 / cbrt(((-2.0 * a) / fma(t_3, t_1, g))));
}
return tmp;
}
function code(g, h, a) t_0 = cbrt(Float64(Float64(-g) / a)) t_1 = sqrt(Float64(g - h)) t_2 = Float64(sqrt(Float64(Float64(h + g) * Float64(g - h))) - g) t_3 = sqrt(Float64(h + g)) tmp = 0.0 if (g <= -1.32e+154) tmp = Float64(cbrt(Float64(Float64(h / a) * Float64(-0.25 * Float64(h / g)))) + t_0); elseif (g <= -6e-114) tmp = Float64(Float64(cbrt(t_2) / cbrt(Float64(a * 2.0))) + cbrt(Float64(Float64(Float64(h * h) / g) * Float64(-0.25 / a)))); elseif (g <= 1.05e-154) tmp = Float64(Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(h / g))) * cbrt(h)) + t_0); elseif (g <= 1.7e+153) tmp = fma(cbrt(Float64(-1.0 / a)), cbrt(Float64(fma(t_1, t_3, g) / 2.0)), cbrt(Float64(t_2 * Float64(0.5 / a)))); else tmp = Float64(Float64(1.0 / cbrt(Float64(Float64(-2.0 * a) / Float64(Float64(0.0 * h) * -0.5)))) + Float64(1.0 / cbrt(Float64(Float64(Float64(-2.0) * a) / fma(t_3, t_1, g))))); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(g - h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(h + g), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[g, -1.32e+154], N[(N[Power[N[(N[(h / a), $MachinePrecision] * N[(-0.25 * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, -6e-114], N[(N[(N[Power[t$95$2, 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * N[(-0.25 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[g, 1.05e-154], N[(N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[h, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, 1.7e+153], N[(N[Power[N[(-1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(t$95$1 * t$95$3 + g), $MachinePrecision] / 2.0), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$2 * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Power[N[(N[(-2.0 * a), $MachinePrecision] / N[(N[(0.0 * h), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[N[(N[((-2.0) * a), $MachinePrecision] / N[(t$95$3 * t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{-g}{a}}\\
t_1 := \sqrt{g - h}\\
t_2 := \sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g\\
t_3 := \sqrt{h + g}\\
\mathbf{if}\;g \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{h}{a} \cdot \left(-0.25 \cdot \frac{h}{g}\right)} + t\_0\\
\mathbf{elif}\;g \leq -6 \cdot 10^{-114}:\\
\;\;\;\;\frac{\sqrt[3]{t\_2}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}}\\
\mathbf{elif}\;g \leq 1.05 \cdot 10^{-154}:\\
\;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h}{g}} \cdot \sqrt[3]{h} + t\_0\\
\mathbf{elif}\;g \leq 1.7 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{-1}{a}}, \sqrt[3]{\frac{\mathsf{fma}\left(t\_1, t\_3, g\right)}{2}}, \sqrt[3]{t\_2 \cdot \frac{0.5}{a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{-2 \cdot a}{\left(0 \cdot h\right) \cdot -0.5}}} + \frac{1}{\sqrt[3]{\frac{\left(-2\right) \cdot a}{\mathsf{fma}\left(t\_3, t\_1, g\right)}}}\\
\end{array}
\end{array}
if g < -1.31999999999999998e154Initial program 0.0%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6461.8
Applied rewrites61.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -1.31999999999999998e154 < g < -6.0000000000000003e-114Initial program 85.1%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6416.8
Applied rewrites16.8%
lift-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
sub-negN/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites22.5%
Taylor expanded in g around -inf
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6497.7
Applied rewrites97.7%
if -6.0000000000000003e-114 < g < 1.04999999999999992e-154Initial program 25.8%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6416.2
Applied rewrites16.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6479.0
Applied rewrites79.0%
Applied rewrites80.3%
Applied rewrites80.4%
if 1.04999999999999992e-154 < g < 1.6999999999999999e153Initial program 86.9%
Applied rewrites86.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites87.7%
Applied rewrites97.9%
if 1.6999999999999999e153 < g Initial program 1.9%
Applied rewrites1.9%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
*-lft-identityN/A
Applied rewrites2.2%
Taylor expanded in g around inf
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6463.1
Applied rewrites63.1%
Final simplification82.3%
(FPCore (g h a)
:precision binary64
(let* ((t_0 (cbrt (/ (- g) a))))
(if (<= g -1.32e+154)
(+ (cbrt (* (/ h a) (* -0.25 (/ h g)))) t_0)
(if (<= g -6e-114)
(+
(/ (cbrt (- (sqrt (* (+ h g) (- g h))) g)) (cbrt (* a 2.0)))
(cbrt (* (/ (* h h) g) (/ -0.25 a))))
(+ (* (cbrt (* (/ -0.25 a) (/ h g))) (cbrt h)) t_0)))))
double code(double g, double h, double a) {
double t_0 = cbrt((-g / a));
double tmp;
if (g <= -1.32e+154) {
tmp = cbrt(((h / a) * (-0.25 * (h / g)))) + t_0;
} else if (g <= -6e-114) {
tmp = (cbrt((sqrt(((h + g) * (g - h))) - g)) / cbrt((a * 2.0))) + cbrt((((h * h) / g) * (-0.25 / a)));
} else {
tmp = (cbrt(((-0.25 / a) * (h / g))) * cbrt(h)) + t_0;
}
return tmp;
}
public static double code(double g, double h, double a) {
double t_0 = Math.cbrt((-g / a));
double tmp;
if (g <= -1.32e+154) {
tmp = Math.cbrt(((h / a) * (-0.25 * (h / g)))) + t_0;
} else if (g <= -6e-114) {
tmp = (Math.cbrt((Math.sqrt(((h + g) * (g - h))) - g)) / Math.cbrt((a * 2.0))) + Math.cbrt((((h * h) / g) * (-0.25 / a)));
} else {
tmp = (Math.cbrt(((-0.25 / a) * (h / g))) * Math.cbrt(h)) + t_0;
}
return tmp;
}
function code(g, h, a) t_0 = cbrt(Float64(Float64(-g) / a)) tmp = 0.0 if (g <= -1.32e+154) tmp = Float64(cbrt(Float64(Float64(h / a) * Float64(-0.25 * Float64(h / g)))) + t_0); elseif (g <= -6e-114) tmp = Float64(Float64(cbrt(Float64(sqrt(Float64(Float64(h + g) * Float64(g - h))) - g)) / cbrt(Float64(a * 2.0))) + cbrt(Float64(Float64(Float64(h * h) / g) * Float64(-0.25 / a)))); else tmp = Float64(Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(h / g))) * cbrt(h)) + t_0); end return tmp end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[g, -1.32e+154], N[(N[Power[N[(N[(h / a), $MachinePrecision] * N[(-0.25 * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[g, -6e-114], N[(N[(N[Power[N[(N[Sqrt[N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * N[(-0.25 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[h, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{-g}{a}}\\
\mathbf{if}\;g \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{h}{a} \cdot \left(-0.25 \cdot \frac{h}{g}\right)} + t\_0\\
\mathbf{elif}\;g \leq -6 \cdot 10^{-114}:\\
\;\;\;\;\frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h}{g}} \cdot \sqrt[3]{h} + t\_0\\
\end{array}
\end{array}
if g < -1.31999999999999998e154Initial program 0.0%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6461.8
Applied rewrites61.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.8
Applied rewrites61.8%
if -1.31999999999999998e154 < g < -6.0000000000000003e-114Initial program 85.1%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6416.8
Applied rewrites16.8%
lift-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-neg.f64N/A
sub-negN/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites22.5%
Taylor expanded in g around -inf
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6497.7
Applied rewrites97.7%
if -6.0000000000000003e-114 < g Initial program 45.5%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6444.2
Applied rewrites44.2%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6476.1
Applied rewrites76.1%
Applied rewrites76.4%
Applied rewrites76.4%
Final simplification79.2%
(FPCore (g h a) :precision binary64 (+ (cbrt (/ (- g) a)) (* (cbrt (/ -0.25 a)) (cbrt (* (/ h g) h)))))
double code(double g, double h, double a) {
return cbrt((-g / a)) + (cbrt((-0.25 / a)) * cbrt(((h / g) * h)));
}
public static double code(double g, double h, double a) {
return Math.cbrt((-g / a)) + (Math.cbrt((-0.25 / a)) * Math.cbrt(((h / g) * h)));
}
function code(g, h, a) return Float64(cbrt(Float64(Float64(-g) / a)) + Float64(cbrt(Float64(-0.25 / a)) * cbrt(Float64(Float64(h / g) * h)))) end
code[g_, h_, a_] := N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(-0.25 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-0.25}{a}} \cdot \sqrt[3]{\frac{h}{g} \cdot h}
\end{array}
Initial program 47.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.5
Applied rewrites29.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Final simplification75.9%
(FPCore (g h a) :precision binary64 (+ (* (cbrt (* (/ -0.25 a) (/ h g))) (cbrt h)) (cbrt (/ (- g) a))))
double code(double g, double h, double a) {
return (cbrt(((-0.25 / a) * (h / g))) * cbrt(h)) + cbrt((-g / a));
}
public static double code(double g, double h, double a) {
return (Math.cbrt(((-0.25 / a) * (h / g))) * Math.cbrt(h)) + Math.cbrt((-g / a));
}
function code(g, h, a) return Float64(Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(h / g))) * cbrt(h)) + cbrt(Float64(Float64(-g) / a))) end
code[g_, h_, a_] := N[(N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[h, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h}{g}} \cdot \sqrt[3]{h} + \sqrt[3]{\frac{-g}{a}}
\end{array}
Initial program 47.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.5
Applied rewrites29.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites75.9%
Final simplification75.9%
(FPCore (g h a) :precision binary64 (+ (cbrt (* (/ h a) (* -0.25 (/ h g)))) (cbrt (/ (- g) a))))
double code(double g, double h, double a) {
return cbrt(((h / a) * (-0.25 * (h / g)))) + cbrt((-g / a));
}
public static double code(double g, double h, double a) {
return Math.cbrt(((h / a) * (-0.25 * (h / g)))) + Math.cbrt((-g / a));
}
function code(g, h, a) return Float64(cbrt(Float64(Float64(h / a) * Float64(-0.25 * Float64(h / g)))) + cbrt(Float64(Float64(-g) / a))) end
code[g_, h_, a_] := N[(N[Power[N[(N[(h / a), $MachinePrecision] * N[(-0.25 * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{h}{a} \cdot \left(-0.25 \cdot \frac{h}{g}\right)} + \sqrt[3]{\frac{-g}{a}}
\end{array}
Initial program 47.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.5
Applied rewrites29.5%
Taylor expanded in g around inf
lower-*.f64N/A
lower-cbrt.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6475.8
Applied rewrites75.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6475.8
Applied rewrites75.8%
Final simplification75.8%
(FPCore (g h a) :precision binary64 (+ (cbrt (* (- (- g) g) (/ 1.0 (* a 2.0)))) (cbrt (/ (- g) a))))
double code(double g, double h, double a) {
return cbrt(((-g - g) * (1.0 / (a * 2.0)))) + cbrt((-g / a));
}
public static double code(double g, double h, double a) {
return Math.cbrt(((-g - g) * (1.0 / (a * 2.0)))) + Math.cbrt((-g / a));
}
function code(g, h, a) return Float64(cbrt(Float64(Float64(Float64(-g) - g) * Float64(1.0 / Float64(a * 2.0)))) + cbrt(Float64(Float64(-g) / a))) end
code[g_, h_, a_] := N[(N[Power[N[(N[((-g) - g), $MachinePrecision] * N[(1.0 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\left(\left(-g\right) - g\right) \cdot \frac{1}{a \cdot 2}} + \sqrt[3]{\frac{-g}{a}}
\end{array}
Initial program 47.2%
Taylor expanded in g around inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6429.5
Applied rewrites29.5%
Taylor expanded in g around -inf
mul-1-negN/A
lower-neg.f6415.3
Applied rewrites15.3%
Final simplification15.3%
(FPCore (g h a) :precision binary64 0.0)
double code(double g, double h, double a) {
return 0.0;
}
real(8) function code(g, h, a)
real(8), intent (in) :: g
real(8), intent (in) :: h
real(8), intent (in) :: a
code = 0.0d0
end function
public static double code(double g, double h, double a) {
return 0.0;
}
def code(g, h, a): return 0.0
function code(g, h, a) return 0.0 end
function tmp = code(g, h, a) tmp = 0.0; end
code[g_, h_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 47.2%
lift-cbrt.f64N/A
pow1/3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
pow1/3N/A
lower-cbrt.f6450.7
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6450.7
Applied rewrites50.7%
Taylor expanded in g around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
metadata-evalN/A
lower-cbrt.f643.0
Applied rewrites3.0%
Applied rewrites3.0%
herbie shell --seed 2024325
(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))))))))