Average Error: 0.0 → 0
Time: 2.6s
Precision: 64
\[\left(x \cdot x\right) \cdot 2 - 1\]
\[\mathsf{fma}\left(x, x \cdot 2, -1\right) + 0 \cdot 1\]
\left(x \cdot x\right) \cdot 2 - 1
\mathsf{fma}\left(x, x \cdot 2, -1\right) + 0 \cdot 1
double f(double x) {
        double r27177 = x;
        double r27178 = r27177 * r27177;
        double r27179 = 2.0;
        double r27180 = r27178 * r27179;
        double r27181 = 1.0;
        double r27182 = r27180 - r27181;
        return r27182;
}

double f(double x) {
        double r27183 = x;
        double r27184 = 2.0;
        double r27185 = r27183 * r27184;
        double r27186 = 1.0;
        double r27187 = -r27186;
        double r27188 = fma(r27183, r27185, r27187);
        double r27189 = 0.0;
        double r27190 = r27189 * r27186;
        double r27191 = r27188 + r27190;
        return r27191;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x\right) \cdot 2 - 1\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.0

    \[\leadsto \left(x \cdot x\right) \cdot 2 - \color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}\]
  4. Applied prod-diff0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot x, 2, -\sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{1}, \sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right)}\]
  5. Simplified0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, x \cdot 2, -1\right)} + \mathsf{fma}\left(-\sqrt[3]{1}, \sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right)\]
  6. Simplified0

    \[\leadsto \mathsf{fma}\left(x, x \cdot 2, -1\right) + \color{blue}{0 \cdot 1}\]
  7. Final simplification0

    \[\leadsto \mathsf{fma}\left(x, x \cdot 2, -1\right) + 0 \cdot 1\]

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  :precision binary64
  (- (* (* x x) 2) 1))