Average Error: 0.0 → 0.0
Time: 3.2s
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 r66530 = x;
        double r66531 = y;
        double r66532 = r66530 * r66531;
        double r66533 = z;
        double r66534 = t;
        double r66535 = r66533 * r66534;
        double r66536 = r66532 + r66535;
        double r66537 = a;
        double r66538 = b;
        double r66539 = r66537 * r66538;
        double r66540 = r66536 + r66539;
        double r66541 = c;
        double r66542 = i;
        double r66543 = r66541 * r66542;
        double r66544 = r66540 + r66543;
        return r66544;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66545 = i;
        double r66546 = c;
        double r66547 = b;
        double r66548 = a;
        double r66549 = x;
        double r66550 = y;
        double r66551 = z;
        double r66552 = t;
        double r66553 = r66551 * r66552;
        double r66554 = fma(r66549, r66550, r66553);
        double r66555 = fma(r66547, r66548, r66554);
        double r66556 = fma(r66545, r66546, r66555);
        return r66556;
}

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