Average Error: 0.0 → 0.0
Time: 17.0s
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 r66878 = x;
        double r66879 = y;
        double r66880 = r66878 * r66879;
        double r66881 = z;
        double r66882 = t;
        double r66883 = r66881 * r66882;
        double r66884 = r66880 + r66883;
        double r66885 = a;
        double r66886 = b;
        double r66887 = r66885 * r66886;
        double r66888 = r66884 + r66887;
        double r66889 = c;
        double r66890 = i;
        double r66891 = r66889 * r66890;
        double r66892 = r66888 + r66891;
        return r66892;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66893 = i;
        double r66894 = c;
        double r66895 = a;
        double r66896 = b;
        double r66897 = x;
        double r66898 = y;
        double r66899 = t;
        double r66900 = z;
        double r66901 = r66899 * r66900;
        double r66902 = fma(r66897, r66898, r66901);
        double r66903 = fma(r66895, r66896, r66902);
        double r66904 = fma(r66893, r66894, r66903);
        return r66904;
}

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