2cbrt (problem 3.3.4)

Percentage Accurate: 6.9% → 99.4%
Time: 14.9s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[x > 1 \land x < 10^{+308}\]
\[\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: 6.9% 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.4% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \frac{1 + x}{t\_0 + 0 \cdot \sqrt[3]{1 + x}} + \frac{x}{{\left(\sqrt[3]{x}\right)}^{2} + \sqrt[3]{x} \cdot 0}, t\_0\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 6.8%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. flip3--6.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)}} \]
    2. rem-cube-cbrt5.9%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt8.3%

      \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
    5. distribute-rgt-out8.3%

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

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

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
    8. add-exp-log8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
    9. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
    10. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
    11. pow-prod-up8.3%

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

    \[\leadsto \color{blue}{\frac{\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)}} \]
  5. Taylor expanded in x around 0 93.0%

    \[\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)} \]
  6. Step-by-step derivation
    1. add093.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \color{blue}{\frac{x + 1}{e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)} + \left(0 - \sqrt[3]{x + 1} \cdot 0\right)}} + \sqrt[3]{x}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
  8. Step-by-step derivation
    1. add098.9%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \frac{1 + x}{e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)} + 0 \cdot \sqrt[3]{1 + x}} + \frac{x}{{\left(\sqrt[3]{x}\right)}^{2} + \sqrt[3]{x} \cdot 0}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
  11. Add Preprocessing

Alternative 2: 99.0% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \frac{1 + x}{t\_0 + 0 \cdot \sqrt[3]{1 + x}}, t\_0\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 6.8%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. flip3--6.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)}} \]
    2. rem-cube-cbrt5.9%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt8.3%

      \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
    5. distribute-rgt-out8.3%

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

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

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
    8. add-exp-log8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
    9. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
    10. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
    11. pow-prod-up8.3%

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

    \[\leadsto \color{blue}{\frac{\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)}} \]
  5. Taylor expanded in x around 0 93.0%

    \[\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)} \]
  6. Step-by-step derivation
    1. add093.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \frac{1 + x}{e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)} + 0 \cdot \sqrt[3]{1 + x}}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
  9. Add Preprocessing

Alternative 3: 95.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\sqrt[3]{{\left(1 + x\right)}^{2}} + \sqrt[3]{x} \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t\_0, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.00000000000000018e153

    1. Initial program 8.9%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u9.0%

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

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)} \]
    5. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{\sqrt[3]{{\left(x + 1\right)}^{2}} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Taylor expanded in x around 0 98.8%

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

    if 5.00000000000000018e153 < x

    1. Initial program 4.8%

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

        \[\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. rem-cube-cbrt2.9%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt4.8%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative4.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
      5. distribute-rgt-out4.8%

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

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

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
      8. add-exp-log4.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
      9. pow1/34.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
      10. pow1/34.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
      11. pow-prod-up4.8%

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

      \[\leadsto \color{blue}{\frac{\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)}} \]
    5. Taylor expanded in x around 0 92.2%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

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

Alternative 4: 98.5% 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 6.8%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. flip3--6.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)}} \]
    2. rem-cube-cbrt5.9%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt8.3%

      \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
    5. distribute-rgt-out8.3%

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

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

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
    8. add-exp-log8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
    9. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
    10. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
    11. pow-prod-up8.3%

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

    \[\leadsto \color{blue}{\frac{\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)}} \]
  5. Taylor expanded in x around 0 93.0%

    \[\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)} \]
  6. Step-by-step derivation
    1. *-commutative93.0%

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(x + 1\right)}^{\color{blue}{\left(0.3333333333333333 + 0.3333333333333333\right)}}\right)} \]
    6. pow-prod-up92.9%

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, \color{blue}{{\left(x + 1\right)}^{0.3333333333333333} \cdot {\left(x + 1\right)}^{0.3333333333333333}}\right)} \]
    7. pow1/394.3%

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

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

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

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

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

Alternative 5: 95.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\sqrt[3]{{\left(1 + x\right)}^{2}} + \sqrt[3]{x} \cdot t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.35000000000000003e154

    1. Initial program 8.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u8.9%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)} \]
    4. Applied egg-rr8.9%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)} \]
    5. Applied egg-rr12.0%

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{\sqrt[3]{{\left(x + 1\right)}^{2}} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Taylor expanded in x around 0 98.8%

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

    if 1.35000000000000003e154 < x

    1. Initial program 4.8%

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

        \[\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. rem-cube-cbrt2.9%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt4.8%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative4.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
      5. distribute-rgt-out4.8%

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

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

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
      8. add-exp-log4.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
      9. pow1/34.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
      10. pow1/34.8%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
      11. pow-prod-up4.8%

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

      \[\leadsto \color{blue}{\frac{\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)}} \]
    5. Taylor expanded in x around 0 92.2%

      \[\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)} \]
    6. Step-by-step derivation
      1. *-commutative92.2%

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \color{blue}{\left(x + 1\right)} \cdot 0.6666666666666666}\right)} \]
      4. exp-to-pow91.6%

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, \color{blue}{{\left(x + 1\right)}^{0.6666666666666666}}\right)} \]
    7. Applied egg-rr91.6%

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

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

Alternative 6: 93.0% accurate, 0.4× speedup?

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

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

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. flip3--6.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)}} \]
    2. rem-cube-cbrt5.9%

      \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt8.3%

      \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
    5. distribute-rgt-out8.3%

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

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

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
    8. add-exp-log8.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
    9. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
    10. pow1/38.3%

      \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
    11. pow-prod-up8.3%

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

    \[\leadsto \color{blue}{\frac{\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)}} \]
  5. Taylor expanded in x around 0 93.0%

    \[\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)} \]
  6. Step-by-step derivation
    1. *-commutative93.0%

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

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

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, \color{blue}{{\left(x + 1\right)}^{0.6666666666666666}}\right)} \]
  7. Applied egg-rr92.9%

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

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

Alternative 7: 12.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq 1.35 \cdot 10^{+16}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{\sqrt[3]{x} \cdot t\_0 + {\left(1 + x\right)}^{0.6666666666666666}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t\_0, 1 + x \cdot 0.6666666666666666\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.35e16

    1. Initial program 62.8%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. expm1-log1p-u60.5%

        \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)} \]
    4. Applied egg-rr60.5%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)} \]
    5. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{\sqrt[3]{{\left(x + 1\right)}^{2}} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    6. Step-by-step derivation
      1. pow1/397.9%

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

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

        \[\leadsto \frac{\left(x + 1\right) - x}{{\left(x + 1\right)}^{\color{blue}{0.6666666666666666}} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    7. Applied egg-rr97.9%

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

    if 1.35e16 < x

    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. rem-cube-cbrt3.3%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt4.2%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative4.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
      5. distribute-rgt-out4.2%

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

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

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
      8. add-exp-log4.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
      9. pow1/34.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
      10. pow1/34.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
      11. pow-prod-up4.2%

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

      \[\leadsto \color{blue}{\frac{\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)}} \]
    5. Taylor expanded in x around 0 92.8%

      \[\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)} \]
    6. Taylor expanded in x around 0 7.4%

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

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

Alternative 8: 10.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.4 \cdot 10^{+15}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} - {x}^{0.3333333333333333}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, 1 + x \cdot 0.6666666666666666\right)}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 2.4e+15)
   (- (pow (+ 1.0 x) 0.3333333333333333) (pow x 0.3333333333333333))
   (/
    1.0
    (fma
     (cbrt x)
     (+ (cbrt x) (cbrt (+ 1.0 x)))
     (+ 1.0 (* x 0.6666666666666666))))))
double code(double x) {
	double tmp;
	if (x <= 2.4e+15) {
		tmp = pow((1.0 + x), 0.3333333333333333) - pow(x, 0.3333333333333333);
	} else {
		tmp = 1.0 / fma(cbrt(x), (cbrt(x) + cbrt((1.0 + x))), (1.0 + (x * 0.6666666666666666)));
	}
	return tmp;
}
function code(x)
	tmp = 0.0
	if (x <= 2.4e+15)
		tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) - (x ^ 0.3333333333333333));
	else
		tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(Float64(1.0 + x))), Float64(1.0 + Float64(x * 0.6666666666666666))));
	end
	return tmp
end
code[x_] := If[LessEqual[x, 2.4e+15], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{+15}:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} - {x}^{0.3333333333333333}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.4e15

    1. Initial program 62.8%

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

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

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

        \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - {x}^{0.3333333333333333} \]
    6. Applied egg-rr64.1%

      \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - {x}^{0.3333333333333333} \]

    if 2.4e15 < x

    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. rem-cube-cbrt3.3%

        \[\leadsto \frac{\color{blue}{\left(x + 1\right)} - {\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. rem-cube-cbrt4.2%

        \[\leadsto \frac{\left(x + 1\right) - \color{blue}{x}}{\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. +-commutative4.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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}}} \]
      5. distribute-rgt-out4.2%

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

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

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)}} \]
      8. add-exp-log4.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\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)} \]
      9. pow1/34.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left(\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} \cdot \sqrt[3]{x + 1}\right)}\right)} \]
      10. pow1/34.2%

        \[\leadsto \frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, e^{\log \left({\left(x + 1\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}\right)}\right)} \]
      11. pow-prod-up4.2%

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

      \[\leadsto \color{blue}{\frac{\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)}} \]
    5. Taylor expanded in x around 0 92.8%

      \[\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)} \]
    6. Taylor expanded in x around 0 7.4%

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

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

Alternative 9: 7.9% accurate, 1.0× speedup?

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

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

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

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

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  5. Final simplification7.6%

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

Alternative 10: 6.9% 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 6.8%

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

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

Alternative 11: 4.2% 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 6.8%

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

    \[\leadsto \color{blue}{0} \]
  4. Final simplification4.2%

    \[\leadsto 0 \]
  5. Add Preprocessing

Alternative 12: 6.2% 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 6.8%

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

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

    \[\leadsto 1 \]
  5. Add Preprocessing

Developer target: 98.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{1}{\left(t\_0 \cdot t\_0 + \sqrt[3]{x} \cdot t\_0\right) + \sqrt[3]{x} \cdot \sqrt[3]{x}}
\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024046 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  :pre (and (> x 1.0) (< x 1e+308))

  :alt
  (/ 1.0 (+ (+ (* (cbrt (+ x 1.0)) (cbrt (+ x 1.0))) (* (cbrt x) (cbrt (+ x 1.0)))) (* (cbrt x) (cbrt x))))

  (- (cbrt (+ x 1.0)) (cbrt x)))