Average Error: 0.0 → 0.0
Time: 7.4s
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 r2172644 = x;
        double r2172645 = y;
        double r2172646 = r2172644 * r2172645;
        double r2172647 = z;
        double r2172648 = t;
        double r2172649 = r2172647 * r2172648;
        double r2172650 = r2172646 + r2172649;
        double r2172651 = a;
        double r2172652 = b;
        double r2172653 = r2172651 * r2172652;
        double r2172654 = r2172650 + r2172653;
        double r2172655 = c;
        double r2172656 = i;
        double r2172657 = r2172655 * r2172656;
        double r2172658 = r2172654 + r2172657;
        return r2172658;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2172659 = i;
        double r2172660 = c;
        double r2172661 = a;
        double r2172662 = b;
        double r2172663 = x;
        double r2172664 = y;
        double r2172665 = t;
        double r2172666 = z;
        double r2172667 = r2172665 * r2172666;
        double r2172668 = fma(r2172663, r2172664, r2172667);
        double r2172669 = fma(r2172661, r2172662, r2172668);
        double r2172670 = fma(r2172659, r2172660, r2172669);
        return r2172670;
}

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