Average Error: 0.0 → 0.0
Time: 3.7s
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(t, z, a \cdot b + x \cdot y\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(t, z, a \cdot b + x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r67336 = x;
        double r67337 = y;
        double r67338 = r67336 * r67337;
        double r67339 = z;
        double r67340 = t;
        double r67341 = r67339 * r67340;
        double r67342 = r67338 + r67341;
        double r67343 = a;
        double r67344 = b;
        double r67345 = r67343 * r67344;
        double r67346 = r67342 + r67345;
        double r67347 = c;
        double r67348 = i;
        double r67349 = r67347 * r67348;
        double r67350 = r67346 + r67349;
        return r67350;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r67351 = i;
        double r67352 = c;
        double r67353 = t;
        double r67354 = z;
        double r67355 = a;
        double r67356 = b;
        double r67357 = r67355 * r67356;
        double r67358 = x;
        double r67359 = y;
        double r67360 = r67358 * r67359;
        double r67361 = r67357 + r67360;
        double r67362 = fma(r67353, r67354, r67361);
        double r67363 = fma(r67351, r67352, r67362);
        return r67363;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

    \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\right)\]
  5. Using strategy rm
  6. Applied fma-udef0.0

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

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

Reproduce

herbie shell --seed 2020049 +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)))