Average Error: 0.0 → 0.0
Time: 3.5s
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 r117656 = x;
        double r117657 = y;
        double r117658 = r117656 * r117657;
        double r117659 = z;
        double r117660 = t;
        double r117661 = r117659 * r117660;
        double r117662 = r117658 + r117661;
        double r117663 = a;
        double r117664 = b;
        double r117665 = r117663 * r117664;
        double r117666 = r117662 + r117665;
        double r117667 = c;
        double r117668 = i;
        double r117669 = r117667 * r117668;
        double r117670 = r117666 + r117669;
        return r117670;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r117671 = i;
        double r117672 = c;
        double r117673 = b;
        double r117674 = a;
        double r117675 = x;
        double r117676 = y;
        double r117677 = z;
        double r117678 = t;
        double r117679 = r117677 * r117678;
        double r117680 = fma(r117675, r117676, r117679);
        double r117681 = fma(r117673, r117674, r117680);
        double r117682 = fma(r117671, r117672, r117681);
        return r117682;
}

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