Average Error: 0.0 → 0.0
Time: 12.5s
Precision: 64
\[\left(x \cdot x\right) \cdot 2 - 1\]
\[2 \cdot \left(x \cdot x\right) - 1\]
\left(x \cdot x\right) \cdot 2 - 1
2 \cdot \left(x \cdot x\right) - 1
double f(double x) {
        double r2110866 = x;
        double r2110867 = r2110866 * r2110866;
        double r2110868 = 2.0;
        double r2110869 = r2110867 * r2110868;
        double r2110870 = 1.0;
        double r2110871 = r2110869 - r2110870;
        return r2110871;
}

double f(double x) {
        double r2110872 = 2.0;
        double r2110873 = x;
        double r2110874 = r2110873 * r2110873;
        double r2110875 = r2110872 * r2110874;
        double r2110876 = 1.0;
        double r2110877 = r2110875 - r2110876;
        return r2110877;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x\right) \cdot 2 - 1\]
  2. Final simplification0.0

    \[\leadsto 2 \cdot \left(x \cdot x\right) - 1\]

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  (- (* (* x x) 2.0) 1.0))