Average Error: 0.0 → 0.0
Time: 8.1s
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 r2427557 = x;
        double r2427558 = r2427557 * r2427557;
        double r2427559 = 2.0;
        double r2427560 = r2427558 * r2427559;
        double r2427561 = 1.0;
        double r2427562 = r2427560 - r2427561;
        return r2427562;
}

double f(double x) {
        double r2427563 = 2.0;
        double r2427564 = x;
        double r2427565 = r2427564 * r2427564;
        double r2427566 = r2427563 * r2427565;
        double r2427567 = 1.0;
        double r2427568 = r2427566 - r2427567;
        return r2427568;
}

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