Average Error: 0.0 → 0.0
Time: 36.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[i \cdot c + \mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(z \cdot t\right)\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
i \cdot c + \mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(z \cdot t\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r8646883 = x;
        double r8646884 = y;
        double r8646885 = r8646883 * r8646884;
        double r8646886 = z;
        double r8646887 = t;
        double r8646888 = r8646886 * r8646887;
        double r8646889 = r8646885 + r8646888;
        double r8646890 = a;
        double r8646891 = b;
        double r8646892 = r8646890 * r8646891;
        double r8646893 = r8646889 + r8646892;
        double r8646894 = c;
        double r8646895 = i;
        double r8646896 = r8646894 * r8646895;
        double r8646897 = r8646893 + r8646896;
        return r8646897;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r8646898 = i;
        double r8646899 = c;
        double r8646900 = r8646898 * r8646899;
        double r8646901 = a;
        double r8646902 = b;
        double r8646903 = x;
        double r8646904 = y;
        double r8646905 = z;
        double r8646906 = t;
        double r8646907 = r8646905 * r8646906;
        double r8646908 = fma(r8646903, r8646904, r8646907);
        double r8646909 = fma(r8646901, r8646902, r8646908);
        double r8646910 = r8646900 + r8646909;
        return r8646910;
}

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, \left(\mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(z \cdot t\right)\right)\right)\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

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

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

Reproduce

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