Average Error: 0.0 → 0.0
Time: 1.8s
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(b, a, \mathsf{fma}\left(x, y, z \cdot t\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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r139669 = x;
        double r139670 = y;
        double r139671 = r139669 * r139670;
        double r139672 = z;
        double r139673 = t;
        double r139674 = r139672 * r139673;
        double r139675 = r139671 + r139674;
        double r139676 = a;
        double r139677 = b;
        double r139678 = r139676 * r139677;
        double r139679 = r139675 + r139678;
        double r139680 = c;
        double r139681 = i;
        double r139682 = r139680 * r139681;
        double r139683 = r139679 + r139682;
        return r139683;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r139684 = i;
        double r139685 = c;
        double r139686 = b;
        double r139687 = a;
        double r139688 = x;
        double r139689 = y;
        double r139690 = z;
        double r139691 = t;
        double r139692 = r139690 * r139691;
        double r139693 = fma(r139688, r139689, r139692);
        double r139694 = fma(r139686, r139687, r139693);
        double r139695 = fma(r139684, r139685, r139694);
        return r139695;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020039 +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)))