Average Error: 0.0 → 0.0
Time: 3.6s
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 r64817 = x;
        double r64818 = y;
        double r64819 = r64817 * r64818;
        double r64820 = z;
        double r64821 = t;
        double r64822 = r64820 * r64821;
        double r64823 = r64819 + r64822;
        double r64824 = a;
        double r64825 = b;
        double r64826 = r64824 * r64825;
        double r64827 = r64823 + r64826;
        double r64828 = c;
        double r64829 = i;
        double r64830 = r64828 * r64829;
        double r64831 = r64827 + r64830;
        return r64831;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64832 = i;
        double r64833 = c;
        double r64834 = t;
        double r64835 = z;
        double r64836 = a;
        double r64837 = b;
        double r64838 = x;
        double r64839 = y;
        double r64840 = r64838 * r64839;
        double r64841 = fma(r64836, r64837, r64840);
        double r64842 = fma(r64834, r64835, r64841);
        double r64843 = fma(r64832, r64833, r64842);
        return r64843;
}

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