Average Error: 0.0 → 0.0
Time: 17.9s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6007809 = x;
        double r6007810 = y;
        double r6007811 = r6007809 * r6007810;
        double r6007812 = z;
        double r6007813 = t;
        double r6007814 = r6007812 * r6007813;
        double r6007815 = r6007811 + r6007814;
        double r6007816 = a;
        double r6007817 = b;
        double r6007818 = r6007816 * r6007817;
        double r6007819 = r6007815 + r6007818;
        double r6007820 = c;
        double r6007821 = i;
        double r6007822 = r6007820 * r6007821;
        double r6007823 = r6007819 + r6007822;
        return r6007823;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6007824 = z;
        double r6007825 = t;
        double r6007826 = x;
        double r6007827 = y;
        double r6007828 = c;
        double r6007829 = i;
        double r6007830 = a;
        double r6007831 = b;
        double r6007832 = r6007830 * r6007831;
        double r6007833 = fma(r6007828, r6007829, r6007832);
        double r6007834 = fma(r6007826, r6007827, r6007833);
        double r6007835 = fma(r6007824, r6007825, r6007834);
        return r6007835;
}

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

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

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

Reproduce

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