Average Error: 0.0 → 0.0
Time: 17.4s
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 r97676 = x;
        double r97677 = y;
        double r97678 = r97676 * r97677;
        double r97679 = z;
        double r97680 = t;
        double r97681 = r97679 * r97680;
        double r97682 = r97678 + r97681;
        double r97683 = a;
        double r97684 = b;
        double r97685 = r97683 * r97684;
        double r97686 = r97682 + r97685;
        double r97687 = c;
        double r97688 = i;
        double r97689 = r97687 * r97688;
        double r97690 = r97686 + r97689;
        return r97690;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r97691 = i;
        double r97692 = c;
        double r97693 = a;
        double r97694 = b;
        double r97695 = x;
        double r97696 = y;
        double r97697 = t;
        double r97698 = z;
        double r97699 = r97697 * r97698;
        double r97700 = fma(r97695, r97696, r97699);
        double r97701 = fma(r97693, r97694, r97700);
        double r97702 = fma(r97691, r97692, r97701);
        return r97702;
}

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