Average Error: 0.0 → 0.0
Time: 6.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(b, a, \mathsf{fma}\left(x, y, z \cdot t\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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r98015 = x;
        double r98016 = y;
        double r98017 = r98015 * r98016;
        double r98018 = z;
        double r98019 = t;
        double r98020 = r98018 * r98019;
        double r98021 = r98017 + r98020;
        double r98022 = a;
        double r98023 = b;
        double r98024 = r98022 * r98023;
        double r98025 = r98021 + r98024;
        double r98026 = c;
        double r98027 = i;
        double r98028 = r98026 * r98027;
        double r98029 = r98025 + r98028;
        return r98029;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r98030 = i;
        double r98031 = c;
        double r98032 = b;
        double r98033 = a;
        double r98034 = x;
        double r98035 = y;
        double r98036 = z;
        double r98037 = t;
        double r98038 = r98036 * r98037;
        double r98039 = fma(r98034, r98035, r98038);
        double r98040 = fma(r98032, r98033, r98039);
        double r98041 = fma(r98030, r98031, r98040);
        return r98041;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))