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\]
\[\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r160905 = x;
        double r160906 = y;
        double r160907 = r160905 * r160906;
        double r160908 = z;
        double r160909 = t;
        double r160910 = r160908 * r160909;
        double r160911 = r160907 + r160910;
        double r160912 = a;
        double r160913 = b;
        double r160914 = r160912 * r160913;
        double r160915 = r160911 + r160914;
        double r160916 = c;
        double r160917 = i;
        double r160918 = r160916 * r160917;
        double r160919 = r160915 + r160918;
        return r160919;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r160920 = i;
        double r160921 = c;
        double r160922 = b;
        double r160923 = a;
        double r160924 = x;
        double r160925 = y;
        double r160926 = z;
        double r160927 = t;
        double r160928 = r160926 * r160927;
        double r160929 = fma(r160924, r160925, r160928);
        double r160930 = fma(r160922, r160923, r160929);
        double r160931 = fma(r160920, r160921, r160930);
        return r160931;
}

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

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

Reproduce

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