Average Error: 0.0 → 0.0
Time: 12.9s
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(z, t, y \cdot x\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(z, t, y \cdot x\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4009017 = x;
        double r4009018 = y;
        double r4009019 = r4009017 * r4009018;
        double r4009020 = z;
        double r4009021 = t;
        double r4009022 = r4009020 * r4009021;
        double r4009023 = r4009019 + r4009022;
        double r4009024 = a;
        double r4009025 = b;
        double r4009026 = r4009024 * r4009025;
        double r4009027 = r4009023 + r4009026;
        double r4009028 = c;
        double r4009029 = i;
        double r4009030 = r4009028 * r4009029;
        double r4009031 = r4009027 + r4009030;
        return r4009031;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4009032 = i;
        double r4009033 = c;
        double r4009034 = a;
        double r4009035 = b;
        double r4009036 = z;
        double r4009037 = t;
        double r4009038 = y;
        double r4009039 = x;
        double r4009040 = r4009038 * r4009039;
        double r4009041 = fma(r4009036, r4009037, r4009040);
        double r4009042 = fma(r4009034, r4009035, r4009041);
        double r4009043 = fma(r4009032, r4009033, r4009042);
        return r4009043;
}

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

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

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

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

Reproduce

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