Average Error: 0.0 → 0.0
Time: 25.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(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 r169605 = x;
        double r169606 = y;
        double r169607 = r169605 * r169606;
        double r169608 = z;
        double r169609 = t;
        double r169610 = r169608 * r169609;
        double r169611 = r169607 + r169610;
        double r169612 = a;
        double r169613 = b;
        double r169614 = r169612 * r169613;
        double r169615 = r169611 + r169614;
        double r169616 = c;
        double r169617 = i;
        double r169618 = r169616 * r169617;
        double r169619 = r169615 + r169618;
        return r169619;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r169620 = i;
        double r169621 = c;
        double r169622 = a;
        double r169623 = b;
        double r169624 = x;
        double r169625 = y;
        double r169626 = t;
        double r169627 = z;
        double r169628 = r169626 * r169627;
        double r169629 = fma(r169624, r169625, r169628);
        double r169630 = fma(r169622, r169623, r169629);
        double r169631 = fma(r169620, r169621, r169630);
        return r169631;
}

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