Average Error: 0.0 → 0.0
Time: 17.2s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6555621 = x;
        double r6555622 = y;
        double r6555623 = r6555621 * r6555622;
        double r6555624 = z;
        double r6555625 = t;
        double r6555626 = r6555624 * r6555625;
        double r6555627 = r6555623 + r6555626;
        double r6555628 = a;
        double r6555629 = b;
        double r6555630 = r6555628 * r6555629;
        double r6555631 = r6555627 + r6555630;
        double r6555632 = c;
        double r6555633 = i;
        double r6555634 = r6555632 * r6555633;
        double r6555635 = r6555631 + r6555634;
        return r6555635;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6555636 = z;
        double r6555637 = t;
        double r6555638 = x;
        double r6555639 = y;
        double r6555640 = c;
        double r6555641 = i;
        double r6555642 = a;
        double r6555643 = b;
        double r6555644 = r6555642 * r6555643;
        double r6555645 = fma(r6555640, r6555641, r6555644);
        double r6555646 = fma(r6555638, r6555639, r6555645);
        double r6555647 = fma(r6555636, r6555637, r6555646);
        return r6555647;
}

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(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.0

    \[\leadsto \color{blue}{1 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)}\]
  5. Final simplification0.0

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

Reproduce

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