(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))))
(if (<= x -0.9949826766648939)
(fma
0.3333333333333333
(cbrt (/ 1.0 (* x x)))
(fma
0.06172839506172839
(cbrt (/ 1.0 (pow x 8.0)))
(* (cbrt (/ 1.0 (pow x 5.0))) -0.1111111111111111)))
(if (<= x 1.7226177030967663e-21)
(- (pow (+ x 1.0) 0.3333333333333333) (cbrt x))
(/ 1.0 (+ (pow x 0.6666666666666666) (* t_0 (+ (cbrt x) t_0))))))))double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
double t_0 = cbrt((x + 1.0));
double tmp;
if (x <= -0.9949826766648939) {
tmp = fma(0.3333333333333333, cbrt((1.0 / (x * x))), fma(0.06172839506172839, cbrt((1.0 / pow(x, 8.0))), (cbrt((1.0 / pow(x, 5.0))) * -0.1111111111111111)));
} else if (x <= 1.7226177030967663e-21) {
tmp = pow((x + 1.0), 0.3333333333333333) - cbrt(x);
} else {
tmp = 1.0 / (pow(x, 0.6666666666666666) + (t_0 * (cbrt(x) + t_0)));
}
return tmp;
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
function code(x) t_0 = cbrt(Float64(x + 1.0)) tmp = 0.0 if (x <= -0.9949826766648939) tmp = fma(0.3333333333333333, cbrt(Float64(1.0 / Float64(x * x))), fma(0.06172839506172839, cbrt(Float64(1.0 / (x ^ 8.0))), Float64(cbrt(Float64(1.0 / (x ^ 5.0))) * -0.1111111111111111))); elseif (x <= 1.7226177030967663e-21) tmp = Float64((Float64(x + 1.0) ^ 0.3333333333333333) - cbrt(x)); else tmp = Float64(1.0 / Float64((x ^ 0.6666666666666666) + Float64(t_0 * Float64(cbrt(x) + t_0)))); 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[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x, -0.9949826766648939], N[(0.3333333333333333 * N[Power[N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(0.06172839506172839 * N[Power[N[(1.0 / N[Power[x, 8.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * -0.1111111111111111), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7226177030967663e-21], N[(N[Power[N[(x + 1.0), $MachinePrecision], 0.3333333333333333], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 0.6666666666666666], $MachinePrecision] + N[(t$95$0 * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\mathbf{if}\;x \leq -0.9949826766648939:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \sqrt[3]{\frac{1}{x \cdot x}}, \mathsf{fma}\left(0.06172839506172839, \sqrt[3]{\frac{1}{{x}^{8}}}, \sqrt[3]{\frac{1}{{x}^{5}}} \cdot -0.1111111111111111\right)\right)\\
\mathbf{elif}\;x \leq 1.7226177030967663 \cdot 10^{-21}:\\
\;\;\;\;{\left(x + 1\right)}^{0.3333333333333333} - \sqrt[3]{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{0.6666666666666666} + t_0 \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\end{array}



Bits error versus x
if x < -0.99498267666489393Initial program 59.3
Taylor expanded in x around inf 44.3
Simplified30.8
if -0.99498267666489393 < x < 1.7226177030967663e-21Initial program 0.0
Applied pow1/3_binary640.0
if 1.7226177030967663e-21 < x Initial program 55.9
Applied flip3--_binary6455.8
Simplified1.0
Simplified4.2
Final simplification8.8
herbie shell --seed 2022131
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))