2-ancestry mixing, positive discriminant

Percentage Accurate: 43.3% → 95.9%
Time: 10.1s
Alternatives: 5
Speedup: 1.9×

Specification

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

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 5 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: 43.3% accurate, 1.0× speedup?

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

Alternative 1: 95.9% accurate, 1.0× speedup?

\[\frac{\sqrt[3]{\frac{\left(g + 0\right) - g}{a + a} \cdot \left(a \cdot -2\right)} + \sqrt[3]{\left(g + 0\right) + g}}{\sqrt[3]{a \cdot -2}} \]
(FPCore (g h a)
  :precision binary64
  (/
 (+
  (cbrt (* (/ (- (+ g 0.0) g) (+ a a)) (* a -2.0)))
  (cbrt (+ (+ g 0.0) g)))
 (cbrt (* a -2.0))))
double code(double g, double h, double a) {
	return (cbrt(((((g + 0.0) - g) / (a + a)) * (a * -2.0))) + cbrt(((g + 0.0) + g))) / cbrt((a * -2.0));
}
public static double code(double g, double h, double a) {
	return (Math.cbrt(((((g + 0.0) - g) / (a + a)) * (a * -2.0))) + Math.cbrt(((g + 0.0) + g))) / Math.cbrt((a * -2.0));
}
function code(g, h, a)
	return Float64(Float64(cbrt(Float64(Float64(Float64(Float64(g + 0.0) - g) / Float64(a + a)) * Float64(a * -2.0))) + cbrt(Float64(Float64(g + 0.0) + g))) / cbrt(Float64(a * -2.0)))
end
code[g_, h_, a_] := N[(N[(N[Power[N[(N[(N[(N[(g + 0.0), $MachinePrecision] - g), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(g + 0.0), $MachinePrecision] + g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[N[(a * -2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\frac{\sqrt[3]{\frac{\left(g + 0\right) - g}{a + a} \cdot \left(a \cdot -2\right)} + \sqrt[3]{\left(g + 0\right) + g}}{\sqrt[3]{a \cdot -2}}
Derivation
  1. Initial program 43.3%

    \[\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. Applied rewrites46.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right)} \]
  3. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  4. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    6. lower-*.f6432.2%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  5. Applied rewrites32.2%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  6. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. lower-*.f6495.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  8. Applied rewrites95.9%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  9. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt[3]{\frac{\frac{-1}{2}}{a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    2. lift-/.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(\frac{-1}{2}\right)}{\mathsf{neg}\left(a\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\color{blue}{\frac{1}{2}}}{\mathsf{neg}\left(a\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\color{blue}{\frac{1}{2}}}{\mathsf{neg}\left(a\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. associate-/l/N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{1}{2 \cdot \left(\mathsf{neg}\left(a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    7. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\color{blue}{\mathsf{neg}\left(2 \cdot a\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    8. count-2-revN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    10. cbrt-divN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{1}}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    12. cbrt-neg-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\sqrt[3]{a + a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    13. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt[3]{a + a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    14. cbrt-neg-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    15. lower-cbrt.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    16. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    17. count-2-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{neg}\left(\color{blue}{2 \cdot a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    18. distribute-lft-neg-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    19. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    20. metadata-eval95.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{-2} \cdot a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  10. Applied rewrites95.7%

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt[3]{-2 \cdot a}}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  11. Applied rewrites95.7%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{\left(g + 0\right) - g}{a + a} \cdot \left(a \cdot -2\right)} + \sqrt[3]{\left(g + 0\right) + g}}{\sqrt[3]{a \cdot -2}}} \]
  12. Add Preprocessing

Alternative 2: 95.7% accurate, 1.1× speedup?

\[\mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
(FPCore (g h a)
  :precision binary64
  (fma
 (/ 1.0 (cbrt (* -2.0 a)))
 (cbrt (+ (+ g 0.0) g))
 (cbrt (/ (- (+ g 0.0) g) (+ a a)))))
double code(double g, double h, double a) {
	return fma((1.0 / cbrt((-2.0 * a))), cbrt(((g + 0.0) + g)), cbrt((((g + 0.0) - g) / (a + a))));
}
function code(g, h, a)
	return fma(Float64(1.0 / cbrt(Float64(-2.0 * a))), cbrt(Float64(Float64(g + 0.0) + g)), cbrt(Float64(Float64(Float64(g + 0.0) - g) / Float64(a + a))))
end
code[g_, h_, a_] := N[(N[(1.0 / N[Power[N[(-2.0 * a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(g + 0.0), $MachinePrecision] + g), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(N[(g + 0.0), $MachinePrecision] - g), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right)
Derivation
  1. Initial program 43.3%

    \[\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. Applied rewrites46.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right)} \]
  3. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  4. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    6. lower-*.f6432.2%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  5. Applied rewrites32.2%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  6. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. lower-*.f6495.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  8. Applied rewrites95.9%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  9. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt[3]{\frac{\frac{-1}{2}}{a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    2. lift-/.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(\frac{-1}{2}\right)}{\mathsf{neg}\left(a\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\color{blue}{\frac{1}{2}}}{\mathsf{neg}\left(a\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\color{blue}{\frac{1}{2}}}{\mathsf{neg}\left(a\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. associate-/l/N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{1}{2 \cdot \left(\mathsf{neg}\left(a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    7. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\color{blue}{\mathsf{neg}\left(2 \cdot a\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    8. count-2-revN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{1}{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    10. cbrt-divN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{1}}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    12. cbrt-neg-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\sqrt[3]{a + a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    13. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt[3]{a + a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    14. cbrt-neg-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    15. lower-cbrt.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\sqrt[3]{\mathsf{neg}\left(\left(a + a\right)\right)}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    16. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{neg}\left(\color{blue}{\left(a + a\right)}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    17. count-2-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{neg}\left(\color{blue}{2 \cdot a}\right)}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    18. distribute-lft-neg-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    19. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot a}}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    20. metadata-eval95.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\color{blue}{-2} \cdot a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  10. Applied rewrites95.7%

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\sqrt[3]{-2 \cdot a}}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  11. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot \color{blue}{g} + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    3. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    5. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(1 + \frac{\frac{1}{2} \cdot \left(h + -1 \cdot h\right)}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    7. sum-to-mult-revN/A

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \color{blue}{\frac{1}{2}}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    11. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(\left(-1 + 1\right) \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(0 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    13. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0 \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    15. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0 \cdot \color{blue}{h}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(-1 + 1\right) \cdot h\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    17. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    19. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    20. lower-+.f6495.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \color{blue}{\left(h + -1 \cdot h\right)}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    21. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    22. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    23. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \left(-1 + 1\right) \cdot \color{blue}{h}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    24. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0 \cdot h\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    25. mul0-lft95.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  12. Applied rewrites95.7%

    \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + \color{blue}{0}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  13. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot \color{blue}{g} - g}{a + a}}\right) \]
    3. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    5. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{\frac{1}{2} \cdot \left(h + -1 \cdot h\right)}{g}\right) \cdot g - g}{a + a}}\right) \]
    7. sum-to-mult-revN/A

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \color{blue}{\frac{1}{2}}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    11. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(\left(-1 + 1\right) \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(0 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    13. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
    15. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot \color{blue}{h}\right) - g}{a + a}}\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(-1 + 1\right) \cdot h\right) - g}{a + a}}\right) \]
    17. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) - g}{a + a}}\right) \]
    19. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    20. lower-+.f6495.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \color{blue}{\left(h + -1 \cdot h\right)}\right) - g}{a + a}}\right) \]
    21. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    22. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) - g}{a + a}}\right) \]
    23. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(-1 + 1\right) \cdot \color{blue}{h}\right) - g}{a + a}}\right) \]
    24. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot h\right) - g}{a + a}}\right) \]
    25. mul0-lft95.7%

      \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
  14. Applied rewrites95.7%

    \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{-2 \cdot a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \color{blue}{0}\right) - g}{a + a}}\right) \]
  15. Add Preprocessing

Alternative 3: 95.7% accurate, 1.1× speedup?

\[\mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
(FPCore (g h a)
  :precision binary64
  (fma
 (cbrt (/ -0.5 a))
 (cbrt (+ (+ g 0.0) g))
 (cbrt (/ (- (+ g 0.0) g) (+ a a)))))
double code(double g, double h, double a) {
	return fma(cbrt((-0.5 / a)), cbrt(((g + 0.0) + g)), cbrt((((g + 0.0) - g) / (a + a))));
}
function code(g, h, a)
	return fma(cbrt(Float64(-0.5 / a)), cbrt(Float64(Float64(g + 0.0) + g)), cbrt(Float64(Float64(Float64(g + 0.0) - g) / Float64(a + a))))
end
code[g_, h_, a_] := N[(N[Power[N[(-0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(g + 0.0), $MachinePrecision] + g), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(N[(g + 0.0), $MachinePrecision] - g), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right)
Derivation
  1. Initial program 43.3%

    \[\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. Applied rewrites46.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right)} \]
  3. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  4. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
    6. lower-*.f6432.2%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  5. Applied rewrites32.2%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} + g}, \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{a + a}}\right) \]
  6. Taylor expanded in g around inf

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
    2. lower-+.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{\frac{h + -1 \cdot h}{g}}\right) - g}{a + a}}\right) \]
    4. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{\color{blue}{g}}\right) - g}{a + a}}\right) \]
    5. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. lower-*.f6495.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  8. Applied rewrites95.9%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) + g}, \sqrt[3]{\frac{\color{blue}{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right)} - g}{a + a}}\right) \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot \color{blue}{g} + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    3. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    5. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(1 + \frac{\frac{1}{2} \cdot \left(h + -1 \cdot h\right)}{g}\right) \cdot g + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    7. sum-to-mult-revN/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \color{blue}{\frac{1}{2}}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    11. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(\left(-1 + 1\right) \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(0 \cdot h\right) \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    13. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0 \cdot \frac{1}{2}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    15. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0 \cdot \color{blue}{h}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(-1 + 1\right) \cdot h\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    17. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    19. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    20. lower-+.f6495.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + \color{blue}{\left(h + -1 \cdot h\right)}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    21. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    22. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    23. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + \left(-1 + 1\right) \cdot \color{blue}{h}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    24. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0 \cdot h\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
    25. mul0-lft95.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  10. Applied rewrites95.9%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + \color{blue}{0}\right) + g}, \sqrt[3]{\frac{g \cdot \left(1 + 0.5 \cdot \frac{h + -1 \cdot h}{g}\right) - g}{a + a}}\right) \]
  11. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot \color{blue}{g} - g}{a + a}}\right) \]
    3. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    5. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{1}{2} \cdot \frac{h + -1 \cdot h}{g}\right) \cdot g - g}{a + a}}\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(1 + \frac{\frac{1}{2} \cdot \left(h + -1 \cdot h\right)}{g}\right) \cdot g - g}{a + a}}\right) \]
    7. sum-to-mult-revN/A

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \color{blue}{\frac{1}{2}}\right) - g}{a + a}}\right) \]
    9. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    11. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(\left(-1 + 1\right) \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(0 \cdot h\right) \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    13. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot \frac{1}{2}\right) - g}{a + a}}\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
    15. mul0-lftN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot \color{blue}{h}\right) - g}{a + a}}\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(-1 + 1\right) \cdot h\right) - g}{a + a}}\right) \]
    17. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) - g}{a + a}}\right) \]
    19. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    20. lower-+.f6495.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \color{blue}{\left(h + -1 \cdot h\right)}\right) - g}{a + a}}\right) \]
    21. lift-+.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + \color{blue}{-1 \cdot h}\right)\right) - g}{a + a}}\right) \]
    22. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(h + -1 \cdot \color{blue}{h}\right)\right) - g}{a + a}}\right) \]
    23. distribute-rgt1-inN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \left(-1 + 1\right) \cdot \color{blue}{h}\right) - g}{a + a}}\right) \]
    24. metadata-evalN/A

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{-1}{2}}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0 \cdot h\right) - g}{a + a}}\right) \]
    25. mul0-lft95.9%

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + 0\right) - g}{a + a}}\right) \]
  12. Applied rewrites95.9%

    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{-0.5}{a}}, \sqrt[3]{\left(g + 0\right) + g}, \sqrt[3]{\frac{\left(g + \color{blue}{0}\right) - g}{a + a}}\right) \]
  13. Add Preprocessing

Alternative 4: 74.0% accurate, 1.3× speedup?

\[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \left(h \cdot \frac{h}{g}\right)\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
(FPCore (g h a)
  :precision binary64
  (+
 (cbrt (* (/ 1.0 (* 2.0 a)) (* -0.5 (* h (/ h g)))))
 (cbrt (* -1.0 (/ g a)))))
double code(double g, double h, double a) {
	return cbrt(((1.0 / (2.0 * a)) * (-0.5 * (h * (h / g))))) + cbrt((-1.0 * (g / a)));
}
public static double code(double g, double h, double a) {
	return Math.cbrt(((1.0 / (2.0 * a)) * (-0.5 * (h * (h / g))))) + Math.cbrt((-1.0 * (g / a)));
}
function code(g, h, a)
	return Float64(cbrt(Float64(Float64(1.0 / Float64(2.0 * a)) * Float64(-0.5 * Float64(h * Float64(h / g))))) + cbrt(Float64(-1.0 * Float64(g / a))))
end
code[g_, h_, a_] := N[(N[Power[N[(N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h * N[(h / g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(-1.0 * N[(g / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \left(h \cdot \frac{h}{g}\right)\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}}
Derivation
  1. Initial program 43.3%

    \[\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. Taylor expanded in g around inf

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{-1 \cdot \color{blue}{\frac{g}{a}}} \]
    2. lower-/.f6426.8%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{-1 \cdot \frac{g}{\color{blue}{a}}} \]
  4. Applied rewrites26.8%

    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
  5. Taylor expanded in g around inf

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

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{{h}^{2}}{\color{blue}{g}}\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
    3. lower-pow.f6470.2%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{{h}^{2}}{g}\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
  7. Applied rewrites70.2%

    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{{h}^{2}}{g}\right)}} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
  8. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{{h}^{2}}{\color{blue}{g}}\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
    2. lift-pow.f64N/A

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
    3. pow2N/A

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
    4. associate-/l*N/A

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \left(h \cdot \color{blue}{\frac{h}{g}}\right)\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
    6. lower-/.f6474.0%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \left(h \cdot \frac{h}{\color{blue}{g}}\right)\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
  9. Applied rewrites74.0%

    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \left(h \cdot \color{blue}{\frac{h}{g}}\right)\right)} + \sqrt[3]{-1 \cdot \frac{g}{a}} \]
  10. Add Preprocessing

Alternative 5: 72.5% accurate, 1.9× speedup?

\[\sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0}{a}} \]
(FPCore (g h a)
  :precision binary64
  (- (cbrt (/ (- g) a)) (cbrt (/ 0.0 a))))
double code(double g, double h, double a) {
	return cbrt((-g / a)) - cbrt((0.0 / a));
}
public static double code(double g, double h, double a) {
	return Math.cbrt((-g / a)) - Math.cbrt((0.0 / a));
}
function code(g, h, a)
	return Float64(cbrt(Float64(Float64(-g) / a)) - cbrt(Float64(0.0 / a)))
end
code[g_, h_, a_] := N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[N[(0.0 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0}{a}}
Derivation
  1. Initial program 43.3%

    \[\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. Taylor expanded in g around inf

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{-1 \cdot \color{blue}{\frac{g}{a}}} \]
    2. lower-/.f6426.8%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{-1 \cdot \frac{g}{\color{blue}{a}}} \]
  4. Applied rewrites26.8%

    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
  5. Applied rewrites26.9%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{g - \sqrt{\left(h + g\right) \cdot \left(g - h\right)}}{a + a}}} \]
  6. Taylor expanded in g around inf

    \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\color{blue}{\frac{-1}{4} \cdot \frac{h + -1 \cdot h}{a}}} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{-1}{4} \cdot \color{blue}{\frac{h + -1 \cdot h}{a}}} \]
    2. lower-/.f64N/A

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

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{-1}{4} \cdot \frac{h + -1 \cdot h}{a}} \]
    4. lower-*.f6472.5%

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{-0.25 \cdot \frac{h + -1 \cdot h}{a}} \]
  8. Applied rewrites72.5%

    \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\color{blue}{-0.25 \cdot \frac{h + -1 \cdot h}{a}}} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{-1}{4} \cdot \color{blue}{\frac{h + -1 \cdot h}{a}}} \]
    2. *-commutativeN/A

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

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a} \cdot \frac{-1}{4}} \]
    4. associate-*l/N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(h + -1 \cdot h\right) \cdot \frac{-1}{4}}{\color{blue}{a}}} \]
    5. lift-+.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(h + -1 \cdot h\right) \cdot \frac{-1}{4}}{a}} \]
    6. lift-*.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(h + -1 \cdot h\right) \cdot \frac{-1}{4}}{a}} \]
    7. distribute-rgt1-inN/A

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

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(0 \cdot h\right) \cdot \frac{-1}{4}}{a}} \]
    9. mul0-lftN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0 \cdot \frac{-1}{4}}{a}} \]
    10. metadata-evalN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0}{a}} \]
    11. mul0-lftN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0 \cdot h}{a}} \]
    12. metadata-evalN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(-1 + 1\right) \cdot h}{a}} \]
    13. distribute-rgt1-inN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a}} \]
    14. lift-*.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a}} \]
    15. lift-+.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a}} \]
    16. lift-/.f6472.5%

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{\color{blue}{a}}} \]
    17. lift-+.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a}} \]
    18. lift-*.f64N/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{h + -1 \cdot h}{a}} \]
    19. distribute-rgt1-inN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{\left(-1 + 1\right) \cdot h}{a}} \]
    20. metadata-evalN/A

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0 \cdot h}{a}} \]
    21. mul0-lft72.5%

      \[\leadsto \sqrt[3]{\frac{-g}{a}} - \sqrt[3]{\frac{0}{a}} \]
  10. Applied rewrites72.5%

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

Reproduce

?
herbie shell --seed 2025214 
(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))))))))