Average Error: 0.0 → 0.0
Time: 2.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(b, a, \mathsf{fma}\left(x, y, z \cdot t\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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76475 = x;
        double r76476 = y;
        double r76477 = r76475 * r76476;
        double r76478 = z;
        double r76479 = t;
        double r76480 = r76478 * r76479;
        double r76481 = r76477 + r76480;
        double r76482 = a;
        double r76483 = b;
        double r76484 = r76482 * r76483;
        double r76485 = r76481 + r76484;
        double r76486 = c;
        double r76487 = i;
        double r76488 = r76486 * r76487;
        double r76489 = r76485 + r76488;
        return r76489;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76490 = i;
        double r76491 = c;
        double r76492 = b;
        double r76493 = a;
        double r76494 = x;
        double r76495 = y;
        double r76496 = z;
        double r76497 = t;
        double r76498 = r76496 * r76497;
        double r76499 = fma(r76494, r76495, r76498);
        double r76500 = fma(r76492, r76493, r76499);
        double r76501 = fma(r76490, r76491, r76500);
        return r76501;
}

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. Final simplification0.0

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

Reproduce

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