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 r122640 = x;
        double r122641 = y;
        double r122642 = r122640 * r122641;
        double r122643 = z;
        double r122644 = t;
        double r122645 = r122643 * r122644;
        double r122646 = r122642 + r122645;
        double r122647 = a;
        double r122648 = b;
        double r122649 = r122647 * r122648;
        double r122650 = r122646 + r122649;
        double r122651 = c;
        double r122652 = i;
        double r122653 = r122651 * r122652;
        double r122654 = r122650 + r122653;
        return r122654;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r122655 = i;
        double r122656 = c;
        double r122657 = t;
        double r122658 = z;
        double r122659 = a;
        double r122660 = b;
        double r122661 = x;
        double r122662 = y;
        double r122663 = r122661 * r122662;
        double r122664 = fma(r122659, r122660, r122663);
        double r122665 = fma(r122657, r122658, r122664);
        double r122666 = fma(r122655, r122656, r122665);
        return r122666;
}

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 2019347 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))