Average Error: 0.0 → 0.0
Time: 1.9s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\left(\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b\right) + c \cdot i\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\left(\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b\right) + c \cdot i
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r117818 = x;
        double r117819 = y;
        double r117820 = r117818 * r117819;
        double r117821 = z;
        double r117822 = t;
        double r117823 = r117821 * r117822;
        double r117824 = r117820 + r117823;
        double r117825 = a;
        double r117826 = b;
        double r117827 = r117825 * r117826;
        double r117828 = r117824 + r117827;
        double r117829 = c;
        double r117830 = i;
        double r117831 = r117829 * r117830;
        double r117832 = r117828 + r117831;
        return r117832;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r117833 = t;
        double r117834 = z;
        double r117835 = x;
        double r117836 = y;
        double r117837 = r117835 * r117836;
        double r117838 = fma(r117833, r117834, r117837);
        double r117839 = a;
        double r117840 = b;
        double r117841 = r117839 * r117840;
        double r117842 = r117838 + r117841;
        double r117843 = c;
        double r117844 = i;
        double r117845 = r117843 * r117844;
        double r117846 = r117842 + r117845;
        return r117846;
}

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

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

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

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

Reproduce

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