Average Error: 0.0 → 0.0
Time: 4.0s
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(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(i, c, \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 r128453 = x;
        double r128454 = y;
        double r128455 = r128453 * r128454;
        double r128456 = z;
        double r128457 = t;
        double r128458 = r128456 * r128457;
        double r128459 = r128455 + r128458;
        double r128460 = a;
        double r128461 = b;
        double r128462 = r128460 * r128461;
        double r128463 = r128459 + r128462;
        double r128464 = c;
        double r128465 = i;
        double r128466 = r128464 * r128465;
        double r128467 = r128463 + r128466;
        return r128467;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r128468 = i;
        double r128469 = c;
        double r128470 = t;
        double r128471 = z;
        double r128472 = a;
        double r128473 = b;
        double r128474 = x;
        double r128475 = y;
        double r128476 = r128474 * r128475;
        double r128477 = fma(r128472, r128473, r128476);
        double r128478 = fma(r128470, r128471, r128477);
        double r128479 = fma(r128468, r128469, r128478);
        return r128479;
}

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

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

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

Reproduce

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