Average Error: 0.0 → 0.0
Time: 11.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 r148337 = x;
        double r148338 = y;
        double r148339 = r148337 * r148338;
        double r148340 = z;
        double r148341 = t;
        double r148342 = r148340 * r148341;
        double r148343 = r148339 + r148342;
        double r148344 = a;
        double r148345 = b;
        double r148346 = r148344 * r148345;
        double r148347 = r148343 + r148346;
        double r148348 = c;
        double r148349 = i;
        double r148350 = r148348 * r148349;
        double r148351 = r148347 + r148350;
        return r148351;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r148352 = i;
        double r148353 = c;
        double r148354 = t;
        double r148355 = z;
        double r148356 = a;
        double r148357 = b;
        double r148358 = x;
        double r148359 = y;
        double r148360 = r148358 * r148359;
        double r148361 = fma(r148356, r148357, r148360);
        double r148362 = fma(r148354, r148355, r148361);
        double r148363 = fma(r148352, r148353, r148362);
        return r148363;
}

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