
(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 13 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 (+ 1.0 x)))) (/ 1.0 (+ (pow t_0 2.0) (/ 1.0 (/ 1.0 (* (cbrt x) (+ t_0 (cbrt x)))))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / (pow(t_0, 2.0) + (1.0 / (1.0 / (cbrt(x) * (t_0 + cbrt(x))))));
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
return 1.0 / (Math.pow(t_0, 2.0) + (1.0 / (1.0 / (Math.cbrt(x) * (t_0 + Math.cbrt(x))))));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(1.0 / Float64(1.0 / Float64(cbrt(x) * Float64(t_0 + cbrt(x))))))) 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[(1.0 / N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1}{{t_0}^{2} + \frac{1}{\frac{1}{\sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}}}
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ (cbrt x) (cbrt x)))))
(/ 1.0 (+ (* (cbrt x) (+ t_0 (cbrt x))) (cbrt (pow (+ 1.0 x) 2.0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (cbrt(x) + cbrt(x))));
} else {
tmp = 1.0 / ((cbrt(x) * (t_0 + cbrt(x))) + cbrt(pow((1.0 + x), 2.0)));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double tmp;
if ((t_0 - Math.cbrt(x)) <= 0.0) {
tmp = 1.0 / (Math.pow(t_0, 2.0) + (Math.cbrt(x) * (Math.cbrt(x) + Math.cbrt(x))));
} else {
tmp = 1.0 / ((Math.cbrt(x) * (t_0 + Math.cbrt(x))) + Math.cbrt(Math.pow((1.0 + x), 2.0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(cbrt(x) + cbrt(x))))); else tmp = Float64(1.0 / Float64(Float64(cbrt(x) * Float64(t_0 + cbrt(x))) + cbrt((Float64(1.0 + x) ^ 2.0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], 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] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right) + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ (cbrt x) (cbrt x)))))
(- (* (cbrt (fma x x -1.0)) (/ 1.0 (cbrt (+ x -1.0)))) (cbrt x)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (cbrt(x) + cbrt(x))));
} else {
tmp = (cbrt(fma(x, x, -1.0)) * (1.0 / cbrt((x + -1.0)))) - cbrt(x);
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(cbrt(x) + cbrt(x))))); else tmp = Float64(Float64(cbrt(fma(x, x, -1.0)) * Float64(1.0 / cbrt(Float64(x + -1.0)))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], 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] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(x * x + -1.0), $MachinePrecision], 1/3], $MachinePrecision] * N[(1.0 / N[Power[N[(x + -1.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)} \cdot \frac{1}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (+ 1.0 (* (cbrt x) (+ t_0 (cbrt x)))))
(- (* (cbrt (fma x x -1.0)) (/ 1.0 (cbrt (+ x -1.0)))) (cbrt x)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * (t_0 + cbrt(x))));
} else {
tmp = (cbrt(fma(x, x, -1.0)) * (1.0 / cbrt((x + -1.0)))) - cbrt(x);
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))); else tmp = Float64(Float64(cbrt(fma(x, x, -1.0)) * Float64(1.0 / cbrt(Float64(x + -1.0)))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(x * x + -1.0), $MachinePrecision], 1/3], $MachinePrecision] * N[(1.0 / N[Power[N[(x + -1.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)} \cdot \frac{1}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (+ 1.0 (* (cbrt x) (+ t_0 (cbrt x)))))
(- (/ (cbrt (fma x x -1.0)) (cbrt (+ x -1.0))) (cbrt x)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * (t_0 + cbrt(x))));
} else {
tmp = (cbrt(fma(x, x, -1.0)) / cbrt((x + -1.0))) - cbrt(x);
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))); else tmp = Float64(Float64(cbrt(fma(x, x, -1.0)) / cbrt(Float64(x + -1.0))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(x * x + -1.0), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(x + -1.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (cbrt (+ 1.0 x)) (cbrt x))) (t_1 (* (cbrt x) t_0)))
(if (<= x -1.35e+154)
(/ 1.0 (+ 1.0 t_1))
(if (<= x -1.0)
(/ 1.0 (+ t_1 (cbrt (pow x 2.0))))
(/
1.0
(+ (pow (+ 1.0 x) 0.6666666666666666) (/ (cbrt x) (/ 1.0 t_0))))))))
double code(double x) {
double t_0 = cbrt((1.0 + x)) + cbrt(x);
double t_1 = cbrt(x) * t_0;
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + t_1);
} else if (x <= -1.0) {
tmp = 1.0 / (t_1 + cbrt(pow(x, 2.0)));
} else {
tmp = 1.0 / (pow((1.0 + x), 0.6666666666666666) + (cbrt(x) / (1.0 / t_0)));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x)) + Math.cbrt(x);
double t_1 = Math.cbrt(x) * t_0;
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + t_1);
} else if (x <= -1.0) {
tmp = 1.0 / (t_1 + Math.cbrt(Math.pow(x, 2.0)));
} else {
tmp = 1.0 / (Math.pow((1.0 + x), 0.6666666666666666) + (Math.cbrt(x) / (1.0 / t_0)));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(1.0 + x)) + cbrt(x)) t_1 = Float64(cbrt(x) * t_0) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / Float64(1.0 + t_1)); elseif (x <= -1.0) tmp = Float64(1.0 / Float64(t_1 + cbrt((x ^ 2.0)))); else tmp = Float64(1.0 / Float64((Float64(1.0 + x) ^ 0.6666666666666666) + Float64(cbrt(x) / Float64(1.0 / t_0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $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 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.0], N[(1.0 / N[(t$95$1 + N[Power[N[Power[x, 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} + \sqrt[3]{x}\\
t_1 := \sqrt[3]{x} \cdot t_0\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + t_1}\\
\mathbf{elif}\;x \leq -1:\\
\;\;\;\;\frac{1}{t_1 + \sqrt[3]{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(1 + x\right)}^{0.6666666666666666} + \frac{\sqrt[3]{x}}{\frac{1}{t_0}}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x)))) (if (<= t_1 0.0) (/ 1.0 (+ 1.0 (* (cbrt x) (+ t_0 (cbrt x))))) t_1)))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = t_0 - cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * (t_0 + cbrt(x))));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double t_1 = t_0 - Math.cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (t_0 + Math.cbrt(x))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(t_0 - cbrt(x)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))); else tmp = t_1; 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[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ t_0 (cbrt x)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (t_0 + cbrt(x))));
}
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) * (t_0 + Math.cbrt(x))));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))) 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[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $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(t_0 + \sqrt[3]{x}\right)}
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (cbrt (+ 1.0 x)) (cbrt x))))
(if (<= x -1.0)
(/ 1.0 (+ 1.0 (* (cbrt x) t_0)))
(/ 1.0 (+ (pow (+ 1.0 x) 0.6666666666666666) (/ (cbrt x) (/ 1.0 t_0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x)) + cbrt(x);
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * t_0));
} else {
tmp = 1.0 / (pow((1.0 + x), 0.6666666666666666) + (cbrt(x) / (1.0 / t_0)));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x)) + Math.cbrt(x);
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * t_0));
} else {
tmp = 1.0 / (Math.pow((1.0 + x), 0.6666666666666666) + (Math.cbrt(x) / (1.0 / t_0)));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(1.0 + x)) + cbrt(x)) tmp = 0.0 if (x <= -1.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * t_0))); else tmp = Float64(1.0 / Float64((Float64(1.0 + x) ^ 0.6666666666666666) + Float64(cbrt(x) / Float64(1.0 / t_0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} + \sqrt[3]{x}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(1 + x\right)}^{0.6666666666666666} + \frac{\sqrt[3]{x}}{\frac{1}{t_0}}}\\
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (* (cbrt x) (+ (cbrt (+ 1.0 x)) (cbrt x)))))
(if (<= x -1.0)
(/ 1.0 (+ 1.0 t_0))
(/ 1.0 (+ t_0 (pow (+ 1.0 x) 0.6666666666666666))))))
double code(double x) {
double t_0 = cbrt(x) * (cbrt((1.0 + x)) + cbrt(x));
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + t_0);
} else {
tmp = 1.0 / (t_0 + pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt(x) * (Math.cbrt((1.0 + x)) + Math.cbrt(x));
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + t_0);
} else {
tmp = 1.0 / (t_0 + Math.pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(x) * Float64(cbrt(Float64(1.0 + x)) + cbrt(x))) tmp = 0.0 if (x <= -1.0) tmp = Float64(1.0 / Float64(1.0 + t_0)); else tmp = Float64(1.0 / Float64(t_0 + (Float64(1.0 + x) ^ 0.6666666666666666))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 + N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{1 + t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_0 + {\left(1 + x\right)}^{0.6666666666666666}}\\
\end{array}
\end{array}
(FPCore (x) :precision binary64 (let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x)))) (if (<= t_0 0.0) (cbrt (/ 1.0 (pow x 2.0))) t_0)))
double code(double x) {
double t_0 = cbrt((1.0 + x)) - cbrt(x);
double tmp;
if (t_0 <= 0.0) {
tmp = cbrt((1.0 / pow(x, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x)) - Math.cbrt(x);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.cbrt((1.0 / Math.pow(x, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) tmp = 0.0 if (t_0 <= 0.0) tmp = cbrt(Float64(1.0 / (x ^ 2.0))); else tmp = t_0; end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt[3]{\frac{1}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(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}
(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}
herbie shell --seed 2024006
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))