Average Error: 0.0 → 0.0
Time: 32.7s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2693573 = x;
        double r2693574 = y;
        double r2693575 = r2693573 * r2693574;
        double r2693576 = z;
        double r2693577 = t;
        double r2693578 = r2693576 * r2693577;
        double r2693579 = r2693575 + r2693578;
        double r2693580 = a;
        double r2693581 = b;
        double r2693582 = r2693580 * r2693581;
        double r2693583 = r2693579 + r2693582;
        double r2693584 = c;
        double r2693585 = i;
        double r2693586 = r2693584 * r2693585;
        double r2693587 = r2693583 + r2693586;
        return r2693587;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2693588 = z;
        double r2693589 = t;
        double r2693590 = c;
        double r2693591 = i;
        double r2693592 = x;
        double r2693593 = y;
        double r2693594 = a;
        double r2693595 = b;
        double r2693596 = r2693594 * r2693595;
        double r2693597 = fma(r2693592, r2693593, r2693596);
        double r2693598 = fma(r2693590, r2693591, r2693597);
        double r2693599 = fma(r2693588, r2693589, r2693598);
        return r2693599;
}

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

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

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

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

Reproduce

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