Average Error: 0.0 → 0.0
Time: 5.1s
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 r105570 = x;
        double r105571 = y;
        double r105572 = r105570 * r105571;
        double r105573 = z;
        double r105574 = t;
        double r105575 = r105573 * r105574;
        double r105576 = r105572 + r105575;
        double r105577 = a;
        double r105578 = b;
        double r105579 = r105577 * r105578;
        double r105580 = r105576 + r105579;
        double r105581 = c;
        double r105582 = i;
        double r105583 = r105581 * r105582;
        double r105584 = r105580 + r105583;
        return r105584;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r105585 = i;
        double r105586 = c;
        double r105587 = t;
        double r105588 = z;
        double r105589 = a;
        double r105590 = b;
        double r105591 = x;
        double r105592 = y;
        double r105593 = r105591 * r105592;
        double r105594 = fma(r105589, r105590, r105593);
        double r105595 = fma(r105587, r105588, r105594);
        double r105596 = fma(r105585, r105586, r105595);
        return r105596;
}

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