2cbrt (problem 3.3.4)

Percentage Accurate: 53.0% → 99.6%
Time: 14.6s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 53.0% 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.6% accurate, 0.2× speedup?

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

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

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

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

    \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - \sqrt[3]{x} \]
  4. Step-by-step derivation
    1. pow1/352.9%

      \[\leadsto \color{blue}{\sqrt[3]{x + 1}} - \sqrt[3]{x} \]
    2. sub-neg52.9%

      \[\leadsto \color{blue}{\sqrt[3]{x + 1} + \left(-\sqrt[3]{x}\right)} \]
    3. flip3-+52.9%

      \[\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(\left(-\sqrt[3]{x}\right) \cdot \left(-\sqrt[3]{x}\right) - \sqrt[3]{x + 1} \cdot \left(-\sqrt[3]{x}\right)\right)}} \]
    4. rem-cube-cbrt53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.2% accurate, 0.3× speedup?

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

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

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


\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. 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.8%

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

      \[\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)}} \]
    4. Step-by-step derivation
      1. associate-*r/1.8%

        \[\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-identity1.8%

        \[\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. +-commutative1.8%

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

        \[\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. +-inverses40.1%

        \[\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-eval40.1%

        \[\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. +-commutative40.1%

        \[\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-prod39.6%

        \[\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)} \]
    5. Simplified39.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right) + \color{blue}{\sqrt[3]{x} \cdot \sqrt[3]{x}}} \]
      5. distribute-lft-out98.4%

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

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

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

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

    1. Initial program 97.9%

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{x + 1}} - \sqrt[3]{x} \]
      2. sub-neg97.9%

        \[\leadsto \color{blue}{\sqrt[3]{x + 1} + \left(-\sqrt[3]{x}\right)} \]
      3. flip3-+97.9%

        \[\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(\left(-\sqrt[3]{x}\right) \cdot \left(-\sqrt[3]{x}\right) - \sqrt[3]{x + 1} \cdot \left(-\sqrt[3]{x}\right)\right)}} \]
      4. rem-cube-cbrt98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(\sqrt[3]{x} + t_0\right)\right)}\\

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


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

    1. Initial program 5.3%

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

        \[\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-inv5.3%

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

        \[\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-cbrt7.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. +-commutative7.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-out7.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. +-commutative7.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-def7.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-log7.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)} \]
    3. Applied egg-rr3.3%

      \[\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)}} \]
    4. Step-by-step derivation
      1. associate-*r/3.3%

        \[\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-identity3.3%

        \[\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. +-commutative3.3%

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

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

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

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

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

        \[\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)} \]
    5. Simplified39.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999998e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 4 \cdot 10^{-7}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}\\ \end{array} \]

Alternative 4: 99.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1 + \left(x - x\right)}{\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 (- x x)) (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 + (x - x)) / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	return Float64(Float64(1.0 + Float64(x - x)) / 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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    8. +-commutative99.1%

      \[\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)} \]
  7. Simplified99.1%

    \[\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)}} \]
  8. Final simplification99.1%

    \[\leadsto \frac{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)} \]

Alternative 5: 60.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}\\ \end{array} \]

Alternative 6: 60.6% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\ \end{array} \]

Alternative 7: 99.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{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 (+ (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 / (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 / (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(1.0 / 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[(1.0 / 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}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 52.9%

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

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

    \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - \sqrt[3]{x} \]
  4. Step-by-step derivation
    1. pow1/352.9%

      \[\leadsto \color{blue}{\sqrt[3]{x + 1}} - \sqrt[3]{x} \]
    2. sub-neg52.9%

      \[\leadsto \color{blue}{\sqrt[3]{x + 1} + \left(-\sqrt[3]{x}\right)} \]
    3. flip3-+52.9%

      \[\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(\left(-\sqrt[3]{x}\right) \cdot \left(-\sqrt[3]{x}\right) - \sqrt[3]{x + 1} \cdot \left(-\sqrt[3]{x}\right)\right)}} \]
    4. rem-cube-cbrt53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 53.0% 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 52.9%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Final simplification52.9%

    \[\leadsto \sqrt[3]{1 + x} - \sqrt[3]{x} \]

Alternative 9: 3.6% accurate, 205.0× speedup?

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

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

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

    \[\leadsto \color{blue}{0} \]
  3. Final simplification3.7%

    \[\leadsto 0 \]

Alternative 10: 49.4% 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 52.9%

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

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

    \[\leadsto 1 \]

Reproduce

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