Average Error: 0.0 → 0.0
Time: 6.4s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \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(c, i, \mathsf{fma}\left(a, b, \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 r76447 = x;
        double r76448 = y;
        double r76449 = r76447 * r76448;
        double r76450 = z;
        double r76451 = t;
        double r76452 = r76450 * r76451;
        double r76453 = r76449 + r76452;
        double r76454 = a;
        double r76455 = b;
        double r76456 = r76454 * r76455;
        double r76457 = r76453 + r76456;
        double r76458 = c;
        double r76459 = i;
        double r76460 = r76458 * r76459;
        double r76461 = r76457 + r76460;
        return r76461;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76462 = c;
        double r76463 = i;
        double r76464 = a;
        double r76465 = b;
        double r76466 = x;
        double r76467 = y;
        double r76468 = z;
        double r76469 = t;
        double r76470 = r76468 * r76469;
        double r76471 = fma(r76466, r76467, r76470);
        double r76472 = fma(r76464, r76465, r76471);
        double r76473 = fma(r76462, r76463, r76472);
        return r76473;
}

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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

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