(FPCore (x) :precision binary64 (/ (- (* x x) 3.0) 6.0))
(FPCore (x) :precision binary64 (+ -0.5 (/ x (/ 6.0 x))))
double code(double x) {
return ((x * x) - 3.0) / 6.0;
}
double code(double x) {
return -0.5 + (x / (6.0 / x));
}
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
code = (-0.5d0) + (x / (6.0d0 / x))
end function
public static double code(double x) {
return ((x * x) - 3.0) / 6.0;
}
public static double code(double x) {
return -0.5 + (x / (6.0 / x));
}
def code(x): return ((x * x) - 3.0) / 6.0
def code(x): return -0.5 + (x / (6.0 / x))
function code(x) return Float64(Float64(Float64(x * x) - 3.0) / 6.0) end
function code(x) return Float64(-0.5 + Float64(x / Float64(6.0 / x))) end
function tmp = code(x) tmp = ((x * x) - 3.0) / 6.0; end
function tmp = code(x) tmp = -0.5 + (x / (6.0 / x)); end
code[x_] := N[(N[(N[(x * x), $MachinePrecision] - 3.0), $MachinePrecision] / 6.0), $MachinePrecision]
code[x_] := N[(-0.5 + N[(x / N[(6.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot x - 3}{6}
-0.5 + \frac{x}{\frac{6}{x}}



Bits error versus x
Results
Initial program 0.1
Simplified0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022162
(FPCore (x)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
:precision binary64
(/ (- (* x x) 3.0) 6.0))