Average Error: 0.0 → 0.0
Time: 5.6s
Precision: binary64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, y \cdot x\right)\right)\right) \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
(FPCore (x y z t a b c i)
 :precision binary64
 (fma a b (fma z t (fma c i (* y x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(a, b, fma(z, t, fma(c, i, (y * x))));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
function code(x, y, z, t, a, b, c, i)
	return fma(a, b, fma(z, t, fma(c, i, Float64(y * x))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b + N[(z * t + N[(c * i + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, y \cdot x\right)\right)\right)

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.0

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, z \cdot t\right)\right)\right)} \]
  3. Taylor expanded in x around 0 0.0

    \[\leadsto \color{blue}{y \cdot x + \left(a \cdot b + \left(t \cdot z + c \cdot i\right)\right)} \]
  4. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, b, \mathsf{fma}\left(t, z, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\right)} \]
  5. Applied egg-rr0.0

    \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{\mathsf{fma}\left(c, i, y \cdot x\right) + t \cdot z}\right) \]
  6. Applied egg-rr0.0

    \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, y \cdot x\right)\right)}\right) \]
  7. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, y \cdot x\right)\right)\right) \]

Reproduce

herbie shell --seed 2022160 
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))