Average Error: 0.0 → 0.0
Time: 22.3s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r8615779 = x;
        double r8615780 = y;
        double r8615781 = r8615779 * r8615780;
        double r8615782 = z;
        double r8615783 = t;
        double r8615784 = r8615782 * r8615783;
        double r8615785 = r8615781 + r8615784;
        double r8615786 = a;
        double r8615787 = b;
        double r8615788 = r8615786 * r8615787;
        double r8615789 = r8615785 + r8615788;
        return r8615789;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r8615790 = a;
        double r8615791 = b;
        double r8615792 = x;
        double r8615793 = y;
        double r8615794 = z;
        double r8615795 = t;
        double r8615796 = r8615794 * r8615795;
        double r8615797 = fma(r8615792, r8615793, r8615796);
        double r8615798 = fma(r8615790, r8615791, r8615797);
        return r8615798;
}

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

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  (+ (+ (* x y) (* z t)) (* a b)))