Average Error: 0.0 → 0.0
Time: 1.9s
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 r71639 = x;
        double r71640 = y;
        double r71641 = r71639 * r71640;
        double r71642 = z;
        double r71643 = t;
        double r71644 = r71642 * r71643;
        double r71645 = r71641 + r71644;
        double r71646 = a;
        double r71647 = b;
        double r71648 = r71646 * r71647;
        double r71649 = r71645 + r71648;
        double r71650 = c;
        double r71651 = i;
        double r71652 = r71650 * r71651;
        double r71653 = r71649 + r71652;
        return r71653;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r71654 = i;
        double r71655 = c;
        double r71656 = t;
        double r71657 = z;
        double r71658 = a;
        double r71659 = b;
        double r71660 = x;
        double r71661 = y;
        double r71662 = r71660 * r71661;
        double r71663 = fma(r71658, r71659, r71662);
        double r71664 = fma(r71656, r71657, r71663);
        double r71665 = fma(r71654, r71655, r71664);
        return r71665;
}

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