Average Error: 0.0 → 0.0
Time: 5.6s
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 r5482837 = x;
        double r5482838 = y;
        double r5482839 = r5482837 * r5482838;
        double r5482840 = z;
        double r5482841 = t;
        double r5482842 = r5482840 * r5482841;
        double r5482843 = r5482839 + r5482842;
        double r5482844 = a;
        double r5482845 = b;
        double r5482846 = r5482844 * r5482845;
        double r5482847 = r5482843 + r5482846;
        double r5482848 = c;
        double r5482849 = i;
        double r5482850 = r5482848 * r5482849;
        double r5482851 = r5482847 + r5482850;
        return r5482851;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5482852 = i;
        double r5482853 = c;
        double r5482854 = a;
        double r5482855 = b;
        double r5482856 = x;
        double r5482857 = y;
        double r5482858 = t;
        double r5482859 = z;
        double r5482860 = r5482858 * r5482859;
        double r5482861 = fma(r5482856, r5482857, r5482860);
        double r5482862 = fma(r5482854, r5482855, r5482861);
        double r5482863 = fma(r5482852, r5482853, r5482862);
        return r5482863;
}

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