Average Error: 0.0 → 0.0
Time: 9.3s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[i \cdot c + \mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(z \cdot t\right)\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
i \cdot c + \mathsf{fma}\left(a, b, \left(\mathsf{fma}\left(x, y, \left(z \cdot t\right)\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2139659 = x;
        double r2139660 = y;
        double r2139661 = r2139659 * r2139660;
        double r2139662 = z;
        double r2139663 = t;
        double r2139664 = r2139662 * r2139663;
        double r2139665 = r2139661 + r2139664;
        double r2139666 = a;
        double r2139667 = b;
        double r2139668 = r2139666 * r2139667;
        double r2139669 = r2139665 + r2139668;
        double r2139670 = c;
        double r2139671 = i;
        double r2139672 = r2139670 * r2139671;
        double r2139673 = r2139669 + r2139672;
        return r2139673;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2139674 = i;
        double r2139675 = c;
        double r2139676 = r2139674 * r2139675;
        double r2139677 = a;
        double r2139678 = b;
        double r2139679 = x;
        double r2139680 = y;
        double r2139681 = z;
        double r2139682 = t;
        double r2139683 = r2139681 * r2139682;
        double r2139684 = fma(r2139679, r2139680, r2139683);
        double r2139685 = fma(r2139677, r2139678, r2139684);
        double r2139686 = r2139676 + r2139685;
        return r2139686;
}

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

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

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

Reproduce

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