Average Error: 0.0 → 0.0
Time: 11.7s
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 r2644084 = x;
        double r2644085 = r2644084 * r2644084;
        double r2644086 = 2.0;
        double r2644087 = r2644085 * r2644086;
        double r2644088 = 1.0;
        double r2644089 = r2644087 - r2644088;
        return r2644089;
}

double f(double x) {
        double r2644090 = 2.0;
        double r2644091 = x;
        double r2644092 = r2644091 * r2644091;
        double r2644093 = r2644090 * r2644092;
        double r2644094 = 1.0;
        double r2644095 = r2644093 - r2644094;
        return r2644095;
}

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 2019192 
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  (- (* (* x x) 2.0) 1.0))