Average Error: 0.1 → 0.1
Time: 3.8s
Precision: binary64
\[\left(x \cdot y + z\right) \cdot y + t \]
\[y \cdot z + \left(t + y \cdot \left(y \cdot x\right)\right) \]
(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)

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), t\right)} \]
  3. Taylor expanded in y around 0 4.5

    \[\leadsto \color{blue}{y \cdot z + \left(t + {y}^{2} \cdot x\right)} \]
  4. Applied egg-rr0.1

    \[\leadsto y \cdot z + \left(t + \color{blue}{\left(0 + y \cdot \left(y \cdot x\right)\right)}\right) \]
  5. Final simplification0.1

    \[\leadsto y \cdot z + \left(t + y \cdot \left(y \cdot x\right)\right) \]

Reproduce

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))