2cbrt (problem 3.3.4)

Percentage Accurate: 53.3% → 99.2%
Time: 12.2s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \sqrt[3]{x + 1} - \sqrt[3]{x} \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
public static double code(double x) {
	return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
function code(x)
	return Float64(cbrt(Float64(x + 1.0)) - cbrt(x))
end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt[3]{x + 1} - \sqrt[3]{x}
\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 12 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: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt[3]{x + 1} - \sqrt[3]{x} \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
public static double code(double x) {
	return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
function code(x)
	return Float64(cbrt(Float64(x + 1.0)) - cbrt(x))
end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt[3]{x + 1} - \sqrt[3]{x}
\end{array}

Alternative 1: 99.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, {t_0}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))))
   (if (<= (- t_0 (cbrt x)) 0.0)
     (/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt x)) (pow t_0 2.0)))
     (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (cbrt (pow (+ 1.0 x) 2.0)))))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double tmp;
	if ((t_0 - cbrt(x)) <= 0.0) {
		tmp = 1.0 / fma(cbrt(x), (cbrt(x) + cbrt(x)), pow(t_0, 2.0));
	} else {
		tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), cbrt(pow((1.0 + x), 2.0)));
	}
	return tmp;
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	tmp = 0.0
	if (Float64(t_0 - cbrt(x)) <= 0.0)
		tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(x)), (t_0 ^ 2.0)));
	else
		tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), cbrt((Float64(1.0 + x) ^ 2.0))));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, {t_0}^{2}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0

    1. Initial program 4.2%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/32.7%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr2.7%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. pow1/34.2%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
      2. flip3--4.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      3. div-inv4.2%

        \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      4. pow33.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      5. add-cube-cbrt3.3%

        \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      6. rem-cube-cbrt4.2%

        \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      7. pow24.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      8. distribute-rgt-out4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
      9. +-commutative4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Applied egg-rr4.2%

      \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/4.2%

        \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
      2. *-rgt-identity4.2%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      3. +-commutative4.2%

        \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      4. associate--l+98.5%

        \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      5. +-inverses98.5%

        \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      6. metadata-eval98.5%

        \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      7. +-commutative98.5%

        \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
      8. fma-def98.5%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
      9. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
      10. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
    8. Simplified98.5%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
    9. Step-by-step derivation
      1. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{x + 1}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      2. add-cube-cbrt98.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      3. pow398.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    10. Applied egg-rr98.3%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    11. Taylor expanded in x around inf 45.9%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{x}^{0.3333333333333333}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    12. Step-by-step derivation
      1. unpow1/398.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\sqrt[3]{x}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    13. Simplified98.5%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\sqrt[3]{x}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]

    if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 97.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/338.1%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr38.1%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. pow1/397.8%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
      2. flip3--97.7%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      3. div-inv97.7%

        \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      4. pow397.7%

        \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      5. add-cube-cbrt98.0%

        \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      6. rem-cube-cbrt99.8%

        \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      7. pow299.8%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      8. distribute-rgt-out99.8%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
      9. +-commutative99.8%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
      2. *-rgt-identity99.8%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      3. +-commutative99.8%

        \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      4. associate--l+99.8%

        \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      5. +-inverses99.8%

        \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      6. metadata-eval99.8%

        \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      7. +-commutative99.8%

        \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
      8. fma-def99.8%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
      9. +-commutative99.8%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
      10. +-commutative99.8%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
    8. Simplified99.8%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
    9. Step-by-step derivation
      1. unpow299.8%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\right)} \]
      2. cbrt-unprod99.8%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{\sqrt[3]{\left(1 + x\right) \cdot \left(1 + x\right)}}\right)} \]
      3. pow299.8%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \sqrt[3]{\color{blue}{{\left(1 + x\right)}^{2}}}\right)} \]
    10. Applied egg-rr99.8%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{\sqrt[3]{{\left(1 + x\right)}^{2}}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := {t_0}^{2}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (pow t_0 2.0)))
   (if (<= (- t_0 (cbrt x)) 0.0)
     (/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt x)) t_1))
     (/ (- (+ 1.0 x) x) (+ t_1 (* (cbrt x) (+ (cbrt x) t_0)))))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double t_1 = pow(t_0, 2.0);
	double tmp;
	if ((t_0 - cbrt(x)) <= 0.0) {
		tmp = 1.0 / fma(cbrt(x), (cbrt(x) + cbrt(x)), t_1);
	} else {
		tmp = ((1.0 + x) - x) / (t_1 + (cbrt(x) * (cbrt(x) + t_0)));
	}
	return tmp;
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	t_1 = t_0 ^ 2.0
	tmp = 0.0
	if (Float64(t_0 - cbrt(x)) <= 0.0)
		tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(x)), t_1));
	else
		tmp = Float64(Float64(Float64(1.0 + x) - x) / Float64(t_1 + Float64(cbrt(x) * Float64(cbrt(x) + t_0))));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(t$95$1 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, t_1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0

    1. Initial program 4.2%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/32.7%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr2.7%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. pow1/34.2%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
      2. flip3--4.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      3. div-inv4.2%

        \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      4. pow33.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      5. add-cube-cbrt3.3%

        \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      6. rem-cube-cbrt4.2%

        \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      7. pow24.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      8. distribute-rgt-out4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
      9. +-commutative4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Applied egg-rr4.2%

      \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/4.2%

        \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
      2. *-rgt-identity4.2%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      3. +-commutative4.2%

        \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      4. associate--l+98.5%

        \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      5. +-inverses98.5%

        \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      6. metadata-eval98.5%

        \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      7. +-commutative98.5%

        \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
      8. fma-def98.5%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
      9. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
      10. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
    8. Simplified98.5%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
    9. Step-by-step derivation
      1. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{x + 1}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      2. add-cube-cbrt98.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      3. pow398.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    10. Applied egg-rr98.3%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    11. Taylor expanded in x around inf 45.9%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{x}^{0.3333333333333333}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    12. Step-by-step derivation
      1. unpow1/398.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\sqrt[3]{x}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    13. Simplified98.5%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\sqrt[3]{x}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]

    if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 97.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/338.1%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr38.1%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. +-commutative38.1%

        \[\leadsto \sqrt[3]{\color{blue}{1 + x}} - {x}^{0.3333333333333333} \]
      2. add-sqr-sqrt38.1%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 + x}}} - {x}^{0.3333333333333333} \]
      3. cbrt-unprod38.0%

        \[\leadsto \color{blue}{\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}} - {x}^{0.3333333333333333} \]
      4. pow1/397.2%

        \[\leadsto \sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}} - \color{blue}{\sqrt[3]{x}} \]
      5. flip3--97.1%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)}} \]
      6. cbrt-unprod97.1%

        \[\leadsto \frac{{\color{blue}{\left(\sqrt[3]{\sqrt{1 + x} \cdot \sqrt{1 + x}}\right)}}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      7. add-sqr-sqrt97.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      8. +-commutative97.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\color{blue}{x + 1}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      9. pow397.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      10. add-cube-cbrt97.4%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      11. rem-cube-cbrt98.3%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := {t_0}^{2}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (pow t_0 2.0)))
   (if (<= (- t_0 (cbrt x)) 0.0)
     (/ 1.0 (fma (cbrt x) (+ 1.0 (cbrt x)) t_1))
     (/ (- (+ 1.0 x) x) (+ t_1 (* (cbrt x) (+ (cbrt x) t_0)))))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double t_1 = pow(t_0, 2.0);
	double tmp;
	if ((t_0 - cbrt(x)) <= 0.0) {
		tmp = 1.0 / fma(cbrt(x), (1.0 + cbrt(x)), t_1);
	} else {
		tmp = ((1.0 + x) - x) / (t_1 + (cbrt(x) * (cbrt(x) + t_0)));
	}
	return tmp;
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	t_1 = t_0 ^ 2.0
	tmp = 0.0
	if (Float64(t_0 - cbrt(x)) <= 0.0)
		tmp = Float64(1.0 / fma(cbrt(x), Float64(1.0 + cbrt(x)), t_1));
	else
		tmp = Float64(Float64(Float64(1.0 + x) - x) / Float64(t_1 + Float64(cbrt(x) * Float64(cbrt(x) + t_0))));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(1.0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(t$95$1 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, t_1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0

    1. Initial program 4.2%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/32.7%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr2.7%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. pow1/34.2%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
      2. flip3--4.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      3. div-inv4.2%

        \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      4. pow33.9%

        \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      5. add-cube-cbrt3.3%

        \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      6. rem-cube-cbrt4.2%

        \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      7. pow24.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      8. distribute-rgt-out4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
      9. +-commutative4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Applied egg-rr4.2%

      \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/4.2%

        \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
      2. *-rgt-identity4.2%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      3. +-commutative4.2%

        \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      4. associate--l+98.5%

        \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      5. +-inverses98.5%

        \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      6. metadata-eval98.5%

        \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
      7. +-commutative98.5%

        \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
      8. fma-def98.5%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
      9. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
      10. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
    8. Simplified98.5%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
    9. Step-by-step derivation
      1. +-commutative98.5%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{x + 1}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      2. add-cube-cbrt98.2%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
      3. pow398.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    10. Applied egg-rr98.3%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    11. Taylor expanded in x around 0 20.0%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{1} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]

    if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 97.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/338.1%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    4. Applied egg-rr38.1%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. +-commutative38.1%

        \[\leadsto \sqrt[3]{\color{blue}{1 + x}} - {x}^{0.3333333333333333} \]
      2. add-sqr-sqrt38.1%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 + x}}} - {x}^{0.3333333333333333} \]
      3. cbrt-unprod38.0%

        \[\leadsto \color{blue}{\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}} - {x}^{0.3333333333333333} \]
      4. pow1/397.2%

        \[\leadsto \sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}} - \color{blue}{\sqrt[3]{x}} \]
      5. flip3--97.1%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)}} \]
      6. cbrt-unprod97.1%

        \[\leadsto \frac{{\color{blue}{\left(\sqrt[3]{\sqrt{1 + x} \cdot \sqrt{1 + x}}\right)}}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      7. add-sqr-sqrt97.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      8. +-commutative97.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\color{blue}{x + 1}}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      9. pow397.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      10. add-cube-cbrt97.4%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
      11. rem-cube-cbrt98.3%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \left(\sqrt[3]{\sqrt{1 + x}} \cdot \sqrt[3]{\sqrt{1 + x}}\right) \cdot \sqrt[3]{x}\right)} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 60.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log t_1}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x))))
   (if (<= t_1 0.0)
     (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) 1.0))
     (exp (log t_1)))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double t_1 = t_0 - cbrt(x);
	double tmp;
	if (t_1 <= 0.0) {
		tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), 1.0);
	} else {
		tmp = exp(log(t_1));
	}
	return tmp;
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	t_1 = Float64(t_0 - cbrt(x))
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), 1.0));
	else
		tmp = exp(log(t_1));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[t$95$1], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, 1\right)}\\

\mathbf{else}:\\
\;\;\;\;e^{\log t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0

    1. Initial program 4.2%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. flip3--4.2%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      2. div-inv4.2%

        \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
      3. rem-cube-cbrt3.3%

        \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      4. rem-cube-cbrt4.2%

        \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
      5. +-commutative4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right) + \sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \]
      6. distribute-rgt-out4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \]
      7. +-commutative4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \]
      8. fma-def4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, \sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}} \]
      9. add-exp-log4.2%

        \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, \color{blue}{e^{\log \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}}\right)} \]
    4. Applied egg-rr2.0%

      \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/2.0%

        \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}} \]
      2. *-rgt-identity2.0%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      3. +-commutative2.0%

        \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      4. associate--l+45.3%

        \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      5. +-inverses45.3%

        \[\leadsto \frac{1 + \color{blue}{0}}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      6. metadata-eval45.3%

        \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      7. +-commutative45.3%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
      8. exp-prod44.9%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{{\left(e^{0.6666666666666666}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}}\right)} \]
    6. Simplified44.9%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(e^{0.6666666666666666}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}\right)}} \]
    7. Taylor expanded in x around 0 20.0%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{1}\right)} \]

    if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 97.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log97.8%

        \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}} \]
    4. Applied egg-rr97.8%

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))))
   (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (pow t_0 2.0)))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	return 1.0 / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), (t_0 ^ 2.0)))
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. pow1/321.6%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  4. Applied egg-rr21.6%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  5. Step-by-step derivation
    1. pow1/354.3%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
    2. flip3--54.2%

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
    3. div-inv54.2%

      \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
    4. pow354.1%

      \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    5. add-cube-cbrt54.0%

      \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    6. rem-cube-cbrt55.3%

      \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    7. pow255.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    8. distribute-rgt-out55.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
    9. +-commutative55.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  6. Applied egg-rr55.3%

    \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  7. Step-by-step derivation
    1. associate-*r/55.3%

      \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    2. *-rgt-identity55.3%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    3. +-commutative55.3%

      \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    4. associate--l+99.2%

      \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    5. +-inverses99.2%

      \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    6. metadata-eval99.2%

      \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    7. +-commutative99.2%

      \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
    8. fma-def99.2%

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
    9. +-commutative99.2%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
    10. +-commutative99.2%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
  8. Simplified99.2%

    \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
  9. Final simplification99.2%

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  10. Add Preprocessing

Alternative 6: 59.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (/ 1.0 (fma (cbrt x) (+ 1.0 (cbrt x)) (pow (cbrt (+ 1.0 x)) 2.0))))
double code(double x) {
	return 1.0 / fma(cbrt(x), (1.0 + cbrt(x)), pow(cbrt((1.0 + x)), 2.0));
}
function code(x)
	return Float64(1.0 / fma(cbrt(x), Float64(1.0 + cbrt(x)), (cbrt(Float64(1.0 + x)) ^ 2.0)))
end
code[x_] := N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(1.0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. pow1/321.6%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  4. Applied egg-rr21.6%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  5. Step-by-step derivation
    1. pow1/354.3%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
    2. flip3--54.2%

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
    3. div-inv54.2%

      \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
    4. pow354.1%

      \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    5. add-cube-cbrt54.0%

      \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    6. rem-cube-cbrt55.3%

      \[\leadsto \left(\left(x + 1\right) - \color{blue}{x}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    7. pow255.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{2}} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)} \]
    8. distribute-rgt-out55.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}} \]
    9. +-commutative55.3%

      \[\leadsto \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  6. Applied egg-rr55.3%

    \[\leadsto \color{blue}{\left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
  7. Step-by-step derivation
    1. associate-*r/55.3%

      \[\leadsto \color{blue}{\frac{\left(\left(x + 1\right) - x\right) \cdot 1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    2. *-rgt-identity55.3%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right) - x}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    3. +-commutative55.3%

      \[\leadsto \frac{\color{blue}{\left(1 + x\right)} - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    4. associate--l+99.2%

      \[\leadsto \frac{\color{blue}{1 + \left(x - x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    5. +-inverses99.2%

      \[\leadsto \frac{1 + \color{blue}{0}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    6. metadata-eval99.2%

      \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    7. +-commutative99.2%

      \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{x + 1}\right)}^{2}}} \]
    8. fma-def99.2%

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
    9. +-commutative99.2%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]
    10. +-commutative99.2%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2}\right)} \]
  8. Simplified99.2%

    \[\leadsto \color{blue}{\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}} \]
  9. Step-by-step derivation
    1. +-commutative99.2%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{x + 1}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    2. add-cube-cbrt99.1%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    3. pow399.1%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  10. Applied egg-rr99.1%

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  11. Taylor expanded in x around 0 60.3%

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{1} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  12. Final simplification60.3%

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  13. Add Preprocessing

Alternative 7: 53.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)} \end{array} \]
(FPCore (x) :precision binary64 (exp (log (- (cbrt (+ 1.0 x)) (cbrt x)))))
double code(double x) {
	return exp(log((cbrt((1.0 + x)) - cbrt(x))));
}
public static double code(double x) {
	return Math.exp(Math.log((Math.cbrt((1.0 + x)) - Math.cbrt(x))));
}
function code(x)
	return exp(log(Float64(cbrt(Float64(1.0 + x)) - cbrt(x))))
end
code[x_] := N[Exp[N[Log[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-exp-log54.3%

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}} \]
  4. Applied egg-rr54.3%

    \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}} \]
  5. Final simplification54.3%

    \[\leadsto e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)} \]
  6. Add Preprocessing

Alternative 8: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt[3]{1 + x} - \sqrt[3]{x} \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ 1.0 x)) (cbrt x)))
double code(double x) {
	return cbrt((1.0 + x)) - cbrt(x);
}
public static double code(double x) {
	return Math.cbrt((1.0 + x)) - Math.cbrt(x);
}
function code(x)
	return Float64(cbrt(Float64(1.0 + x)) - cbrt(x))
end
code[x_] := N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt[3]{1 + x} - \sqrt[3]{x}
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Final simplification54.3%

    \[\leadsto \sqrt[3]{1 + x} - \sqrt[3]{x} \]
  4. Add Preprocessing

Alternative 9: 50.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ 1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right) \end{array} \]
(FPCore (x) :precision binary64 (+ 1.0 (- (* x 0.3333333333333333) (cbrt x))))
double code(double x) {
	return 1.0 + ((x * 0.3333333333333333) - cbrt(x));
}
public static double code(double x) {
	return 1.0 + ((x * 0.3333333333333333) - Math.cbrt(x));
}
function code(x)
	return Float64(1.0 + Float64(Float64(x * 0.3333333333333333) - cbrt(x)))
end
code[x_] := N[(1.0 + N[(N[(x * 0.3333333333333333), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt54.0%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right) \cdot \sqrt[3]{\sqrt[3]{x}}} \]
    2. pow354.0%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x}}\right)}^{3}} \]
  4. Applied egg-rr54.0%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x}}\right)}^{3}} \]
  5. Taylor expanded in x around 0 20.9%

    \[\leadsto \color{blue}{\left(1 + 0.3333333333333333 \cdot x\right) - {\left({1}^{4}\right)}^{0.1111111111111111} \cdot {x}^{0.3333333333333333}} \]
  6. Step-by-step derivation
    1. associate--l+20.9%

      \[\leadsto \color{blue}{1 + \left(0.3333333333333333 \cdot x - {\left({1}^{4}\right)}^{0.1111111111111111} \cdot {x}^{0.3333333333333333}\right)} \]
    2. *-commutative20.9%

      \[\leadsto 1 + \left(\color{blue}{x \cdot 0.3333333333333333} - {\left({1}^{4}\right)}^{0.1111111111111111} \cdot {x}^{0.3333333333333333}\right) \]
    3. metadata-eval20.9%

      \[\leadsto 1 + \left(x \cdot 0.3333333333333333 - {\color{blue}{1}}^{0.1111111111111111} \cdot {x}^{0.3333333333333333}\right) \]
    4. pow-base-120.9%

      \[\leadsto 1 + \left(x \cdot 0.3333333333333333 - \color{blue}{1} \cdot {x}^{0.3333333333333333}\right) \]
    5. unpow1/352.4%

      \[\leadsto 1 + \left(x \cdot 0.3333333333333333 - 1 \cdot \color{blue}{\sqrt[3]{x}}\right) \]
    6. *-lft-identity52.4%

      \[\leadsto 1 + \left(x \cdot 0.3333333333333333 - \color{blue}{\sqrt[3]{x}}\right) \]
  7. Simplified52.4%

    \[\leadsto \color{blue}{1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)} \]
  8. Final simplification52.4%

    \[\leadsto 1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right) \]
  9. Add Preprocessing

Alternative 10: 50.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ 1 - \sqrt[3]{x} \end{array} \]
(FPCore (x) :precision binary64 (- 1.0 (cbrt x)))
double code(double x) {
	return 1.0 - cbrt(x);
}
public static double code(double x) {
	return 1.0 - Math.cbrt(x);
}
function code(x)
	return Float64(1.0 - cbrt(x))
end
code[x_] := N[(1.0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
1 - \sqrt[3]{x}
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-cube-cbrt54.0%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right) \cdot \sqrt[3]{\sqrt[3]{x}}} \]
    2. pow354.0%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x}}\right)}^{3}} \]
  4. Applied egg-rr54.0%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{\left(\sqrt[3]{\sqrt[3]{x}}\right)}^{3}} \]
  5. Taylor expanded in x around 0 19.8%

    \[\leadsto \color{blue}{1 - {\left({1}^{4}\right)}^{0.1111111111111111} \cdot {x}^{0.3333333333333333}} \]
  6. Step-by-step derivation
    1. metadata-eval19.8%

      \[\leadsto 1 - {\color{blue}{1}}^{0.1111111111111111} \cdot {x}^{0.3333333333333333} \]
    2. pow-base-119.8%

      \[\leadsto 1 - \color{blue}{1} \cdot {x}^{0.3333333333333333} \]
    3. unpow1/351.9%

      \[\leadsto 1 - 1 \cdot \color{blue}{\sqrt[3]{x}} \]
    4. *-lft-identity51.9%

      \[\leadsto 1 - \color{blue}{\sqrt[3]{x}} \]
  7. Simplified51.9%

    \[\leadsto \color{blue}{1 - \sqrt[3]{x}} \]
  8. Final simplification51.9%

    \[\leadsto 1 - \sqrt[3]{x} \]
  9. Add Preprocessing

Alternative 11: 3.6% accurate, 205.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x) :precision binary64 0.0)
double code(double x) {
	return 0.0;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.0d0
end function
public static double code(double x) {
	return 0.0;
}
def code(x):
	return 0.0
function code(x)
	return 0.0
end
function tmp = code(x)
	tmp = 0.0;
end
code[x_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 3.6%

    \[\leadsto \color{blue}{0} \]
  4. Final simplification3.6%

    \[\leadsto 0 \]
  5. Add Preprocessing

Alternative 12: 49.9% accurate, 205.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x) :precision binary64 1.0)
double code(double x) {
	return 1.0;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 1.0d0
end function
public static double code(double x) {
	return 1.0;
}
def code(x):
	return 1.0
function code(x)
	return 1.0
end
function tmp = code(x)
	tmp = 1.0;
end
code[x_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 54.3%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 50.7%

    \[\leadsto \color{blue}{1} \]
  4. Final simplification50.7%

    \[\leadsto 1 \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024010 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1.0)) (cbrt x)))