| Alternative 1 | |
|---|---|
| Error | 0.2 |
| Cost | 448 |
\[0.16666666666666666 \cdot \left(x \cdot x\right) + -0.5
\]
(FPCore (x) :precision binary64 (/ (- (* x x) 3.0) 6.0))
(FPCore (x) :precision binary64 (- (if (!= x 0.0) (/ x (/ 6.0 x)) (* (* x x) 0.16666666666666666)) 0.5))
double code(double x) {
return ((x * x) - 3.0) / 6.0;
}
double code(double x) {
double tmp;
if (x != 0.0) {
tmp = x / (6.0 / x);
} else {
tmp = (x * x) * 0.16666666666666666;
}
return tmp - 0.5;
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((x * x) - 3.0d0) / 6.0d0
end function
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x /= 0.0d0) then
tmp = x / (6.0d0 / x)
else
tmp = (x * x) * 0.16666666666666666d0
end if
code = tmp - 0.5d0
end function
public static double code(double x) {
return ((x * x) - 3.0) / 6.0;
}
public static double code(double x) {
double tmp;
if (x != 0.0) {
tmp = x / (6.0 / x);
} else {
tmp = (x * x) * 0.16666666666666666;
}
return tmp - 0.5;
}
def code(x): return ((x * x) - 3.0) / 6.0
def code(x): tmp = 0 if x != 0.0: tmp = x / (6.0 / x) else: tmp = (x * x) * 0.16666666666666666 return tmp - 0.5
function code(x) return Float64(Float64(Float64(x * x) - 3.0) / 6.0) end
function code(x) tmp = 0.0 if (x != 0.0) tmp = Float64(x / Float64(6.0 / x)); else tmp = Float64(Float64(x * x) * 0.16666666666666666); end return Float64(tmp - 0.5) end
function tmp = code(x) tmp = ((x * x) - 3.0) / 6.0; end
function tmp_2 = code(x) tmp = 0.0; if (x ~= 0.0) tmp = x / (6.0 / x); else tmp = (x * x) * 0.16666666666666666; end tmp_2 = tmp - 0.5; end
code[x_] := N[(N[(N[(x * x), $MachinePrecision] - 3.0), $MachinePrecision] / 6.0), $MachinePrecision]
code[x_] := N[(If[Unequal[x, 0.0], N[(x / N[(6.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]] - 0.5), $MachinePrecision]
\frac{x \cdot x - 3}{6}
\begin{array}{l}
\mathbf{if}\;x \ne 0:\\
\;\;\;\;\frac{x}{\frac{6}{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot 0.16666666666666666\\
\end{array} - 0.5
Initial program 0.2
Applied egg-rr0.2
Simplified0.2
Applied egg-rr0.1
| Alternative 1 | |
|---|---|
| Error | 0.2 |
| Cost | 448 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 448 |
| Alternative 3 | |
|---|---|
| Error | 0.2 |
| Cost | 448 |
| Alternative 4 | |
|---|---|
| Error | 21.8 |
| Cost | 64 |
herbie shell --seed 2023010
(FPCore (x)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
:precision binary64
(/ (- (* x x) 3.0) 6.0))