Average Error: 0.0 → 0.0
Time: 5.4s
Precision: binary64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
\[\mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b, \mathsf{fma}\left(t, z, c \cdot i\right)\right)\right) \]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b, \mathsf{fma}\left(t, z, c \cdot i\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 y x (fma a b (fma t z (* c i)))))
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(y, x, fma(a, b, fma(t, z, (c * i))));
}

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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
  3. Taylor expanded in c around 0 0.0

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

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

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

Reproduce

herbie shell --seed 2022130 
(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)))