Average Error: 0.0 → 0.0
Time: 9.3s
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 r80546 = x;
        double r80547 = y;
        double r80548 = r80546 * r80547;
        double r80549 = z;
        double r80550 = t;
        double r80551 = r80549 * r80550;
        double r80552 = r80548 + r80551;
        double r80553 = a;
        double r80554 = b;
        double r80555 = r80553 * r80554;
        double r80556 = r80552 + r80555;
        double r80557 = c;
        double r80558 = i;
        double r80559 = r80557 * r80558;
        double r80560 = r80556 + r80559;
        return r80560;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r80561 = c;
        double r80562 = i;
        double r80563 = t;
        double r80564 = z;
        double r80565 = a;
        double r80566 = b;
        double r80567 = x;
        double r80568 = y;
        double r80569 = r80567 * r80568;
        double r80570 = fma(r80565, r80566, r80569);
        double r80571 = fma(r80563, r80564, r80570);
        double r80572 = fma(r80561, r80562, r80571);
        return r80572;
}

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