Average Error: 0.0 → 0.0
Time: 11.7s
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 r95444 = x;
        double r95445 = y;
        double r95446 = r95444 * r95445;
        double r95447 = z;
        double r95448 = t;
        double r95449 = r95447 * r95448;
        double r95450 = r95446 + r95449;
        double r95451 = a;
        double r95452 = b;
        double r95453 = r95451 * r95452;
        double r95454 = r95450 + r95453;
        double r95455 = c;
        double r95456 = i;
        double r95457 = r95455 * r95456;
        double r95458 = r95454 + r95457;
        return r95458;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r95459 = i;
        double r95460 = c;
        double r95461 = t;
        double r95462 = z;
        double r95463 = a;
        double r95464 = b;
        double r95465 = x;
        double r95466 = y;
        double r95467 = r95465 * r95466;
        double r95468 = fma(r95463, r95464, r95467);
        double r95469 = fma(r95461, r95462, r95468);
        double r95470 = fma(r95459, r95460, r95469);
        return r95470;
}

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