Average Error: 0.0 → 0.0
Time: 6.3s
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 r200430 = x;
        double r200431 = y;
        double r200432 = r200430 * r200431;
        double r200433 = z;
        double r200434 = t;
        double r200435 = r200433 * r200434;
        double r200436 = r200432 + r200435;
        double r200437 = a;
        double r200438 = b;
        double r200439 = r200437 * r200438;
        double r200440 = r200436 + r200439;
        double r200441 = c;
        double r200442 = i;
        double r200443 = r200441 * r200442;
        double r200444 = r200440 + r200443;
        return r200444;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r200445 = c;
        double r200446 = i;
        double r200447 = a;
        double r200448 = b;
        double r200449 = x;
        double r200450 = y;
        double r200451 = z;
        double r200452 = t;
        double r200453 = r200451 * r200452;
        double r200454 = fma(r200449, r200450, r200453);
        double r200455 = fma(r200447, r200448, r200454);
        double r200456 = fma(r200445, r200446, r200455);
        return r200456;
}

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