Average Error: 0.0 → 0.0
Time: 9.2s
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(a, b, \mathsf{fma}\left(x, y, t \cdot z\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(a, b, \mathsf{fma}\left(x, y, t \cdot z\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r65930 = x;
        double r65931 = y;
        double r65932 = r65930 * r65931;
        double r65933 = z;
        double r65934 = t;
        double r65935 = r65933 * r65934;
        double r65936 = r65932 + r65935;
        double r65937 = a;
        double r65938 = b;
        double r65939 = r65937 * r65938;
        double r65940 = r65936 + r65939;
        double r65941 = c;
        double r65942 = i;
        double r65943 = r65941 * r65942;
        double r65944 = r65940 + r65943;
        return r65944;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r65945 = i;
        double r65946 = c;
        double r65947 = a;
        double r65948 = b;
        double r65949 = x;
        double r65950 = y;
        double r65951 = t;
        double r65952 = z;
        double r65953 = r65951 * r65952;
        double r65954 = fma(r65949, r65950, r65953);
        double r65955 = fma(r65947, r65948, r65954);
        double r65956 = fma(r65945, r65946, r65955);
        return r65956;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))