Average Error: 0.0 → 0.0
Time: 2.0s
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 r15680 = x;
        double r15681 = y;
        double r15682 = r15680 * r15681;
        double r15683 = z;
        double r15684 = t;
        double r15685 = r15683 * r15684;
        double r15686 = r15682 + r15685;
        double r15687 = a;
        double r15688 = b;
        double r15689 = r15687 * r15688;
        double r15690 = r15686 + r15689;
        return r15690;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r15691 = a;
        double r15692 = b;
        double r15693 = x;
        double r15694 = y;
        double r15695 = z;
        double r15696 = t;
        double r15697 = r15695 * r15696;
        double r15698 = fma(r15693, r15694, r15697);
        double r15699 = fma(r15691, r15692, r15698);
        return r15699;
}

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