Average Error: 0.0 → 0.0
Time: 4.1s
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 r163510 = x;
        double r163511 = y;
        double r163512 = r163510 * r163511;
        double r163513 = z;
        double r163514 = t;
        double r163515 = r163513 * r163514;
        double r163516 = r163512 + r163515;
        double r163517 = a;
        double r163518 = b;
        double r163519 = r163517 * r163518;
        double r163520 = r163516 + r163519;
        double r163521 = c;
        double r163522 = i;
        double r163523 = r163521 * r163522;
        double r163524 = r163520 + r163523;
        return r163524;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r163525 = i;
        double r163526 = c;
        double r163527 = t;
        double r163528 = z;
        double r163529 = a;
        double r163530 = b;
        double r163531 = x;
        double r163532 = y;
        double r163533 = r163531 * r163532;
        double r163534 = fma(r163529, r163530, r163533);
        double r163535 = fma(r163527, r163528, r163534);
        double r163536 = fma(r163525, r163526, r163535);
        return r163536;
}

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