Average Error: 0.0 → 0.0
Time: 3.4s
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 r68646 = x;
        double r68647 = y;
        double r68648 = r68646 * r68647;
        double r68649 = z;
        double r68650 = t;
        double r68651 = r68649 * r68650;
        double r68652 = r68648 + r68651;
        double r68653 = a;
        double r68654 = b;
        double r68655 = r68653 * r68654;
        double r68656 = r68652 + r68655;
        double r68657 = c;
        double r68658 = i;
        double r68659 = r68657 * r68658;
        double r68660 = r68656 + r68659;
        return r68660;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r68661 = i;
        double r68662 = c;
        double r68663 = t;
        double r68664 = z;
        double r68665 = a;
        double r68666 = b;
        double r68667 = x;
        double r68668 = y;
        double r68669 = r68667 * r68668;
        double r68670 = fma(r68665, r68666, r68669);
        double r68671 = fma(r68663, r68664, r68670);
        double r68672 = fma(r68661, r68662, r68671);
        return r68672;
}

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