Average Error: 0.0 → 0.0
Time: 937.0ms
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 r41309 = x;
        double r41310 = r41309 * r41309;
        double r41311 = 2.0;
        double r41312 = r41310 * r41311;
        double r41313 = 1.0;
        double r41314 = r41312 - r41313;
        return r41314;
}

double f(double x) {
        double r41315 = 2.0;
        double r41316 = x;
        double r41317 = r41316 * r41316;
        double r41318 = r41315 * r41317;
        double r41319 = 1.0;
        double r41320 = r41318 - r41319;
        return r41320;
}

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. Simplified0.0

    \[\leadsto \color{blue}{2 \cdot \left(x \cdot x\right) - 1}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  (- (* (* x x) 2.0) 1.0))