Average Error: 0.0 → 0.0
Time: 17.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3286005 = x;
        double r3286006 = y;
        double r3286007 = r3286005 * r3286006;
        double r3286008 = z;
        double r3286009 = t;
        double r3286010 = r3286008 * r3286009;
        double r3286011 = r3286007 + r3286010;
        double r3286012 = a;
        double r3286013 = b;
        double r3286014 = r3286012 * r3286013;
        double r3286015 = r3286011 + r3286014;
        double r3286016 = c;
        double r3286017 = i;
        double r3286018 = r3286016 * r3286017;
        double r3286019 = r3286015 + r3286018;
        return r3286019;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r3286020 = z;
        double r3286021 = t;
        double r3286022 = c;
        double r3286023 = i;
        double r3286024 = x;
        double r3286025 = y;
        double r3286026 = a;
        double r3286027 = b;
        double r3286028 = r3286026 * r3286027;
        double r3286029 = fma(r3286024, r3286025, r3286028);
        double r3286030 = fma(r3286022, r3286023, r3286029);
        double r3286031 = fma(r3286020, r3286021, r3286030);
        return r3286031;
}

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(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)}\]
  3. Taylor expanded around -inf 0.0

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

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

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

Reproduce

herbie shell --seed 2019142 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))