Average Error: 0.0 → 0.0
Time: 1.9s
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 r67681 = x;
        double r67682 = y;
        double r67683 = r67681 * r67682;
        double r67684 = z;
        double r67685 = t;
        double r67686 = r67684 * r67685;
        double r67687 = r67683 + r67686;
        double r67688 = a;
        double r67689 = b;
        double r67690 = r67688 * r67689;
        double r67691 = r67687 + r67690;
        double r67692 = c;
        double r67693 = i;
        double r67694 = r67692 * r67693;
        double r67695 = r67691 + r67694;
        return r67695;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r67696 = i;
        double r67697 = c;
        double r67698 = b;
        double r67699 = a;
        double r67700 = x;
        double r67701 = y;
        double r67702 = z;
        double r67703 = t;
        double r67704 = r67702 * r67703;
        double r67705 = fma(r67700, r67701, r67704);
        double r67706 = fma(r67698, r67699, r67705);
        double r67707 = fma(r67696, r67697, r67706);
        return r67707;
}

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