# ?

Average Error: 24.5 → 0.1
Time: 10.7s
Precision: binary32
Cost: 7008

# ?

$-5 \leq x \land x \leq 5$
$\sqrt[3]{1 + x} - 1$
$\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ \frac{x}{1 + \frac{x + 2}{t_0 - \left(1 + \frac{-1}{t_0}\right)}} \end{array}$
(FPCore (x) :precision binary32 (- (cbrt (+ 1.0 x)) 1.0))
(FPCore (x)
:precision binary32
(let* ((t_0 (cbrt (+ x 1.0))))
(/ x (+ 1.0 (/ (+ x 2.0) (- t_0 (+ 1.0 (/ -1.0 t_0))))))))
float code(float x) {
return cbrtf((1.0f + x)) - 1.0f;
}

float code(float x) {
float t_0 = cbrtf((x + 1.0f));
return x / (1.0f + ((x + 2.0f) / (t_0 - (1.0f + (-1.0f / t_0)))));
}

function code(x)
return Float32(cbrt(Float32(Float32(1.0) + x)) - Float32(1.0))
end

function code(x)
t_0 = cbrt(Float32(x + Float32(1.0)))
return Float32(x / Float32(Float32(1.0) + Float32(Float32(x + Float32(2.0)) / Float32(t_0 - Float32(Float32(1.0) + Float32(Float32(-1.0) / t_0))))))
end

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

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


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 24.5

$\sqrt[3]{1 + x} - 1$
2. Applied egg-rr0.4

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

$\leadsto \color{blue}{\frac{x}{1 + \sqrt[3]{x + 1} \cdot \left(1 + \sqrt[3]{x + 1}\right)}}$
Proof
[Start]0.4 $x \cdot \frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \left(1 + \sqrt[3]{1 + x}\right)}$ $\color{blue}{\frac{x \cdot 1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \left(1 + \sqrt[3]{1 + x}\right)}}$ $\frac{\color{blue}{x}}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \left(1 + \sqrt[3]{1 + x}\right)}$ $\frac{x}{\color{blue}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) + \sqrt[3]{1 + x}}}$ $\frac{x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \color{blue}{\left(1 - 0\right)}\right) + \sqrt[3]{1 + x}}$ $\frac{x}{\color{blue}{\left(\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) - 0\right)} + \sqrt[3]{1 + x}}$ $\frac{x}{\color{blue}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) - \left(0 - \sqrt[3]{1 + x}\right)}}$ $\frac{x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) - \color{blue}{\left(-\sqrt[3]{1 + x}\right)}}$ $\frac{x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) - \color{blue}{-1 \cdot \sqrt[3]{1 + x}}}$ $\frac{x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + 1\right) - \color{blue}{\sqrt[3]{1 + x} \cdot -1}}$ $\frac{x}{\color{blue}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \left(1 - \sqrt[3]{1 + x} \cdot -1\right)}}$ $\frac{x}{\color{blue}{\left(1 - \sqrt[3]{1 + x} \cdot -1\right) + {\left(\sqrt[3]{1 + x}\right)}^{2}}}$ $\frac{x}{\color{blue}{\left(1 + \left(-\sqrt[3]{1 + x}\right) \cdot -1\right)} + {\left(\sqrt[3]{1 + x}\right)}^{2}}$ $\frac{x}{\color{blue}{1 + \left(\left(-\sqrt[3]{1 + x}\right) \cdot -1 + {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}}$
4. Applied egg-rr0.1

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

$\leadsto \frac{x}{1 + \color{blue}{\frac{x + 2}{\sqrt[3]{x + 1} - \left(1 - \frac{1}{\sqrt[3]{x + 1}}\right)}}}$
Proof
[Start]0.1 $\frac{x}{1 + \frac{x + 2}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{2} - \left(\sqrt[3]{x + 1} - 1\right)}{\sqrt[3]{x + 1}}}}$ $\frac{x}{1 + \frac{x + 2}{\color{blue}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{2}}{\sqrt[3]{x + 1}} - \frac{\sqrt[3]{x + 1} - 1}{\sqrt[3]{x + 1}}}}}$ $\frac{x}{1 + \frac{x + 2}{\frac{\color{blue}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}}{\sqrt[3]{x + 1}} - \frac{\sqrt[3]{x + 1} - 1}{\sqrt[3]{x + 1}}}}$ $\frac{x}{1 + \frac{x + 2}{\color{blue}{\frac{\sqrt[3]{x + 1}}{\frac{\sqrt[3]{x + 1}}{\sqrt[3]{x + 1}}}} - \frac{\sqrt[3]{x + 1} - 1}{\sqrt[3]{x + 1}}}}$ $\frac{x}{1 + \frac{x + 2}{\frac{\sqrt[3]{x + 1}}{\color{blue}{1}} - \frac{\sqrt[3]{x + 1} - 1}{\sqrt[3]{x + 1}}}}$ $\frac{x}{1 + \frac{x + 2}{\color{blue}{\sqrt[3]{x + 1}} - \frac{\sqrt[3]{x + 1} - 1}{\sqrt[3]{x + 1}}}}$ $\frac{x}{1 + \frac{x + 2}{\sqrt[3]{x + 1} - \color{blue}{\left(\frac{\sqrt[3]{x + 1}}{\sqrt[3]{x + 1}} - \frac{1}{\sqrt[3]{x + 1}}\right)}}}$ $\frac{x}{1 + \frac{x + 2}{\sqrt[3]{x + 1} - \left(\color{blue}{1} - \frac{1}{\sqrt[3]{x + 1}}\right)}}$
6. Final simplification0.1

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

# Alternatives

Alternative 1
Error0.1
Cost6816
$\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ \frac{x}{1 + t_0 \cdot \left(1 + t_0\right)} \end{array}$
Alternative 2
Error0.6
Cost6496
$\mathsf{expm1}\left(0.3333333333333333 \cdot \mathsf{log1p}\left(x\right)\right)$
Alternative 3
Error0.9
Cost3488
$\frac{x}{3 + \mathsf{fma}\left(x \cdot x, -0.2222222222222222, x\right)}$
Alternative 4
Error1.3
Cost416
$\frac{1}{1 + \left(x \cdot -0.2222222222222222 + 3 \cdot \frac{1}{x}\right)}$
Alternative 5
Error1.2
Cost160
$\frac{x}{x + 3}$
Alternative 6
Error2.6
Cost96
$x \cdot 0.3333333333333333$
Alternative 7
Error2.3
Cost96
$\frac{x}{3}$
Alternative 8
Error29.6
Cost32
$-1$
Alternative 9
Error23.6
Cost32
$x$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "cbrt(1+x)-1"
:precision binary32
:pre (and (<= -5.0 x) (<= x 5.0))
(- (cbrt (+ 1.0 x)) 1.0))