Average Error: 0.0 → 0.0
Time: 4.2s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(i, c, \left(\mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(t \cdot z\right)\right)\right)\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(i, c, \left(\mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(t \cdot z\right)\right)\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r9620315 = x;
        double r9620316 = y;
        double r9620317 = r9620315 * r9620316;
        double r9620318 = z;
        double r9620319 = t;
        double r9620320 = r9620318 * r9620319;
        double r9620321 = r9620317 + r9620320;
        double r9620322 = a;
        double r9620323 = b;
        double r9620324 = r9620322 * r9620323;
        double r9620325 = r9620321 + r9620324;
        double r9620326 = c;
        double r9620327 = i;
        double r9620328 = r9620326 * r9620327;
        double r9620329 = r9620325 + r9620328;
        return r9620329;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r9620330 = i;
        double r9620331 = c;
        double r9620332 = a;
        double r9620333 = b;
        double r9620334 = x;
        double r9620335 = y;
        double r9620336 = t;
        double r9620337 = z;
        double r9620338 = r9620336 * r9620337;
        double r9620339 = fma(r9620334, r9620335, r9620338);
        double r9620340 = fma(r9620332, r9620333, r9620339);
        double r9620341 = fma(r9620330, r9620331, r9620340);
        return r9620341;
}

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

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

Reproduce

herbie shell --seed 2019128 +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)))