?

Average Error: 29.7 → 0.5
Time: 10.6s
Precision: binary64
Cost: 33033

?

\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq -2 \cdot 10^{+154} \lor \neg \left(x \leq 10^{+153}\right):\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot \left(\sqrt[3]{x} + t_0\right) + \sqrt[3]{x \cdot x}}\\ \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))))
   (if (or (<= x -2e+154) (not (<= x 1e+153)))
     (/ 1.0 (+ (pow (cbrt x) 2.0) (* t_0 (+ (cbrt x) (cbrt x)))))
     (/ 1.0 (+ (* t_0 (+ (cbrt x) t_0)) (cbrt (* x x)))))))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double tmp;
	if ((x <= -2e+154) || !(x <= 1e+153)) {
		tmp = 1.0 / (pow(cbrt(x), 2.0) + (t_0 * (cbrt(x) + cbrt(x))));
	} else {
		tmp = 1.0 / ((t_0 * (cbrt(x) + t_0)) + cbrt((x * x)));
	}
	return tmp;
}
public static double code(double x) {
	return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
public static double code(double x) {
	double t_0 = Math.cbrt((1.0 + x));
	double tmp;
	if ((x <= -2e+154) || !(x <= 1e+153)) {
		tmp = 1.0 / (Math.pow(Math.cbrt(x), 2.0) + (t_0 * (Math.cbrt(x) + Math.cbrt(x))));
	} else {
		tmp = 1.0 / ((t_0 * (Math.cbrt(x) + t_0)) + Math.cbrt((x * 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))
	tmp = 0.0
	if ((x <= -2e+154) || !(x <= 1e+153))
		tmp = Float64(1.0 / Float64((cbrt(x) ^ 2.0) + Float64(t_0 * Float64(cbrt(x) + cbrt(x)))));
	else
		tmp = Float64(1.0 / Float64(Float64(t_0 * Float64(cbrt(x) + t_0)) + cbrt(Float64(x * 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]}, If[Or[LessEqual[x, -2e+154], N[Not[LessEqual[x, 1e+153]], $MachinePrecision]], N[(1.0 / N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] + N[(t$95$0 * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(t$95$0 * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+154} \lor \neg \left(x \leq 10^{+153}\right):\\
\;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if x < -2.00000000000000007e154 or 1e153 < x

    1. Initial program 61.0

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr61.0

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

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

      [Start]61.0

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

      associate-*r/ [=>]61.0

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

      *-rgt-identity [=>]61.0

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

      +-commutative [=>]61.0

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

      associate--l+ [=>]1.0

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

      +-inverses [=>]1.0

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

      metadata-eval [=>]1.0

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

      +-commutative [=>]1.0

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

      fma-def [=>]1.0

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

      +-commutative [=>]1.0

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

      +-commutative [=>]1.0

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

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

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

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

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

      [Start]34.3

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

      unpow1/3 [=>]1.0

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

    if -2.00000000000000007e154 < x < 1e153

    1. Initial program 19.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr18.3

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

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

      [Start]18.3

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

      associate-*r/ [=>]18.3

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

      *-rgt-identity [=>]18.3

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

      +-commutative [=>]18.3

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

      associate--l+ [=>]0.4

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

      +-inverses [=>]0.4

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

      metadata-eval [=>]0.4

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

      +-commutative [=>]0.4

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

      fma-def [=>]0.4

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

      +-commutative [=>]0.4

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

      +-commutative [=>]0.4

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

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

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

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

Alternatives

Alternative 1
Error0.5
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 2
Error0.5
Cost32896
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(\sqrt[3]{x} + t_0\right)} \end{array} \]
Alternative 3
Error13.5
Cost26960
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)\\ t_2 := \frac{1}{\sqrt[3]{x \cdot x} + t_1}\\ t_3 := \frac{1}{1 + t_1}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -29000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 50000000:\\ \;\;\;\;t_0 + \frac{-1}{\frac{1}{\sqrt[3]{x}}}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error7.4
Cost26824
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ t_2 := \sqrt[3]{x} \cdot t_1\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_2}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_2 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 5
Error8.0
Cost26760
\[\begin{array}{l} t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_0}\\ \mathbf{elif}\;x \leq -1:\\ \;\;\;\;\frac{1}{\sqrt[3]{x \cdot x} + t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 6
Error25.0
Cost26632
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq -7.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\sqrt[3]{\frac{1 + {x}^{3}}{1 + \left(x \cdot x - x\right)}} - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(1 + \sqrt[3]{x}\right)}\\ \end{array} \]
Alternative 7
Error25.6
Cost26564
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\ \;\;\;\;\frac{1}{1 + {\left(\sqrt[3]{x}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{-1}{\frac{1}{\sqrt[3]{x}}}\\ \end{array} \]
Alternative 8
Error25.0
Cost20361
\[\begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{+14} \lor \neg \left(x \leq 2 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{1 + {x}^{3}}{1 + \left(x \cdot x - x\right)}} - \sqrt[3]{x}\\ \end{array} \]
Alternative 9
Error25.0
Cost20169
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+15} \lor \neg \left(x \leq 1.95 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{-1}{\frac{1}{\sqrt[3]{x}}}\\ \end{array} \]
Alternative 10
Error25.6
Cost13449
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+15} \lor \neg \left(x \leq 2.5 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{1}{1 + {\left(\sqrt[3]{x}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\ \end{array} \]
Alternative 11
Error29.7
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 12
Error61.7
Cost64
\[0 \]
Alternative 13
Error32.0
Cost64
\[1 \]

Error

Reproduce?

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