2cbrt (problem 3.3.4)

Percentage Accurate: 6.9% → 98.6%
Time: 15.2s
Alternatives: 10
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 10 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: 98.6% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{x}}\\
t_1 := \sqrt[3]{1 + x}\\
\frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, t\_0 \cdot t\_0 + t\_1, {t\_1}^{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. add-exp-log5.9%

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1}\right)}} - \sqrt[3]{x} \]
    2. pow1/34.7%

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

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

      \[\leadsto e^{0.3333333333333333 \cdot \log \color{blue}{\left(1 + x\right)}} - \sqrt[3]{x} \]
    5. log1p-udef4.8%

      \[\leadsto e^{0.3333333333333333 \cdot \color{blue}{\mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  4. Applied egg-rr4.8%

    \[\leadsto \color{blue}{e^{0.3333333333333333 \cdot \mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  5. Step-by-step derivation
    1. *-commutative4.8%

      \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot 0.3333333333333333}} - \sqrt[3]{x} \]
    2. exp-prod4.9%

      \[\leadsto \color{blue}{{\left(e^{\mathsf{log1p}\left(x\right)}\right)}^{0.3333333333333333}} - \sqrt[3]{x} \]
    3. unpow1/36.0%

      \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  6. Simplified6.0%

    \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  7. Step-by-step derivation
    1. log1p-udef6.0%

      \[\leadsto \sqrt[3]{e^{\color{blue}{\log \left(1 + x\right)}}} - \sqrt[3]{x} \]
    2. add-exp-log6.8%

      \[\leadsto \sqrt[3]{\color{blue}{1 + x}} - \sqrt[3]{x} \]
    3. +-commutative6.8%

      \[\leadsto \sqrt[3]{\color{blue}{x + 1}} - \sqrt[3]{x} \]
    4. flip3--7.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)}} \]
    5. div-inv7.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)}} \]
    6. add-sqr-sqrt7.2%

      \[\leadsto \left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{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)} \]
    7. cbrt-unprod6.7%

      \[\leadsto \left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\color{blue}{\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    8. pow36.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    9. add-cube-cbrt6.0%

      \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    10. cbrt-unprod6.1%

      \[\leadsto \left(\left(x + 1\right) - {\color{blue}{\left(\sqrt[3]{\sqrt{x} \cdot \sqrt{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)} \]
    11. add-sqr-sqrt6.0%

      \[\leadsto \left(\left(x + 1\right) - {\left(\sqrt[3]{\color{blue}{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)} \]
    12. rem-cube-cbrt9.0%

      \[\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)} \]
  8. Applied egg-rr9.0%

    \[\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} + \sqrt[3]{x + 1}\right)}} \]
  9. Step-by-step derivation
    1. associate-*r/9.0%

      \[\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} + \sqrt[3]{x + 1}\right)}} \]
    2. *-rgt-identity9.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + {\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}^{0.3333333333333333}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    3. unpow-prod-down94.5%

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

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

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

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

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

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

      \[\leadsto \frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \color{blue}{{\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333}}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    4. unpow1/395.9%

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

      \[\leadsto \frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{\color{blue}{\sqrt{x}}} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    6. unpow1/398.6%

      \[\leadsto \frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{\sqrt{x}} \cdot \color{blue}{\sqrt[3]{\sqrt{x} \cdot 1}}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
    7. *-rgt-identity98.6%

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

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

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

Alternative 2: 22.0% 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} + t\_0, \sqrt{1 + x \cdot 1.3333333333333333}\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\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) t_0) (sqrt (+ 1.0 (* x 1.3333333333333333)))))
     (+
      (pow (pow (+ 1.0 x) 2.0) 0.16666666666666666)
      (- 0.0 (pow x 0.3333333333333333))))))
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) + t_0), sqrt((1.0 + (x * 1.3333333333333333))));
	} else {
		tmp = pow(pow((1.0 + x), 2.0), 0.16666666666666666) + (0.0 - pow(x, 0.3333333333333333));
	}
	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) + t_0), sqrt(Float64(1.0 + Float64(x * 1.3333333333333333)))));
	else
		tmp = Float64(((Float64(1.0 + x) ^ 2.0) ^ 0.16666666666666666) + Float64(0.0 - (x ^ 0.3333333333333333)));
	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] + t$95$0), $MachinePrecision] + N[Sqrt[N[(1.0 + N[(x * 1.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $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} + t\_0, \sqrt{1 + x \cdot 1.3333333333333333}\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\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. 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.2%

        \[\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-rr4.2%

      \[\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/4.2%

        \[\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-identity4.2%

        \[\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. +-commutative4.2%

        \[\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+92.9%

        \[\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. +-inverses92.9%

        \[\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-eval92.9%

        \[\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. +-commutative92.9%

        \[\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-prod91.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. Simplified91.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. Step-by-step derivation
      1. add-sqr-sqrt91.9%

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \sqrt{{\left(e^{\color{blue}{1.3333333333333333}}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}}\right)} \]
    8. Applied egg-rr70.7%

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \sqrt{\color{blue}{1 + 1.3333333333333333 \cdot x}}\right)} \]
    10. Step-by-step derivation
      1. *-commutative20.0%

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

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

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

    1. Initial program 56.6%

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

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

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

        \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - {x}^{0.3333333333333333} \]
      2. sqr-pow57.1%

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

        \[\leadsto \color{blue}{{\left(\left(x + 1\right) \cdot \left(x + 1\right)\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} - {x}^{0.3333333333333333} \]
      4. pow258.8%

        \[\leadsto {\color{blue}{\left({\left(x + 1\right)}^{2}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} - {x}^{0.3333333333333333} \]
      5. metadata-eval58.8%

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

      \[\leadsto \color{blue}{{\left({\left(x + 1\right)}^{2}\right)}^{0.16666666666666666}} - {x}^{0.3333333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification21.9%

    \[\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}, \sqrt{1 + x \cdot 1.3333333333333333}\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 22.0% 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} + t\_0, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\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) t_0) 1.0))
     (+
      (pow (pow (+ 1.0 x) 2.0) 0.16666666666666666)
      (- 0.0 (pow x 0.3333333333333333))))))
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) + t_0), 1.0);
	} else {
		tmp = pow(pow((1.0 + x), 2.0), 0.16666666666666666) + (0.0 - pow(x, 0.3333333333333333));
	}
	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) + t_0), 1.0));
	else
		tmp = Float64(((Float64(1.0 + x) ^ 2.0) ^ 0.16666666666666666) + Float64(0.0 - (x ^ 0.3333333333333333)));
	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] + t$95$0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $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} + t\_0, 1\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\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. 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.2%

        \[\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-rr4.2%

      \[\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/4.2%

        \[\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-identity4.2%

        \[\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. +-commutative4.2%

        \[\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+92.9%

        \[\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. +-inverses92.9%

        \[\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-eval92.9%

        \[\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. +-commutative92.9%

        \[\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-prod91.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. Simplified91.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 56.6%

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

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

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

        \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - {x}^{0.3333333333333333} \]
      2. sqr-pow57.1%

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

        \[\leadsto \color{blue}{{\left(\left(x + 1\right) \cdot \left(x + 1\right)\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} - {x}^{0.3333333333333333} \]
      4. pow258.8%

        \[\leadsto {\color{blue}{\left({\left(x + 1\right)}^{2}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} - {x}^{0.3333333333333333} \]
      5. metadata-eval58.8%

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

      \[\leadsto \color{blue}{{\left({\left(x + 1\right)}^{2}\right)}^{0.16666666666666666}} - {x}^{0.3333333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification21.9%

    \[\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}:\\ \;\;\;\;{\left({\left(1 + x\right)}^{2}\right)}^{0.16666666666666666} + \left(0 - {x}^{0.3333333333333333}\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. add-exp-log5.9%

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1}\right)}} - \sqrt[3]{x} \]
    2. pow1/34.7%

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

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

      \[\leadsto e^{0.3333333333333333 \cdot \log \color{blue}{\left(1 + x\right)}} - \sqrt[3]{x} \]
    5. log1p-udef4.8%

      \[\leadsto e^{0.3333333333333333 \cdot \color{blue}{\mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  4. Applied egg-rr4.8%

    \[\leadsto \color{blue}{e^{0.3333333333333333 \cdot \mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  5. Step-by-step derivation
    1. *-commutative4.8%

      \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot 0.3333333333333333}} - \sqrt[3]{x} \]
    2. exp-prod4.9%

      \[\leadsto \color{blue}{{\left(e^{\mathsf{log1p}\left(x\right)}\right)}^{0.3333333333333333}} - \sqrt[3]{x} \]
    3. unpow1/36.0%

      \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  6. Simplified6.0%

    \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  7. Step-by-step derivation
    1. *-un-lft-identity6.0%

      \[\leadsto \sqrt[3]{e^{\color{blue}{1 \cdot \mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
    2. exp-prod4.9%

      \[\leadsto \sqrt[3]{\color{blue}{{\left(e^{1}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}}} - \sqrt[3]{x} \]
  8. Applied egg-rr4.9%

    \[\leadsto \sqrt[3]{\color{blue}{{\left(e^{1}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)}}} - \sqrt[3]{x} \]
  9. Step-by-step derivation
    1. exp-1-e4.9%

      \[\leadsto \sqrt[3]{{\color{blue}{e}}^{\left(\mathsf{log1p}\left(x\right)\right)}} - \sqrt[3]{x} \]
  10. Simplified4.9%

    \[\leadsto \sqrt[3]{\color{blue}{{e}^{\left(\mathsf{log1p}\left(x\right)\right)}}} - \sqrt[3]{x} \]
  11. Applied egg-rr9.0%

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

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

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

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

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

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

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

    \[\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)}} \]
  14. Final simplification98.6%

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

Alternative 5: 98.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1 + \left(x - x\right)}{{t\_0}^{2} + \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))))
   (/ (+ 1.0 (- x x)) (+ (pow t_0 2.0) (* (cbrt x) (+ (cbrt x) t_0))))))
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	return (1.0 + (x - x)) / (pow(t_0, 2.0) + (cbrt(x) * (cbrt(x) + t_0)));
}
public static double code(double x) {
	double t_0 = Math.cbrt((1.0 + x));
	return (1.0 + (x - x)) / (Math.pow(t_0, 2.0) + (Math.cbrt(x) * (Math.cbrt(x) + t_0)));
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	return Float64(Float64(1.0 + Float64(x - x)) / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(cbrt(x) + t_0))))
end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + 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}\\
\frac{1 + \left(x - x\right)}{{t\_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{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. add-exp-log5.9%

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1}\right)}} - \sqrt[3]{x} \]
    2. pow1/34.7%

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

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

      \[\leadsto e^{0.3333333333333333 \cdot \log \color{blue}{\left(1 + x\right)}} - \sqrt[3]{x} \]
    5. log1p-udef4.8%

      \[\leadsto e^{0.3333333333333333 \cdot \color{blue}{\mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  4. Applied egg-rr4.8%

    \[\leadsto \color{blue}{e^{0.3333333333333333 \cdot \mathsf{log1p}\left(x\right)}} - \sqrt[3]{x} \]
  5. Step-by-step derivation
    1. *-commutative4.8%

      \[\leadsto e^{\color{blue}{\mathsf{log1p}\left(x\right) \cdot 0.3333333333333333}} - \sqrt[3]{x} \]
    2. exp-prod4.9%

      \[\leadsto \color{blue}{{\left(e^{\mathsf{log1p}\left(x\right)}\right)}^{0.3333333333333333}} - \sqrt[3]{x} \]
    3. unpow1/36.0%

      \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  6. Simplified6.0%

    \[\leadsto \color{blue}{\sqrt[3]{e^{\mathsf{log1p}\left(x\right)}}} - \sqrt[3]{x} \]
  7. Step-by-step derivation
    1. log1p-udef6.0%

      \[\leadsto \sqrt[3]{e^{\color{blue}{\log \left(1 + x\right)}}} - \sqrt[3]{x} \]
    2. add-exp-log6.8%

      \[\leadsto \sqrt[3]{\color{blue}{1 + x}} - \sqrt[3]{x} \]
    3. +-commutative6.8%

      \[\leadsto \sqrt[3]{\color{blue}{x + 1}} - \sqrt[3]{x} \]
    4. flip3--7.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)}} \]
    5. div-inv7.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)}} \]
    6. add-sqr-sqrt7.2%

      \[\leadsto \left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{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)} \]
    7. cbrt-unprod6.7%

      \[\leadsto \left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\color{blue}{\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    8. pow36.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}} - {\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    9. add-cube-cbrt6.0%

      \[\leadsto \left(\color{blue}{\left(x + 1\right)} - {\left(\sqrt[3]{\sqrt{x}} \cdot \sqrt[3]{\sqrt{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)} \]
    10. cbrt-unprod6.1%

      \[\leadsto \left(\left(x + 1\right) - {\color{blue}{\left(\sqrt[3]{\sqrt{x} \cdot \sqrt{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)} \]
    11. add-sqr-sqrt6.0%

      \[\leadsto \left(\left(x + 1\right) - {\left(\sqrt[3]{\color{blue}{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)} \]
    12. rem-cube-cbrt9.0%

      \[\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)} \]
  8. Applied egg-rr9.0%

    \[\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} + \sqrt[3]{x + 1}\right)}} \]
  9. Step-by-step derivation
    1. associate-*r/9.0%

      \[\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} + \sqrt[3]{x + 1}\right)}} \]
    2. *-rgt-identity9.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1 + \left(x - x\right)}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)} \]
  14. Add Preprocessing

Alternative 6: 8.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x)))) (if (<= t_0 0.0) 1.0 t_0)))
double code(double x) {
	double t_0 = cbrt((1.0 + x)) - cbrt(x);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 1.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = Math.cbrt((1.0 + x)) - Math.cbrt(x);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 1.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x)
	t_0 = Float64(cbrt(Float64(1.0 + x)) - cbrt(x))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = 1.0;
	else
		tmp = t_0;
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], 1.0, t$95$0]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\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. Taylor expanded in x around 0 5.9%

      \[\leadsto \color{blue}{1} \]

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

    1. Initial program 56.6%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification8.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 8.0% accurate, 0.5× speedup?

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

\\
\sqrt[3]{1 + x} - \sqrt[3]{\sqrt{x}} \cdot {x}^{0.16666666666666666}
\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.9%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
    2. *-rgt-identity7.9%

      \[\leadsto \sqrt[3]{x + 1} - {\color{blue}{\left(x \cdot 1\right)}}^{0.3333333333333333} \]
    3. add-sqr-sqrt7.9%

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

      \[\leadsto \sqrt[3]{x + 1} - {\color{blue}{\left(\sqrt{x} \cdot \left(\sqrt{x} \cdot 1\right)\right)}}^{0.3333333333333333} \]
    5. unpow-prod-down7.9%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{\left(\sqrt{x}\right)}^{0.3333333333333333} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333}} \]
    6. pow1/27.8%

      \[\leadsto \sqrt[3]{x + 1} - {\color{blue}{\left({x}^{0.5}\right)}}^{0.3333333333333333} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333} \]
    7. pow-pow7.8%

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{\left(0.5 \cdot 0.3333333333333333\right)}} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333} \]
    8. metadata-eval7.8%

      \[\leadsto \sqrt[3]{x + 1} - {x}^{\color{blue}{0.16666666666666666}} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333} \]
  4. Applied egg-rr7.8%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.16666666666666666} \cdot {\left(\sqrt{x} \cdot 1\right)}^{0.3333333333333333}} \]
  5. Step-by-step derivation
    1. unpow1/37.9%

      \[\leadsto \sqrt[3]{x + 1} - {x}^{0.16666666666666666} \cdot \color{blue}{\sqrt[3]{\sqrt{x} \cdot 1}} \]
    2. *-rgt-identity7.9%

      \[\leadsto \sqrt[3]{x + 1} - {x}^{0.16666666666666666} \cdot \sqrt[3]{\color{blue}{\sqrt{x}}} \]
  6. Simplified7.9%

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.16666666666666666} \cdot \sqrt[3]{\sqrt{x}}} \]
  7. Final simplification7.9%

    \[\leadsto \sqrt[3]{1 + x} - \sqrt[3]{\sqrt{x}} \cdot {x}^{0.16666666666666666} \]
  8. Add Preprocessing

Alternative 8: 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.9%

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

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

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

Alternative 9: 4.1% 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.1%

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

    \[\leadsto 0 \]
  5. Add Preprocessing

Alternative 10: 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.3%

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

    \[\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 2024026 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  :pre (and (> x 1.0) (< x 1e+308))

  :herbie-target
  (/ 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)))