Average Error: 0.0 → 0.0
Time: 9.5s
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(a, b, \mathsf{fma}\left(x, y, t \cdot z\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(a, b, \mathsf{fma}\left(x, y, t \cdot z\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76517 = x;
        double r76518 = y;
        double r76519 = r76517 * r76518;
        double r76520 = z;
        double r76521 = t;
        double r76522 = r76520 * r76521;
        double r76523 = r76519 + r76522;
        double r76524 = a;
        double r76525 = b;
        double r76526 = r76524 * r76525;
        double r76527 = r76523 + r76526;
        double r76528 = c;
        double r76529 = i;
        double r76530 = r76528 * r76529;
        double r76531 = r76527 + r76530;
        return r76531;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r76532 = i;
        double r76533 = c;
        double r76534 = a;
        double r76535 = b;
        double r76536 = x;
        double r76537 = y;
        double r76538 = t;
        double r76539 = z;
        double r76540 = r76538 * r76539;
        double r76541 = fma(r76536, r76537, r76540);
        double r76542 = fma(r76534, r76535, r76541);
        double r76543 = fma(r76532, r76533, r76542);
        return r76543;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

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