Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[\left(x \cdot x\right) \cdot 2 - 1\]
\[\left(x \cdot x\right) \cdot 2 - 1\]
\left(x \cdot x\right) \cdot 2 - 1
\left(x \cdot x\right) \cdot 2 - 1
double f(double x) {
        double r42470 = x;
        double r42471 = r42470 * r42470;
        double r42472 = 2.0;
        double r42473 = r42471 * r42472;
        double r42474 = 1.0;
        double r42475 = r42473 - r42474;
        return r42475;
}

double f(double x) {
        double r42476 = x;
        double r42477 = r42476 * r42476;
        double r42478 = 2.0;
        double r42479 = r42477 * r42478;
        double r42480 = 1.0;
        double r42481 = r42479 - r42480;
        return r42481;
}

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 \left(x \cdot x\right) \cdot 2 - 1\]

Reproduce

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