Average Error: 0.0 → 0.0
Time: 5.2s
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 r153265 = x;
        double r153266 = y;
        double r153267 = r153265 * r153266;
        double r153268 = z;
        double r153269 = t;
        double r153270 = r153268 * r153269;
        double r153271 = r153267 + r153270;
        double r153272 = a;
        double r153273 = b;
        double r153274 = r153272 * r153273;
        double r153275 = r153271 + r153274;
        double r153276 = c;
        double r153277 = i;
        double r153278 = r153276 * r153277;
        double r153279 = r153275 + r153278;
        return r153279;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r153280 = i;
        double r153281 = c;
        double r153282 = t;
        double r153283 = z;
        double r153284 = a;
        double r153285 = b;
        double r153286 = x;
        double r153287 = y;
        double r153288 = r153286 * r153287;
        double r153289 = fma(r153284, r153285, r153288);
        double r153290 = fma(r153282, r153283, r153289);
        double r153291 = fma(r153280, r153281, r153290);
        return r153291;
}

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