Average Error: 0.0 → 0.0
Time: 2.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 r83823 = x;
        double r83824 = y;
        double r83825 = r83823 * r83824;
        double r83826 = z;
        double r83827 = t;
        double r83828 = r83826 * r83827;
        double r83829 = r83825 + r83828;
        double r83830 = a;
        double r83831 = b;
        double r83832 = r83830 * r83831;
        double r83833 = r83829 + r83832;
        double r83834 = c;
        double r83835 = i;
        double r83836 = r83834 * r83835;
        double r83837 = r83833 + r83836;
        return r83837;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r83838 = i;
        double r83839 = c;
        double r83840 = b;
        double r83841 = a;
        double r83842 = x;
        double r83843 = y;
        double r83844 = z;
        double r83845 = t;
        double r83846 = r83844 * r83845;
        double r83847 = fma(r83842, r83843, r83846);
        double r83848 = fma(r83840, r83841, r83847);
        double r83849 = fma(r83838, r83839, r83848);
        return r83849;
}

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 2020083 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))