Average Error: 0.0 → 0.0
Time: 6.0s
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 r121640 = x;
        double r121641 = y;
        double r121642 = r121640 * r121641;
        double r121643 = z;
        double r121644 = t;
        double r121645 = r121643 * r121644;
        double r121646 = r121642 + r121645;
        double r121647 = a;
        double r121648 = b;
        double r121649 = r121647 * r121648;
        double r121650 = r121646 + r121649;
        double r121651 = c;
        double r121652 = i;
        double r121653 = r121651 * r121652;
        double r121654 = r121650 + r121653;
        return r121654;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r121655 = i;
        double r121656 = c;
        double r121657 = b;
        double r121658 = a;
        double r121659 = x;
        double r121660 = y;
        double r121661 = z;
        double r121662 = t;
        double r121663 = r121661 * r121662;
        double r121664 = fma(r121659, r121660, r121663);
        double r121665 = fma(r121657, r121658, r121664);
        double r121666 = fma(r121655, r121656, r121665);
        return r121666;
}

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 2020021 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))