Average Error: 0.0 → 0.0
Time: 13.5s
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 r15861 = x;
        double r15862 = y;
        double r15863 = r15861 * r15862;
        double r15864 = z;
        double r15865 = t;
        double r15866 = r15864 * r15865;
        double r15867 = r15863 + r15866;
        double r15868 = a;
        double r15869 = b;
        double r15870 = r15868 * r15869;
        double r15871 = r15867 + r15870;
        double r15872 = c;
        double r15873 = i;
        double r15874 = r15872 * r15873;
        double r15875 = r15871 + r15874;
        return r15875;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r15876 = t;
        double r15877 = z;
        double r15878 = x;
        double r15879 = y;
        double r15880 = r15878 * r15879;
        double r15881 = fma(r15876, r15877, r15880);
        double r15882 = a;
        double r15883 = b;
        double r15884 = r15882 * r15883;
        double r15885 = r15881 + r15884;
        double r15886 = c;
        double r15887 = i;
        double r15888 = r15886 * r15887;
        double r15889 = r15885 + r15888;
        return r15889;
}

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