Average Error: 0.0 → 0.0
Time: 18.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 r4187282 = x;
        double r4187283 = y;
        double r4187284 = r4187282 * r4187283;
        double r4187285 = z;
        double r4187286 = t;
        double r4187287 = r4187285 * r4187286;
        double r4187288 = r4187284 + r4187287;
        double r4187289 = a;
        double r4187290 = b;
        double r4187291 = r4187289 * r4187290;
        double r4187292 = r4187288 + r4187291;
        double r4187293 = c;
        double r4187294 = i;
        double r4187295 = r4187293 * r4187294;
        double r4187296 = r4187292 + r4187295;
        return r4187296;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4187297 = z;
        double r4187298 = t;
        double r4187299 = x;
        double r4187300 = y;
        double r4187301 = c;
        double r4187302 = i;
        double r4187303 = a;
        double r4187304 = b;
        double r4187305 = r4187303 * r4187304;
        double r4187306 = fma(r4187301, r4187302, r4187305);
        double r4187307 = fma(r4187299, r4187300, r4187306);
        double r4187308 = fma(r4187297, r4187298, r4187307);
        return r4187308;
}

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"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))