
(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:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (sqrt (+ 1.0 x))))) (/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt (+ 1.0 x))) (pow (* t_0 t_0) 2.0)))))
double code(double x) {
double t_0 = cbrt(sqrt((1.0 + x)));
return 1.0 / fma(cbrt(x), (cbrt(x) + cbrt((1.0 + x))), pow((t_0 * t_0), 2.0));
}
function code(x) t_0 = cbrt(sqrt(Float64(1.0 + x))) return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(Float64(1.0 + x))), (Float64(t_0 * t_0) ^ 2.0))) end
code[x_] := Block[{t$95$0 = N[Power[N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{1 + x}}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, {\left(t\_0 \cdot t\_0\right)}^{2}\right)}
\end{array}
\end{array}
Initial program 7.5%
flip3--7.5%
div-inv7.5%
rem-cube-cbrt7.7%
rem-cube-cbrt10.0%
+-commutative10.0%
distribute-rgt-out10.0%
+-commutative10.0%
fma-define10.0%
add-exp-log10.0%
Applied egg-rr10.0%
associate-*r/10.0%
*-rgt-identity10.0%
+-commutative10.0%
associate--l+93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
*-commutative93.5%
log1p-undefine93.5%
+-commutative93.5%
exp-to-pow93.3%
metadata-eval93.3%
pow-prod-up93.3%
pow1/394.7%
pow1/398.5%
pow298.5%
+-commutative98.5%
Applied egg-rr98.5%
pow1/393.3%
add-sqr-sqrt93.3%
unpow-prod-down93.3%
Applied egg-rr93.3%
unpow1/394.7%
unpow1/398.6%
Simplified98.6%
Taylor expanded in x around 0 98.6%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (- x x))) (t_1 (cbrt (+ 1.0 x))))
(if (<= x 4.6e+15)
(/ t_0 (fma (cbrt x) (+ (cbrt x) t_1) (pow (+ 1.0 x) 0.6666666666666666)))
(/ t_0 (fma (cbrt x) (* (cbrt x) 2.0) (pow t_1 2.0))))))
double code(double x) {
double t_0 = 1.0 + (x - x);
double t_1 = cbrt((1.0 + x));
double tmp;
if (x <= 4.6e+15) {
tmp = t_0 / fma(cbrt(x), (cbrt(x) + t_1), pow((1.0 + x), 0.6666666666666666));
} else {
tmp = t_0 / fma(cbrt(x), (cbrt(x) * 2.0), pow(t_1, 2.0));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(x - x)) t_1 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (x <= 4.6e+15) tmp = Float64(t_0 / fma(cbrt(x), Float64(cbrt(x) + t_1), (Float64(1.0 + x) ^ 0.6666666666666666))); else tmp = Float64(t_0 / fma(cbrt(x), Float64(cbrt(x) * 2.0), (t_1 ^ 2.0))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[x, 4.6e+15], N[(t$95$0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$1), $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] * 2.0), $MachinePrecision] + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(x - x\right)\\
t_1 := \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq 4.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t\_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} \cdot 2, {t\_1}^{2}\right)}\\
\end{array}
\end{array}
if x < 4.6e15Initial program 58.7%
flip3--58.6%
div-inv58.6%
rem-cube-cbrt71.3%
rem-cube-cbrt98.5%
+-commutative98.5%
distribute-rgt-out98.5%
+-commutative98.5%
fma-define98.5%
add-exp-log98.2%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
+-commutative98.0%
associate--l+98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
*-commutative98.0%
exp-prod98.2%
log1p-undefine98.4%
add-exp-log98.6%
Applied egg-rr98.6%
if 4.6e15 < x Initial program 4.1%
flip3--4.1%
div-inv4.1%
rem-cube-cbrt3.5%
rem-cube-cbrt4.1%
+-commutative4.1%
distribute-rgt-out4.1%
+-commutative4.1%
fma-define4.1%
add-exp-log4.1%
Applied egg-rr4.1%
associate-*r/4.1%
*-rgt-identity4.1%
+-commutative4.1%
associate--l+93.2%
+-commutative93.2%
+-commutative93.2%
Simplified93.2%
*-commutative93.2%
log1p-undefine93.2%
+-commutative93.2%
exp-to-pow92.9%
metadata-eval92.9%
pow-prod-up92.9%
pow1/394.4%
pow1/398.5%
pow298.5%
+-commutative98.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 98.5%
Simplified98.5%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ (+ 1.0 (- x x)) (+ (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 + (x - x)) / (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 + (x - x)) / (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(Float64(1.0 + Float64(x - x)) / 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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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 + \left(x - x\right)}{{t\_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t\_0\right)}
\end{array}
\end{array}
Initial program 7.5%
flip3--7.5%
div-inv7.5%
rem-cube-cbrt7.7%
rem-cube-cbrt10.0%
+-commutative10.0%
distribute-rgt-out10.0%
+-commutative10.0%
fma-define10.0%
add-exp-log10.0%
Applied egg-rr10.0%
associate-*r/10.0%
*-rgt-identity10.0%
+-commutative10.0%
associate--l+93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
*-commutative93.5%
log1p-undefine93.5%
+-commutative93.5%
exp-to-pow93.3%
metadata-eval93.3%
pow-prod-up93.3%
pow1/394.7%
pow1/398.5%
pow298.5%
+-commutative98.5%
Applied egg-rr98.5%
pow1/393.3%
add-sqr-sqrt93.3%
unpow-prod-down93.3%
Applied egg-rr93.3%
unpow1/394.7%
unpow1/398.6%
Simplified98.6%
fma-undefine98.5%
+-commutative98.5%
cbrt-unprod98.6%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
(FPCore (x) :precision binary64 (/ (+ 1.0 (- x x)) (fma (cbrt x) (* (cbrt x) 2.0) (pow (cbrt (+ 1.0 x)) 2.0))))
double code(double x) {
return (1.0 + (x - x)) / fma(cbrt(x), (cbrt(x) * 2.0), pow(cbrt((1.0 + x)), 2.0));
}
function code(x) return Float64(Float64(1.0 + Float64(x - x)) / fma(cbrt(x), Float64(cbrt(x) * 2.0), (cbrt(Float64(1.0 + x)) ^ 2.0))) end
code[x_] := N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] * 2.0), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} \cdot 2, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}
\end{array}
Initial program 7.5%
flip3--7.5%
div-inv7.5%
rem-cube-cbrt7.7%
rem-cube-cbrt10.0%
+-commutative10.0%
distribute-rgt-out10.0%
+-commutative10.0%
fma-define10.0%
add-exp-log10.0%
Applied egg-rr10.0%
associate-*r/10.0%
*-rgt-identity10.0%
+-commutative10.0%
associate--l+93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
*-commutative93.5%
log1p-undefine93.5%
+-commutative93.5%
exp-to-pow93.3%
metadata-eval93.3%
pow-prod-up93.3%
pow1/394.7%
pow1/398.5%
pow298.5%
+-commutative98.5%
Applied egg-rr98.5%
Taylor expanded in x around inf 96.2%
Simplified96.2%
(FPCore (x) :precision binary64 (if (<= x 4.1e+154) (cbrt (* (pow x -2.0) 0.037037037037037035)) (* 0.3333333333333333 (pow x -0.6666666666666666))))
double code(double x) {
double tmp;
if (x <= 4.1e+154) {
tmp = cbrt((pow(x, -2.0) * 0.037037037037037035));
} else {
tmp = 0.3333333333333333 * pow(x, -0.6666666666666666);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 4.1e+154) {
tmp = Math.cbrt((Math.pow(x, -2.0) * 0.037037037037037035));
} else {
tmp = 0.3333333333333333 * Math.pow(x, -0.6666666666666666);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 4.1e+154) tmp = cbrt(Float64((x ^ -2.0) * 0.037037037037037035)); else tmp = Float64(0.3333333333333333 * (x ^ -0.6666666666666666)); end return tmp end
code[x_] := If[LessEqual[x, 4.1e+154], N[Power[N[(N[Power[x, -2.0], $MachinePrecision] * 0.037037037037037035), $MachinePrecision], 1/3], $MachinePrecision], N[(0.3333333333333333 * N[Power[x, -0.6666666666666666], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.1 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{{x}^{-2} \cdot 0.037037037037037035}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot {x}^{-0.6666666666666666}\\
\end{array}
\end{array}
if x < 4.1e154Initial program 9.8%
Taylor expanded in x around inf 93.7%
add-sqr-sqrt93.4%
sqrt-unprod93.7%
cbrt-unprod49.6%
pow-flip49.6%
pow-flip49.5%
pow-sqr49.5%
metadata-eval49.5%
metadata-eval49.5%
Applied egg-rr49.5%
metadata-eval49.5%
pow-sqr49.5%
cbrt-prod94.3%
sqrt-unprod94.0%
add-sqr-sqrt94.3%
pow194.3%
Applied egg-rr94.3%
unpow194.3%
rem-cbrt-cube93.8%
*-commutative93.8%
cube-prod93.7%
rem-cube-cbrt94.2%
metadata-eval94.3%
Simplified94.3%
if 4.1e154 < x Initial program 4.7%
Taylor expanded in x around inf 4.7%
pow1/34.7%
pow-flip8.6%
pow-pow89.2%
metadata-eval89.2%
metadata-eval89.2%
Applied egg-rr89.2%
(FPCore (x) :precision binary64 (* 0.3333333333333333 (/ 1.0 (pow (cbrt x) 2.0))))
double code(double x) {
return 0.3333333333333333 * (1.0 / pow(cbrt(x), 2.0));
}
public static double code(double x) {
return 0.3333333333333333 * (1.0 / Math.pow(Math.cbrt(x), 2.0));
}
function code(x) return Float64(0.3333333333333333 * Float64(1.0 / (cbrt(x) ^ 2.0))) end
code[x_] := N[(0.3333333333333333 * N[(1.0 / N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.3333333333333333 \cdot \frac{1}{{\left(\sqrt[3]{x}\right)}^{2}}
\end{array}
Initial program 7.5%
Taylor expanded in x around inf 53.7%
cbrt-div53.8%
metadata-eval53.8%
unpow253.8%
cbrt-prod96.0%
pow296.0%
Applied egg-rr96.0%
(FPCore (x) :precision binary64 (/ 0.3333333333333333 (pow (cbrt x) 2.0)))
double code(double x) {
return 0.3333333333333333 / pow(cbrt(x), 2.0);
}
public static double code(double x) {
return 0.3333333333333333 / Math.pow(Math.cbrt(x), 2.0);
}
function code(x) return Float64(0.3333333333333333 / (cbrt(x) ^ 2.0)) end
code[x_] := N[(0.3333333333333333 / N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.3333333333333333}{{\left(\sqrt[3]{x}\right)}^{2}}
\end{array}
Initial program 7.5%
Taylor expanded in x around inf 53.7%
cbrt-div53.8%
metadata-eval53.8%
un-div-inv53.8%
unpow253.8%
cbrt-prod95.9%
pow295.9%
Applied egg-rr95.9%
(FPCore (x) :precision binary64 (if (<= x 2.05e+155) (* 0.3333333333333333 (cbrt (* (/ 1.0 x) (/ 1.0 x)))) (* 0.3333333333333333 (pow x -0.6666666666666666))))
double code(double x) {
double tmp;
if (x <= 2.05e+155) {
tmp = 0.3333333333333333 * cbrt(((1.0 / x) * (1.0 / x)));
} else {
tmp = 0.3333333333333333 * pow(x, -0.6666666666666666);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 2.05e+155) {
tmp = 0.3333333333333333 * Math.cbrt(((1.0 / x) * (1.0 / x)));
} else {
tmp = 0.3333333333333333 * Math.pow(x, -0.6666666666666666);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 2.05e+155) tmp = Float64(0.3333333333333333 * cbrt(Float64(Float64(1.0 / x) * Float64(1.0 / x)))); else tmp = Float64(0.3333333333333333 * (x ^ -0.6666666666666666)); end return tmp end
code[x_] := If[LessEqual[x, 2.05e+155], N[(0.3333333333333333 * N[Power[N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[Power[x, -0.6666666666666666], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.05 \cdot 10^{+155}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x} \cdot \frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot {x}^{-0.6666666666666666}\\
\end{array}
\end{array}
if x < 2.0499999999999999e155Initial program 9.8%
Taylor expanded in x around inf 93.7%
add-sqr-sqrt93.7%
sqrt-div93.6%
metadata-eval93.6%
sqrt-pow193.6%
metadata-eval93.6%
pow193.6%
sqrt-div93.6%
metadata-eval93.6%
sqrt-pow194.3%
metadata-eval94.3%
pow194.3%
Applied egg-rr94.3%
if 2.0499999999999999e155 < x Initial program 4.7%
Taylor expanded in x around inf 4.7%
pow1/34.7%
pow-flip8.6%
pow-pow89.2%
metadata-eval89.2%
metadata-eval89.2%
Applied egg-rr89.2%
(FPCore (x) :precision binary64 (if (<= x 1.35e+154) (* 0.3333333333333333 (cbrt (/ 1.0 (* x x)))) (* 0.3333333333333333 (pow x -0.6666666666666666))))
double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = 0.3333333333333333 * cbrt((1.0 / (x * x)));
} else {
tmp = 0.3333333333333333 * pow(x, -0.6666666666666666);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = 0.3333333333333333 * Math.cbrt((1.0 / (x * x)));
} else {
tmp = 0.3333333333333333 * Math.pow(x, -0.6666666666666666);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.35e+154) tmp = Float64(0.3333333333333333 * cbrt(Float64(1.0 / Float64(x * x)))); else tmp = Float64(0.3333333333333333 * (x ^ -0.6666666666666666)); end return tmp end
code[x_] := If[LessEqual[x, 1.35e+154], N[(0.3333333333333333 * N[Power[N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[Power[x, -0.6666666666666666], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot {x}^{-0.6666666666666666}\\
\end{array}
\end{array}
if x < 1.35000000000000003e154Initial program 9.9%
Taylor expanded in x around inf 94.3%
unpow294.3%
Applied egg-rr94.3%
if 1.35000000000000003e154 < x Initial program 4.7%
Taylor expanded in x around inf 4.7%
pow1/34.7%
pow-flip9.3%
pow-pow89.2%
metadata-eval89.2%
metadata-eval89.2%
Applied egg-rr89.2%
(FPCore (x) :precision binary64 (* 0.3333333333333333 (pow x -0.6666666666666666)))
double code(double x) {
return 0.3333333333333333 * pow(x, -0.6666666666666666);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.3333333333333333d0 * (x ** (-0.6666666666666666d0))
end function
public static double code(double x) {
return 0.3333333333333333 * Math.pow(x, -0.6666666666666666);
}
def code(x): return 0.3333333333333333 * math.pow(x, -0.6666666666666666)
function code(x) return Float64(0.3333333333333333 * (x ^ -0.6666666666666666)) end
function tmp = code(x) tmp = 0.3333333333333333 * (x ^ -0.6666666666666666); end
code[x_] := N[(0.3333333333333333 * N[Power[x, -0.6666666666666666], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.3333333333333333 \cdot {x}^{-0.6666666666666666}
\end{array}
Initial program 7.5%
Taylor expanded in x around inf 53.7%
pow1/350.3%
pow-flip52.4%
pow-pow88.6%
metadata-eval88.6%
metadata-eval88.6%
Applied egg-rr88.6%
(FPCore (x) :precision binary64 (cbrt x))
double code(double x) {
return cbrt(x);
}
public static double code(double x) {
return Math.cbrt(x);
}
function code(x) return cbrt(x) end
code[x_] := N[Power[x, 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{x}
\end{array}
Initial program 7.5%
Taylor expanded in x around 0 1.8%
sub-neg1.8%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt5.6%
fabs-neg5.6%
unpow1/35.6%
metadata-eval5.6%
pow-sqr5.6%
fabs-sqr5.6%
pow-sqr5.6%
metadata-eval5.6%
unpow1/35.6%
Simplified5.6%
Taylor expanded in x around inf 5.6%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ x 1.0)))) (/ 1.0 (+ (+ (* t_0 t_0) (* (cbrt x) t_0)) (* (cbrt x) (cbrt x))))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
return 1.0 / (((t_0 * t_0) + (cbrt(x) * t_0)) + (cbrt(x) * cbrt(x)));
}
public static double code(double x) {
double t_0 = Math.cbrt((x + 1.0));
return 1.0 / (((t_0 * t_0) + (Math.cbrt(x) * t_0)) + (Math.cbrt(x) * Math.cbrt(x)));
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) return Float64(1.0 / Float64(Float64(Float64(t_0 * t_0) + Float64(cbrt(x) * t_0)) + Float64(cbrt(x) * cbrt(x)))) end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{1}{\left(t\_0 \cdot t\_0 + \sqrt[3]{x} \cdot t\_0\right) + \sqrt[3]{x} \cdot \sqrt[3]{x}}
\end{array}
\end{array}
herbie shell --seed 2024186
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
:pre (and (> x 1.0) (< x 1e+308))
:alt
(! :herbie-platform default (/ 1 (+ (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (cbrt x) (cbrt (+ x 1))) (* (cbrt x) (cbrt x)))))
(- (cbrt (+ x 1.0)) (cbrt x)))