2-ancestry mixing, positive discriminant

Percentage Accurate: 45.3% → 95.7%
Time: 17.8s
Alternatives: 8
Speedup: 4.1×

Specification

?
\[\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 (/ 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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 45.3% accurate, 1.0× speedup?

\[\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 (/ 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}

Alternative 1: 95.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \frac{-1}{\sqrt[3]{a} \cdot \frac{1}{\sqrt[3]{g}}} \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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    7. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    9. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6470.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified70.9%

    \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    5. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    6. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
    7. pow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    9. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    10. unpow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    11. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    12. div-invN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    13. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    14. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
    15. cbrt-divN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
    16. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
    17. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
    18. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
    19. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
    20. cbrt-lowering-cbrt.f6496.0%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
  7. Applied egg-rr96.0%

    \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
  8. Step-by-step derivation
    1. frac-2negN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{\mathsf{neg}\left(\sqrt[3]{a}\right)}{\color{blue}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
    2. div-invN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)}\right)\right)\right) \]
    4. neg-sub0N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(0 - \sqrt[3]{a}\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \left(\sqrt[3]{a}\right)\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
    6. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\sqrt[3]{g}\right)\right)}\right)\right)\right)\right) \]
    8. neg-sub0N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \left(0 - \color{blue}{\sqrt[3]{g}}\right)\right)\right)\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6496.1%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(g\right)\right)\right)\right)\right)\right) \]
  9. Applied egg-rr96.1%

    \[\leadsto 0 - \frac{1}{\color{blue}{\left(0 - \sqrt[3]{a}\right) \cdot \frac{1}{0 - \sqrt[3]{g}}}} \]
  10. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{1}{0 - \sqrt[3]{g}} \cdot \color{blue}{\left(0 - \sqrt[3]{a}\right)}\right)\right)\right) \]
    2. sub0-negN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{1}{0 - \sqrt[3]{g}} \cdot \left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    3. distribute-rgt-neg-outN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\mathsf{neg}\left(\frac{1}{0 - \sqrt[3]{g}} \cdot \sqrt[3]{a}\right)\right)\right)\right) \]
    4. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\left(\frac{1}{0 - \sqrt[3]{g}} \cdot \sqrt[3]{a}\right)\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{0 - \sqrt[3]{g}}\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(-1\right)}{0 - \sqrt[3]{g}}\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    7. sub0-negN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{\sqrt[3]{g}}\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \left(\sqrt[3]{g}\right)\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(g\right)\right), \left(\sqrt[3]{a}\right)\right)\right)\right)\right) \]
    11. cbrt-lowering-cbrt.f6496.1%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(g\right)\right), \mathsf{cbrt.f64}\left(a\right)\right)\right)\right)\right) \]
  11. Applied egg-rr96.1%

    \[\leadsto 0 - \frac{1}{\color{blue}{-\frac{-1}{\sqrt[3]{g}} \cdot \sqrt[3]{a}}} \]
  12. Final simplification96.1%

    \[\leadsto \frac{-1}{\sqrt[3]{a} \cdot \frac{1}{\sqrt[3]{g}}} \]
  13. Add Preprocessing

Alternative 2: 95.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \frac{-1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}} \end{array} \]
(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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    7. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    9. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6470.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified70.9%

    \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    5. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    6. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
    7. pow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    9. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    10. unpow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    11. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    12. div-invN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    13. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    14. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
    15. cbrt-divN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
    16. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
    17. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
    18. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
    19. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
    20. cbrt-lowering-cbrt.f6496.0%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
  7. Applied egg-rr96.0%

    \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
  8. Final simplification96.0%

    \[\leadsto \frac{-1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}} \]
  9. Add Preprocessing

Alternative 3: 95.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \frac{\sqrt[3]{g}}{0 - \sqrt[3]{a}} \end{array} \]
(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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    7. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    9. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6470.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified70.9%

    \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
  6. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right) \]
    2. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right)\right) \]
    5. associate-*r*N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    7. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    8. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    9. pow-prod-downN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    11. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    12. unpow-prod-downN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    13. clear-numN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    14. div-invN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    15. clear-numN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    16. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
    17. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right)\right) \]
    18. /-lowering-/.f6471.6%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right)\right) \]
  7. Applied egg-rr71.6%

    \[\leadsto \color{blue}{-\sqrt[3]{\frac{g}{a}}} \]
  8. Step-by-step derivation
    1. cbrt-divN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\sqrt[3]{g}}{\sqrt[3]{a}}\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\sqrt[3]{g}\right), \left(\sqrt[3]{a}\right)\right)\right) \]
    3. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \left(\sqrt[3]{a}\right)\right)\right) \]
    4. cbrt-lowering-cbrt.f6496.0%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(a\right)\right)\right) \]
  9. Applied egg-rr96.0%

    \[\leadsto -\color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{a}}} \]
  10. Final simplification96.0%

    \[\leadsto \frac{\sqrt[3]{g}}{0 - \sqrt[3]{a}} \]
  11. Add Preprocessing

Alternative 4: 76.6% accurate, 3.6× speedup?

\[\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} \]
(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}
Derivation
  1. Split input into 3 regimes
  2. if a < 7.20000000000000042e-159

    1. Initial program 39.5%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6468.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified68.4%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      5. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      6. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
      7. pow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      9. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      10. unpow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      12. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      14. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      15. cbrt-divN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
      19. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
      20. cbrt-lowering-cbrt.f6496.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
    7. Applied egg-rr96.4%

      \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}\right) \]
      2. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{-1}{\frac{\color{blue}{\sqrt[3]{a}}}{\sqrt[3]{g}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right) \]
      5. cbrt-undivN/A

        \[\leadsto \mathsf{/.f64}\left(-1, \left(\sqrt[3]{\frac{a}{g}}\right)\right) \]
      6. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\left(\frac{a}{g}\right)\right)\right) \]
      7. /-lowering-/.f6470.1%

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(a, g\right)\right)\right) \]
    9. Applied egg-rr70.1%

      \[\leadsto \color{blue}{\frac{-1}{\sqrt[3]{\frac{a}{g}}}} \]

    if 7.20000000000000042e-159 < a < 3.5e-12

    1. Initial program 36.0%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6449.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified49.0%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      5. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      6. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
      7. pow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      9. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      10. unpow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      12. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      14. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      15. cbrt-divN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
      19. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
      20. cbrt-lowering-cbrt.f6493.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
    7. Applied egg-rr93.6%

      \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
    8. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{\mathsf{neg}\left(\sqrt[3]{a}\right)}{\color{blue}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)}\right)\right)\right) \]
      4. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(0 - \sqrt[3]{a}\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \left(\sqrt[3]{a}\right)\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      6. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\sqrt[3]{g}\right)\right)}\right)\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \left(0 - \color{blue}{\sqrt[3]{g}}\right)\right)\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6493.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(g\right)\right)\right)\right)\right)\right) \]
    9. Applied egg-rr93.6%

      \[\leadsto 0 - \frac{1}{\color{blue}{\left(0 - \sqrt[3]{a}\right) \cdot \frac{1}{0 - \sqrt[3]{g}}}} \]
    10. Step-by-step derivation
      1. flip3--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{\color{blue}{1}}{0 - \sqrt[3]{g}}\right)\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)}}\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(0 - \sqrt[3]{g}\right)}\right)}\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1}{\color{blue}{\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)}}\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{1}{\color{blue}{\frac{\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)}{\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1}}}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)}{\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1}\right)}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right), \color{blue}{\left(\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1\right)}\right)\right)\right)\right) \]
    11. Applied egg-rr81.3%

      \[\leadsto 0 - \frac{1}{\color{blue}{\frac{1}{\frac{\sqrt[3]{\left(a \cdot a\right) \cdot g}}{\left(0 - a\right) \cdot -1}}}} \]

    if 3.5e-12 < a

    1. Initial program 52.8%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6491.1%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified91.1%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      7. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      8. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      9. pow-prod-downN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      11. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      12. unpow-prod-downN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      14. div-invN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      15. clear-numN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      16. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      17. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right)\right) \]
      18. /-lowering-/.f6491.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right)\right) \]
    7. Applied egg-rr91.9%

      \[\leadsto \color{blue}{-\sqrt[3]{\frac{g}{a}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \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} \]
  5. Add Preprocessing

Alternative 5: 76.6% accurate, 3.6× speedup?

\[\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} \]
(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}
Derivation
  1. Split input into 3 regimes
  2. if a < 8.00000000000000052e-158

    1. Initial program 39.5%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6468.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified68.4%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      5. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      6. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
      7. pow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      9. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      10. unpow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      12. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      14. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      15. cbrt-divN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
      19. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
      20. cbrt-lowering-cbrt.f6496.4%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
    7. Applied egg-rr96.4%

      \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}\right) \]
      2. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{-1}{\frac{\color{blue}{\sqrt[3]{a}}}{\sqrt[3]{g}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right) \]
      5. cbrt-undivN/A

        \[\leadsto \mathsf{/.f64}\left(-1, \left(\sqrt[3]{\frac{a}{g}}\right)\right) \]
      6. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\left(\frac{a}{g}\right)\right)\right) \]
      7. /-lowering-/.f6470.1%

        \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(a, g\right)\right)\right) \]
    9. Applied egg-rr70.1%

      \[\leadsto \color{blue}{\frac{-1}{\sqrt[3]{\frac{a}{g}}}} \]

    if 8.00000000000000052e-158 < a < 1.29999999999999991e-10

    1. Initial program 36.0%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6449.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified49.0%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      5. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      6. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
      7. pow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
      9. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      10. unpow-prod-downN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      12. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      14. pow1/3N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      15. cbrt-divN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
      19. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
      20. cbrt-lowering-cbrt.f6493.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
    7. Applied egg-rr93.6%

      \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
    8. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{\mathsf{neg}\left(\sqrt[3]{a}\right)}{\color{blue}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sqrt[3]{a}\right)\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)}\right)\right)\right) \]
      4. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(0 - \sqrt[3]{a}\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \left(\sqrt[3]{a}\right)\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      6. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \left(\frac{1}{\mathsf{neg}\left(\sqrt[3]{g}\right)}\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\sqrt[3]{g}\right)\right)}\right)\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \left(0 - \color{blue}{\sqrt[3]{g}}\right)\right)\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6493.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(a\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(0, \mathsf{cbrt.f64}\left(g\right)\right)\right)\right)\right)\right) \]
    9. Applied egg-rr93.6%

      \[\leadsto 0 - \frac{1}{\color{blue}{\left(0 - \sqrt[3]{a}\right) \cdot \frac{1}{0 - \sqrt[3]{g}}}} \]
    10. Step-by-step derivation
      1. flip3--N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{\color{blue}{1}}{0 - \sqrt[3]{g}}\right)\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)}}\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{{0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}}{0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(0 - \sqrt[3]{g}\right)}\right)}\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \left(\frac{\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1}{\color{blue}{\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left({0}^{3} - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1\right), \color{blue}{\left(\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(0 - {\left(\sqrt[3]{a}\right)}^{3}\right) \cdot -1\right), \left(\left(\color{blue}{0} \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
      7. rem-cube-cbrtN/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(0 - a\right) \cdot -1\right), \left(\left(0 \cdot \color{blue}{0} + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(a\right)\right) \cdot -1\right), \left(\left(\color{blue}{0 \cdot 0} + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{neg}\left(a\right)\right), -1\right), \left(\color{blue}{\left(0 \cdot 0 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right)} \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(0 - a\right), -1\right), \left(\left(\color{blue}{0 \cdot 0} + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, a\right), -1\right), \left(\left(\color{blue}{0 \cdot 0} + \left(\sqrt[3]{a} \cdot \sqrt[3]{a} + 0 \cdot \sqrt[3]{a}\right)\right) \cdot \left(\mathsf{neg}\left(\left(0 - \sqrt[3]{g}\right)\right)\right)\right)\right)\right)\right) \]
    11. Applied egg-rr81.2%

      \[\leadsto 0 - \frac{1}{\color{blue}{\frac{\left(0 - a\right) \cdot -1}{\sqrt[3]{\left(a \cdot a\right) \cdot g}}}} \]

    if 1.29999999999999991e-10 < a

    1. Initial program 52.8%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
      7. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      9. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
      10. cbrt-lowering-cbrt.f6491.1%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
    5. Simplified91.1%

      \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      7. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      8. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      9. pow-prod-downN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
      11. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      12. unpow-prod-downN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      14. div-invN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
      15. clear-numN/A

        \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
      16. pow1/3N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
      17. cbrt-lowering-cbrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right)\right) \]
      18. /-lowering-/.f6491.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right)\right) \]
    7. Applied egg-rr91.9%

      \[\leadsto \color{blue}{-\sqrt[3]{\frac{g}{a}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \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} \]
  5. Add Preprocessing

Alternative 6: 74.7% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \frac{-1}{\sqrt[3]{\frac{a}{g}}} \end{array} \]
(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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    7. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    9. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6470.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified70.9%

    \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}}\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    5. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    6. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}}\right)\right) \]
    7. pow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}}\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}}\right)\right) \]
    9. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    10. unpow-prod-downN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}}\right)\right) \]
    11. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    12. div-invN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    13. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    14. pow1/3N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
    15. cbrt-divN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{a}}}\right)\right) \]
    16. clear-numN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{1}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}}\right)\right) \]
    17. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right)\right) \]
    18. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt[3]{a}\right), \color{blue}{\left(\sqrt[3]{g}\right)}\right)\right)\right) \]
    19. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \left(\sqrt[3]{\color{blue}{g}}\right)\right)\right)\right) \]
    20. cbrt-lowering-cbrt.f6496.0%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(a\right), \mathsf{cbrt.f64}\left(g\right)\right)\right)\right) \]
  7. Applied egg-rr96.0%

    \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(\frac{1}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}\right) \]
    2. distribute-neg-fracN/A

      \[\leadsto \frac{\mathsf{neg}\left(1\right)}{\color{blue}{\frac{\sqrt[3]{a}}{\sqrt[3]{g}}}} \]
    3. metadata-evalN/A

      \[\leadsto \frac{-1}{\frac{\color{blue}{\sqrt[3]{a}}}{\sqrt[3]{g}}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{\left(\frac{\sqrt[3]{a}}{\sqrt[3]{g}}\right)}\right) \]
    5. cbrt-undivN/A

      \[\leadsto \mathsf{/.f64}\left(-1, \left(\sqrt[3]{\frac{a}{g}}\right)\right) \]
    6. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\left(\frac{a}{g}\right)\right)\right) \]
    7. /-lowering-/.f6471.8%

      \[\leadsto \mathsf{/.f64}\left(-1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(a, g\right)\right)\right) \]
  9. Applied egg-rr71.8%

    \[\leadsto \color{blue}{\frac{-1}{\sqrt[3]{\frac{a}{g}}}} \]
  10. Add Preprocessing

Alternative 7: 74.0% accurate, 4.1× speedup?

\[\begin{array}{l} \\ 0 - \sqrt[3]{\frac{g}{a}} \end{array} \]
(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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right)\right)}\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    7. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\frac{1}{2}}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    9. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \left(\sqrt[3]{2}\right)\right)\right) \]
    10. cbrt-lowering-cbrt.f6470.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{cbrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified70.9%

    \[\leadsto \color{blue}{0 - \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{2}} \]
  6. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right) \]
    2. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{2}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{2} \cdot \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right)\right) \]
    5. associate-*r*N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    7. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    8. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    9. pow-prod-downN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{g}{a}}\right)\right) \]
    11. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left({1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    12. unpow-prod-downN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    13. clear-numN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    14. div-invN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}}\right)\right) \]
    15. clear-numN/A

      \[\leadsto \mathsf{neg.f64}\left(\left({\left(\frac{g}{a}\right)}^{\frac{1}{3}}\right)\right) \]
    16. pow1/3N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right)\right) \]
    17. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right)\right) \]
    18. /-lowering-/.f6471.6%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right)\right) \]
  7. Applied egg-rr71.6%

    \[\leadsto \color{blue}{-\sqrt[3]{\frac{g}{a}}} \]
  8. Final simplification71.6%

    \[\leadsto 0 - \sqrt[3]{\frac{g}{a}} \]
  9. Add Preprocessing

Alternative 8: 1.4% accurate, 4.2× speedup?

\[\begin{array}{l} \\ \sqrt[3]{\frac{g}{a}} \end{array} \]
(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}
Derivation
  1. Initial program 41.7%

    \[\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)} \]
  2. Add Preprocessing
  3. Taylor expanded in g around inf

    \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{2}\right)} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{g}{a}}\right), \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{2}\right)}\right) \]
    2. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right), \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \left(\sqrt[3]{\color{blue}{\frac{-1}{2}}} \cdot \sqrt[3]{2}\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{*.f64}\left(\left(\sqrt[3]{\frac{-1}{2}}\right), \color{blue}{\left(\sqrt[3]{2}\right)}\right)\right) \]
    5. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\frac{-1}{2}\right), \left(\sqrt[3]{\color{blue}{2}}\right)\right)\right) \]
    6. cbrt-lowering-cbrt.f6471.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right), \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(\frac{-1}{2}\right), \mathsf{cbrt.f64}\left(2\right)\right)\right) \]
  5. Simplified71.0%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{2}\right) \cdot \color{blue}{\sqrt[3]{\frac{g}{a}}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{-1}{2}}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}} \]
    3. pow1/3N/A

      \[\leadsto \left(\sqrt[3]{2} \cdot {\frac{-1}{2}}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    4. sqr-powN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot \left({\frac{-1}{2}}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\frac{-1}{2}}^{\left(\frac{\frac{1}{3}}{2}\right)}\right)\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    5. pow-prod-downN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot {\left(\frac{-1}{2} \cdot \frac{-1}{2}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    6. metadata-evalN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot {\frac{1}{4}}^{\left(\frac{\frac{1}{3}}{2}\right)}\right) \cdot \sqrt[3]{\frac{g}{a}} \]
    7. metadata-evalN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot {\left(\frac{1}{2} \cdot \frac{1}{2}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}\right) \cdot \sqrt[3]{\frac{g}{a}} \]
    8. pow-prod-downN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot \left({\frac{1}{2}}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\frac{1}{2}}^{\left(\frac{\frac{1}{3}}{2}\right)}\right)\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    9. sqr-powN/A

      \[\leadsto \left(\sqrt[3]{2} \cdot {\frac{1}{2}}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    10. pow1/3N/A

      \[\leadsto \left(\sqrt[3]{2} \cdot \sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    11. *-commutativeN/A

      \[\leadsto \left(\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}} \]
    12. pow1/3N/A

      \[\leadsto \left({\frac{1}{2}}^{\frac{1}{3}} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}} \]
    13. pow1/3N/A

      \[\leadsto \left({\frac{1}{2}}^{\frac{1}{3}} \cdot {2}^{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{g}{\color{blue}{a}}} \]
    14. pow-prod-downN/A

      \[\leadsto {\left(\frac{1}{2} \cdot 2\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\frac{g}{a}}} \]
    15. metadata-evalN/A

      \[\leadsto {1}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{\color{blue}{g}}{a}} \]
    16. pow1/3N/A

      \[\leadsto {1}^{\frac{1}{3}} \cdot {\left(\frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}} \]
    17. unpow-prod-downN/A

      \[\leadsto {\left(1 \cdot \frac{g}{a}\right)}^{\color{blue}{\frac{1}{3}}} \]
    18. clear-numN/A

      \[\leadsto {\left(1 \cdot \frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}} \]
    19. div-invN/A

      \[\leadsto {\left(\frac{1}{\frac{a}{g}}\right)}^{\frac{1}{3}} \]
    20. clear-numN/A

      \[\leadsto {\left(\frac{g}{a}\right)}^{\frac{1}{3}} \]
    21. pow1/3N/A

      \[\leadsto \sqrt[3]{\frac{g}{a}} \]
    22. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{a}\right)\right) \]
    23. /-lowering-/.f641.3%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, a\right)\right) \]
  7. Applied egg-rr1.3%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}}} \]
  8. Add Preprocessing

Reproduce

?
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))))))))