Average Error: 0.0 → 0.0
Time: 5.4s
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 r92505 = x;
        double r92506 = y;
        double r92507 = r92505 * r92506;
        double r92508 = z;
        double r92509 = t;
        double r92510 = r92508 * r92509;
        double r92511 = r92507 + r92510;
        double r92512 = a;
        double r92513 = b;
        double r92514 = r92512 * r92513;
        double r92515 = r92511 + r92514;
        return r92515;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r92516 = a;
        double r92517 = b;
        double r92518 = x;
        double r92519 = y;
        double r92520 = z;
        double r92521 = t;
        double r92522 = r92520 * r92521;
        double r92523 = fma(r92518, r92519, r92522);
        double r92524 = fma(r92516, r92517, r92523);
        return r92524;
}

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