2cbrt (problem 3.3.4)

?

Percentage Accurate: 53.6% → 99.5%
Time: 26.4s
Precision: binary64
Cost: 52292

?

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

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


\end{array}

Local Percentage Accuracy vs ?

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

Herbie found 17 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

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.

Bogosity?

Bogosity

Derivation?

  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.9999999999999998e-8

    1. Initial program 5.0%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr4.9%

      \[\leadsto \color{blue}{\left({\left(x + 1\right)}^{0.16666666666666666} + {x}^{0.16666666666666666}\right) \cdot \left({\left(x + 1\right)}^{0.16666666666666666} - {x}^{0.16666666666666666}\right)} \]
      Step-by-step derivation

      [Start]5.0%

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

      add-sqr-sqrt [=>]4.7%

      \[ \color{blue}{\sqrt{\sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} - \sqrt[3]{x} \]

      add-sqr-sqrt [=>]5.1%

      \[ \sqrt{\sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}} - \color{blue}{\sqrt{\sqrt[3]{x}} \cdot \sqrt{\sqrt[3]{x}}} \]

      difference-of-squares [=>]5.1%

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

      pow1/3 [=>]5.1%

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

      sqrt-pow1 [=>]5.1%

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

      metadata-eval [=>]5.1%

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

      pow1/3 [=>]5.1%

      \[ \left({\left(x + 1\right)}^{0.16666666666666666} + \sqrt{\color{blue}{{x}^{0.3333333333333333}}}\right) \cdot \left(\sqrt{\sqrt[3]{x + 1}} - \sqrt{\sqrt[3]{x}}\right) \]

      sqrt-pow1 [=>]5.1%

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

      metadata-eval [=>]5.1%

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

      pow1/3 [=>]2.5%

      \[ \left({\left(x + 1\right)}^{0.16666666666666666} + {x}^{0.16666666666666666}\right) \cdot \left(\sqrt{\color{blue}{{\left(x + 1\right)}^{0.3333333333333333}}} - \sqrt{\sqrt[3]{x}}\right) \]

      sqrt-pow1 [=>]2.4%

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

      metadata-eval [=>]2.4%

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

      pow1/3 [=>]5.0%

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

      sqrt-pow1 [=>]4.9%

      \[ \left({\left(x + 1\right)}^{0.16666666666666666} + {x}^{0.16666666666666666}\right) \cdot \left({\left(x + 1\right)}^{0.16666666666666666} - \color{blue}{{x}^{\left(\frac{0.3333333333333333}{2}\right)}}\right) \]

      metadata-eval [=>]4.9%

      \[ \left({\left(x + 1\right)}^{0.16666666666666666} + {x}^{0.16666666666666666}\right) \cdot \left({\left(x + 1\right)}^{0.16666666666666666} - {x}^{\color{blue}{0.16666666666666666}}\right) \]
    3. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{0.027777777777777776 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + \left(-0.1388888888888889 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + 0.3333333333333333 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{x}\right)} \]
    4. Simplified99.0%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{\sqrt[3]{-1 \cdot {\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{-1 \cdot {\left(\frac{-1}{x}\right)}^{-1}}}{x \cdot x} \cdot -0.1111111111111111} \]
      Step-by-step derivation

      [Start]0.0%

      \[ 0.027777777777777776 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + \left(-0.1388888888888889 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + 0.3333333333333333 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{x}\right) \]

      +-commutative [=>]0.0%

      \[ \color{blue}{\left(-0.1388888888888889 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + 0.3333333333333333 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{x}\right) + 0.027777777777777776 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}}} \]

      +-commutative [=>]0.0%

      \[ \color{blue}{\left(0.3333333333333333 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{x} + -0.1388888888888889 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}}\right)} + 0.027777777777777776 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} \]

      associate-+l+ [=>]0.0%

      \[ \color{blue}{0.3333333333333333 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{x} + \left(-0.1388888888888889 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}} + 0.027777777777777776 \cdot \frac{{\left(e^{0.16666666666666666 \cdot \left(-1 \cdot \log \left(\frac{-1}{x}\right) + \log -1\right)}\right)}^{2}}{{x}^{2}}\right)} \]

    if 4.9999999999999998e-8 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 99.5%

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr99.8%

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

      [Start]99.5%

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

      flip3-- [=>]99.4%

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

      div-inv [=>]99.4%

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

      rem-cube-cbrt [=>]99.5%

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

      rem-cube-cbrt [=>]99.8%

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

      cbrt-unprod [=>]99.8%

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

      pow2 [=>]99.8%

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

      distribute-rgt-out [=>]99.8%

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

      +-commutative [<=]99.8%

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

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

      [Start]99.8%

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

      associate-*r/ [=>]99.8%

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

      *-rgt-identity [=>]99.8%

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

      +-commutative [=>]99.8%

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

      associate--l+ [=>]99.8%

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

      +-inverses [=>]99.8%

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

      metadata-eval [=>]99.8%

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

      +-commutative [=>]99.8%

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

      fma-def [=>]99.8%

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

      +-commutative [=>]99.8%

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

      +-commutative [=>]99.8%

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{e^{0.3333333333333333 \cdot \left(2 \cdot \mathsf{log1p}\left(x\right)\right)}}\right)} \]
      Step-by-step derivation

      [Start]99.8%

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

      add-exp-log [=>]99.8%

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

      pow1/3 [=>]99.8%

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

      log-pow [=>]99.8%

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

      +-commutative [=>]99.8%

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

      log-pow [=>]99.8%

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

      +-commutative [<=]99.8%

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

      log1p-udef [<=]99.8%

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

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

      [Start]99.8%

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

      associate-*r* [=>]99.8%

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

      metadata-eval [=>]99.8%

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

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

Alternatives

Alternative 1
Accuracy99.5%
Cost52292
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t_1}{x} + \frac{t_1}{x \cdot x} \cdot -0.1111111111111111\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}\\ \end{array} \]
Alternative 2
Accuracy99.5%
Cost45956
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-9}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t_1}{x} + \frac{t_1}{x \cdot x} \cdot -0.1111111111111111\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 3
Accuracy99.1%
Cost40132
\[\begin{array}{l} t_0 := \sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}\\ \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t_0}{x} + \frac{t_0}{x \cdot x} \cdot -0.1111111111111111\\ \mathbf{else}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\ \end{array} \]
Alternative 4
Accuracy99.1%
Cost39168
\[\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} \]
Alternative 5
Accuracy76.4%
Cost26564
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{{x}^{-2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\ \end{array} \]
Alternative 6
Accuracy98.5%
Cost26564
\[\begin{array}{l} t_0 := \sqrt[3]{\frac{1}{x}}\\ \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \left(t_0 \cdot t_0\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\ \end{array} \]
Alternative 7
Accuracy99.0%
Cost26564
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x}\\ \mathbf{else}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\ \end{array} \]
Alternative 8
Accuracy76.4%
Cost26436
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{{x}^{-2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(-\sqrt[3]{x}\right)\\ \end{array} \]
Alternative 9
Accuracy76.4%
Cost26308
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-8}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{{x}^{-2}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Accuracy72.7%
Cost13188
\[\begin{array}{l} \mathbf{if}\;x \leq 0.26:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{{x}^{-2}}\\ \end{array} \]
Alternative 11
Accuracy72.7%
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 0.26:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x} \cdot \frac{1}{x}}\\ \end{array} \]
Alternative 12
Accuracy72.1%
Cost6980
\[\begin{array}{l} \mathbf{if}\;x \leq 0.26:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \end{array} \]
Alternative 13
Accuracy72.1%
Cost6980
\[\begin{array}{l} \mathbf{if}\;x \leq 0.26:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{1}{\sqrt[3]{x \cdot x}}\\ \end{array} \]
Alternative 14
Accuracy70.5%
Cost6916
\[\begin{array}{l} \mathbf{if}\;x \leq 0.26:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot {\left(x \cdot x\right)}^{-0.3333333333333333}\\ \end{array} \]
Alternative 15
Accuracy52.6%
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 1.4:\\ \;\;\;\;1 + x \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{1}{x \cdot x}}\\ \end{array} \]
Alternative 16
Accuracy3.6%
Cost64
\[0 \]
Alternative 17
Accuracy50.1%
Cost64
\[1 \]

Reproduce?

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