Average Error: 0.0 → 0.0
Time: 3.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(b, a, \mathsf{fma}\left(t, z, 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(b, a, \mathsf{fma}\left(t, z, 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 r95512 = x;
        double r95513 = y;
        double r95514 = r95512 * r95513;
        double r95515 = z;
        double r95516 = t;
        double r95517 = r95515 * r95516;
        double r95518 = r95514 + r95517;
        double r95519 = a;
        double r95520 = b;
        double r95521 = r95519 * r95520;
        double r95522 = r95518 + r95521;
        double r95523 = c;
        double r95524 = i;
        double r95525 = r95523 * r95524;
        double r95526 = r95522 + r95525;
        return r95526;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r95527 = i;
        double r95528 = c;
        double r95529 = b;
        double r95530 = a;
        double r95531 = t;
        double r95532 = z;
        double r95533 = x;
        double r95534 = y;
        double r95535 = r95533 * r95534;
        double r95536 = fma(r95531, r95532, r95535);
        double r95537 = fma(r95529, r95530, r95536);
        double r95538 = fma(r95527, r95528, r95537);
        return r95538;
}

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, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z + x \cdot y}\right)\right)\]
  4. Simplified0.0

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

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

Reproduce

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