Average Error: 0.0 → 0.0
Time: 3.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(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 r126854 = x;
        double r126855 = y;
        double r126856 = r126854 * r126855;
        double r126857 = z;
        double r126858 = t;
        double r126859 = r126857 * r126858;
        double r126860 = r126856 + r126859;
        double r126861 = a;
        double r126862 = b;
        double r126863 = r126861 * r126862;
        double r126864 = r126860 + r126863;
        double r126865 = c;
        double r126866 = i;
        double r126867 = r126865 * r126866;
        double r126868 = r126864 + r126867;
        return r126868;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r126869 = i;
        double r126870 = c;
        double r126871 = b;
        double r126872 = a;
        double r126873 = x;
        double r126874 = y;
        double r126875 = z;
        double r126876 = t;
        double r126877 = r126875 * r126876;
        double r126878 = fma(r126873, r126874, r126877);
        double r126879 = fma(r126871, r126872, r126878);
        double r126880 = fma(r126869, r126870, r126879);
        return r126880;
}

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