
(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 (/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt (+ 1.0 x))) (/ 1.0 (pow (cbrt (/ 1.0 (+ 1.0 x))) 2.0)))))
double code(double x) {
return 1.0 / fma(cbrt(x), (cbrt(x) + cbrt((1.0 + x))), (1.0 / pow(cbrt((1.0 / (1.0 + x))), 2.0)));
}
function code(x) return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(Float64(1.0 + x))), Float64(1.0 / (cbrt(Float64(1.0 / Float64(1.0 + x))) ^ 2.0)))) end
code[x_] := 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[(1.0 / N[Power[N[Power[N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, \frac{1}{{\left(\sqrt[3]{\frac{1}{1 + x}}\right)}^{2}}\right)}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt53.2%
cbrt-unprod53.2%
pow253.2%
distribute-rgt-out53.2%
+-commutative53.2%
Applied egg-rr53.2%
associate-*r/53.2%
*-rgt-identity53.2%
+-commutative53.2%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.5%
+-commutative75.5%
+-commutative75.5%
Simplified75.5%
unpow275.5%
cbrt-prod99.2%
Applied egg-rr99.2%
unpow299.2%
Simplified99.2%
unpow299.2%
flip-+75.4%
metadata-eval75.4%
cbrt-undiv75.5%
clear-num75.5%
flip-+75.5%
metadata-eval75.5%
cbrt-undiv75.5%
clear-num75.5%
frac-times75.5%
metadata-eval75.5%
Applied egg-rr99.2%
pow299.2%
add-cbrt-cube99.1%
frac-times99.1%
metadata-eval99.1%
frac-times99.1%
metadata-eval99.1%
add-cube-cbrt99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (pow t_0 2.0)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), (t_0 ^ 2.0))) end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\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}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt53.2%
cbrt-unprod53.2%
pow253.2%
distribute-rgt-out53.2%
+-commutative53.2%
Applied egg-rr53.2%
associate-*r/53.2%
*-rgt-identity53.2%
+-commutative53.2%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.5%
+-commutative75.5%
+-commutative75.5%
Simplified75.5%
unpow275.5%
cbrt-prod99.2%
Applied egg-rr99.2%
unpow299.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (+ (cbrt x) t_0)))
(if (<= x -1.35e+154)
(/ 1.0 (+ 1.0 (* (cbrt x) t_1)))
(if (<= x 1.32e+154)
(/ 1.0 (+ (pow t_0 2.0) (+ (cbrt (* x x)) (cbrt (+ x (* x x))))))
(/ 1.0 (fma (cbrt x) t_1 (pow (+ 1.0 x) 0.6666666666666666)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = cbrt(x) + t_0;
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + (cbrt(x) * t_1));
} else if (x <= 1.32e+154) {
tmp = 1.0 / (pow(t_0, 2.0) + (cbrt((x * x)) + cbrt((x + (x * x)))));
} else {
tmp = 1.0 / fma(cbrt(x), t_1, pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(cbrt(x) + t_0) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * t_1))); elseif (x <= 1.32e+154) tmp = Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(Float64(x * x)) + cbrt(Float64(x + Float64(x * x)))))); else tmp = Float64(1.0 / fma(cbrt(x), t_1, (Float64(1.0 + x) ^ 0.6666666666666666))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.32e+154], N[(1.0 / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := \sqrt[3]{x} + t_0\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot t_1}\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot x} + \sqrt[3]{x + x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.6%
rem-cube-cbrt4.7%
cbrt-unprod4.7%
pow24.7%
distribute-rgt-out4.7%
+-commutative4.7%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+4.7%
+-inverses4.7%
metadata-eval4.7%
+-commutative4.7%
fma-def4.7%
+-commutative4.7%
+-commutative4.7%
Simplified4.7%
unpow24.7%
cbrt-prod98.3%
Applied egg-rr98.3%
unpow298.3%
Simplified98.3%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if -1.35000000000000003e154 < x < 1.31999999999999998e154Initial program 69.2%
add-exp-log68.9%
pow1/368.5%
log-pow68.6%
+-commutative68.6%
log1p-udef68.6%
Applied egg-rr68.6%
*-commutative68.6%
exp-prod68.5%
unpow1/368.9%
Simplified68.9%
flip3--68.9%
div-inv68.9%
log1p-udef68.9%
add-exp-log68.6%
rem-cube-cbrt68.7%
rem-cube-cbrt69.0%
Applied egg-rr69.7%
associate-*r/69.7%
*-rgt-identity69.7%
associate--l+99.6%
+-inverses99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-lft-in99.6%
*-rgt-identity99.6%
Simplified99.6%
if 1.31999999999999998e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt2.9%
rem-cube-cbrt4.7%
cbrt-unprod4.7%
pow24.7%
distribute-rgt-out4.7%
+-commutative4.7%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+4.7%
+-inverses4.7%
metadata-eval4.7%
+-commutative4.7%
fma-def4.7%
+-commutative4.7%
+-commutative4.7%
Simplified4.7%
pow1/34.7%
pow-pow91.6%
metadata-eval91.6%
Applied egg-rr91.6%
Final simplification88.0%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (+ (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 / (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 / (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(1.0 / 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[(1.0 / 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}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}
\end{array}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt53.2%
cbrt-unprod53.2%
pow253.2%
distribute-rgt-out53.2%
+-commutative53.2%
Applied egg-rr53.2%
associate-*r/53.2%
*-rgt-identity53.2%
+-commutative53.2%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.5%
+-commutative75.5%
+-commutative75.5%
Simplified75.5%
unpow275.5%
cbrt-prod99.2%
Applied egg-rr99.2%
unpow299.2%
Simplified99.2%
fma-udef99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (or (<= x -1.35e+154) (not (<= x 1.32e+154)))
(/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt x) t_0))))
(/ 1.0 (+ (pow t_0 2.0) (+ (cbrt (* x x)) (cbrt (+ x (* x x)))))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((x <= -1.35e+154) || !(x <= 1.32e+154)) {
tmp = 1.0 / (1.0 + (cbrt(x) * (cbrt(x) + t_0)));
} else {
tmp = 1.0 / (pow(t_0, 2.0) + (cbrt((x * x)) + cbrt((x + (x * x)))));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double tmp;
if ((x <= -1.35e+154) || !(x <= 1.32e+154)) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt(x) + t_0)));
} else {
tmp = 1.0 / (Math.pow(t_0, 2.0) + (Math.cbrt((x * x)) + Math.cbrt((x + (x * x)))));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if ((x <= -1.35e+154) || !(x <= 1.32e+154)) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))); else tmp = Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(Float64(x * x)) + cbrt(Float64(x + Float64(x * x)))))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[Or[LessEqual[x, -1.35e+154], N[Not[LessEqual[x, 1.32e+154]], $MachinePrecision]], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154} \lor \neg \left(x \leq 1.32 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot x} + \sqrt[3]{x + x \cdot x}\right)}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154 or 1.31999999999999998e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.3%
rem-cube-cbrt4.7%
cbrt-unprod4.7%
pow24.7%
distribute-rgt-out4.7%
+-commutative4.7%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+4.7%
+-inverses4.7%
metadata-eval4.7%
+-commutative4.7%
fma-def4.7%
+-commutative4.7%
+-commutative4.7%
Simplified4.7%
unpow24.7%
cbrt-prod98.3%
Applied egg-rr98.3%
unpow298.3%
Simplified98.3%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if -1.35000000000000003e154 < x < 1.31999999999999998e154Initial program 69.2%
add-exp-log68.9%
pow1/368.5%
log-pow68.6%
+-commutative68.6%
log1p-udef68.6%
Applied egg-rr68.6%
*-commutative68.6%
exp-prod68.5%
unpow1/368.9%
Simplified68.9%
flip3--68.9%
div-inv68.9%
log1p-udef68.9%
add-exp-log68.6%
rem-cube-cbrt68.7%
rem-cube-cbrt69.0%
Applied egg-rr69.7%
associate-*r/69.7%
*-rgt-identity69.7%
associate--l+99.6%
+-inverses99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-lft-in99.6%
*-rgt-identity99.6%
Simplified99.6%
Final simplification79.3%
(FPCore (x) :precision binary64 (/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt x) (cbrt (+ 1.0 x)))))))
double code(double x) {
return 1.0 / (1.0 + (cbrt(x) * (cbrt(x) + cbrt((1.0 + x)))));
}
public static double code(double x) {
return 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt(x) + Math.cbrt((1.0 + x)))));
}
function code(x) return Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(x) + cbrt(Float64(1.0 + x)))))) end
code[x_] := N[(1.0 / 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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt53.2%
cbrt-unprod53.2%
pow253.2%
distribute-rgt-out53.2%
+-commutative53.2%
Applied egg-rr53.2%
associate-*r/53.2%
*-rgt-identity53.2%
+-commutative53.2%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.5%
+-commutative75.5%
+-commutative75.5%
Simplified75.5%
unpow275.5%
cbrt-prod99.2%
Applied egg-rr99.2%
unpow299.2%
Simplified99.2%
Taylor expanded in x around 0 59.1%
fma-udef59.1%
Applied egg-rr59.1%
Final simplification59.1%
(FPCore (x) :precision binary64 (fabs (- (cbrt (+ 1.0 x)) (cbrt x))))
double code(double x) {
return fabs((cbrt((1.0 + x)) - cbrt(x)));
}
public static double code(double x) {
return Math.abs((Math.cbrt((1.0 + x)) - Math.cbrt(x)));
}
function code(x) return abs(Float64(cbrt(Float64(1.0 + x)) - cbrt(x))) end
code[x_] := N[Abs[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\sqrt[3]{1 + x} - \sqrt[3]{x}\right|
\end{array}
Initial program 52.8%
add-exp-log51.7%
pow1/351.3%
log-pow51.5%
+-commutative51.5%
log1p-udef51.5%
Applied egg-rr51.5%
exp-prod51.5%
Simplified51.5%
add-sqr-sqrt51.2%
sqrt-unprod52.1%
pow252.1%
add-exp-log52.1%
log-pow52.1%
log1p-udef52.1%
add-log-exp52.1%
pow-to-exp52.1%
pow1/352.9%
Applied egg-rr52.9%
unpow252.9%
rem-sqrt-square52.9%
Simplified52.9%
Final simplification52.9%
(FPCore (x) :precision binary64 (- (cbrt (+ 1.0 x)) (cbrt x)))
double code(double x) {
return cbrt((1.0 + x)) - cbrt(x);
}
public static double code(double x) {
return Math.cbrt((1.0 + x)) - Math.cbrt(x);
}
function code(x) return Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) end
code[x_] := N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{1 + x} - \sqrt[3]{x}
\end{array}
Initial program 52.8%
Final simplification52.8%
(FPCore (x) :precision binary64 (- (+ 1.0 (* x 0.3333333333333333)) (cbrt x)))
double code(double x) {
return (1.0 + (x * 0.3333333333333333)) - cbrt(x);
}
public static double code(double x) {
return (1.0 + (x * 0.3333333333333333)) - Math.cbrt(x);
}
function code(x) return Float64(Float64(1.0 + Float64(x * 0.3333333333333333)) - cbrt(x)) end
code[x_] := N[(N[(1.0 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + x \cdot 0.3333333333333333\right) - \sqrt[3]{x}
\end{array}
Initial program 52.8%
Taylor expanded in x around 0 50.8%
+-commutative50.8%
unpow250.8%
associate-*r*50.8%
distribute-rgt-out50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in x around 0 51.4%
*-commutative51.4%
Simplified51.4%
Final simplification51.4%
(FPCore (x) :precision binary64 0.0)
double code(double x) {
return 0.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.0d0
end function
public static double code(double x) {
return 0.0;
}
def code(x): return 0.0
function code(x) return 0.0 end
function tmp = code(x) tmp = 0.0; end
code[x_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 52.8%
Taylor expanded in x around inf 3.6%
Final simplification3.6%
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 52.8%
Taylor expanded in x around 0 50.0%
Final simplification50.0%
herbie shell --seed 2023279
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))