Average Error: 0.0 → 0.0
Time: 5.4s
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 r2219297 = x;
        double r2219298 = r2219297 * r2219297;
        double r2219299 = 2.0;
        double r2219300 = r2219298 * r2219299;
        double r2219301 = 1.0;
        double r2219302 = r2219300 - r2219301;
        return r2219302;
}

double f(double x) {
        double r2219303 = 2.0;
        double r2219304 = x;
        double r2219305 = r2219304 * r2219304;
        double r2219306 = r2219303 * r2219305;
        double r2219307 = 1.0;
        double r2219308 = r2219306 - r2219307;
        return r2219308;
}

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