Average Error: 0.0 → 0.0
Time: 9.9s
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 r96481 = x;
        double r96482 = y;
        double r96483 = r96481 * r96482;
        double r96484 = z;
        double r96485 = t;
        double r96486 = r96484 * r96485;
        double r96487 = r96483 + r96486;
        double r96488 = a;
        double r96489 = b;
        double r96490 = r96488 * r96489;
        double r96491 = r96487 + r96490;
        double r96492 = c;
        double r96493 = i;
        double r96494 = r96492 * r96493;
        double r96495 = r96491 + r96494;
        return r96495;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r96496 = c;
        double r96497 = i;
        double r96498 = t;
        double r96499 = z;
        double r96500 = a;
        double r96501 = b;
        double r96502 = x;
        double r96503 = y;
        double r96504 = r96502 * r96503;
        double r96505 = fma(r96500, r96501, r96504);
        double r96506 = fma(r96498, r96499, r96505);
        double r96507 = fma(r96496, r96497, r96506);
        return r96507;
}

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