Average Error: 0.0 → 0.0
Time: 10.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(t, z, \mathsf{fma}\left(a, b, x \cdot y\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(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66483 = x;
        double r66484 = y;
        double r66485 = r66483 * r66484;
        double r66486 = z;
        double r66487 = t;
        double r66488 = r66486 * r66487;
        double r66489 = r66485 + r66488;
        double r66490 = a;
        double r66491 = b;
        double r66492 = r66490 * r66491;
        double r66493 = r66489 + r66492;
        double r66494 = c;
        double r66495 = i;
        double r66496 = r66494 * r66495;
        double r66497 = r66493 + r66496;
        return r66497;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66498 = c;
        double r66499 = i;
        double r66500 = t;
        double r66501 = z;
        double r66502 = a;
        double r66503 = b;
        double r66504 = x;
        double r66505 = y;
        double r66506 = r66504 * r66505;
        double r66507 = fma(r66502, r66503, r66506);
        double r66508 = fma(r66500, r66501, r66507);
        double r66509 = fma(r66498, r66499, r66508);
        return r66509;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

    \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\right)\]
  5. Final simplification0.0

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

Reproduce

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