Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r72707 = x;
        double r72708 = y;
        double r72709 = r72707 * r72708;
        double r72710 = z;
        double r72711 = t;
        double r72712 = r72710 * r72711;
        double r72713 = r72709 + r72712;
        double r72714 = a;
        double r72715 = b;
        double r72716 = r72714 * r72715;
        double r72717 = r72713 + r72716;
        double r72718 = c;
        double r72719 = i;
        double r72720 = r72718 * r72719;
        double r72721 = r72717 + r72720;
        return r72721;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r72722 = i;
        double r72723 = c;
        double r72724 = t;
        double r72725 = z;
        double r72726 = a;
        double r72727 = b;
        double r72728 = x;
        double r72729 = y;
        double r72730 = r72728 * r72729;
        double r72731 = fma(r72726, r72727, r72730);
        double r72732 = fma(r72724, r72725, r72731);
        double r72733 = fma(r72722, r72723, r72732);
        return r72733;
}

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

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

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

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

Reproduce

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