(FPCore (x y z t) :precision binary64 (+ (* (+ (* x y) z) y) t))
(FPCore (x y z t) :precision binary64 (+ (* y z) (+ t (* y (* y x)))))
double code(double x, double y, double z, double t) {
return (((x * y) + z) * y) + t;
}
double code(double x, double y, double z, double t) {
return (y * z) + (t + (y * (y * x)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * y) + z) * y) + t
end function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * z) + (t + (y * (y * x)))
end function
public static double code(double x, double y, double z, double t) {
return (((x * y) + z) * y) + t;
}
public static double code(double x, double y, double z, double t) {
return (y * z) + (t + (y * (y * x)));
}
def code(x, y, z, t): return (((x * y) + z) * y) + t
def code(x, y, z, t): return (y * z) + (t + (y * (y * x)))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * y) + z) * y) + t) end
function code(x, y, z, t) return Float64(Float64(y * z) + Float64(t + Float64(y * Float64(y * x)))) end
function tmp = code(x, y, z, t) tmp = (((x * y) + z) * y) + t; end
function tmp = code(x, y, z, t) tmp = (y * z) + (t + (y * (y * x))); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(y * z), $MachinePrecision] + N[(t + N[(y * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z\right) \cdot y + t
y \cdot z + \left(t + y \cdot \left(y \cdot x\right)\right)



Bits error versus x



Bits error versus y



Bits error versus z



Bits error versus t
Results
Initial program 0.1
Simplified0.1
Taylor expanded in y around 0 4.5
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022153
(FPCore (x y z t)
:name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
:precision binary64
(+ (* (+ (* x y) z) y) t))