Average Error: 0.0 → 0.0
Time: 2.7s
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(t, z, \mathsf{fma}\left(a, b, x \cdot y\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(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r109792 = x;
        double r109793 = y;
        double r109794 = r109792 * r109793;
        double r109795 = z;
        double r109796 = t;
        double r109797 = r109795 * r109796;
        double r109798 = r109794 + r109797;
        double r109799 = a;
        double r109800 = b;
        double r109801 = r109799 * r109800;
        double r109802 = r109798 + r109801;
        double r109803 = c;
        double r109804 = i;
        double r109805 = r109803 * r109804;
        double r109806 = r109802 + r109805;
        return r109806;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r109807 = i;
        double r109808 = c;
        double r109809 = t;
        double r109810 = z;
        double r109811 = a;
        double r109812 = b;
        double r109813 = x;
        double r109814 = y;
        double r109815 = r109813 * r109814;
        double r109816 = fma(r109811, r109812, r109815);
        double r109817 = fma(r109809, r109810, r109816);
        double r109818 = fma(r109807, r109808, r109817);
        return r109818;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

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

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

Reproduce

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