Average Error: 0.0 → 0.0
Time: 2.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 r2400486 = x;
        double r2400487 = r2400486 * r2400486;
        double r2400488 = 2.0;
        double r2400489 = r2400487 * r2400488;
        double r2400490 = 1.0;
        double r2400491 = r2400489 - r2400490;
        return r2400491;
}

double f(double x) {
        double r2400492 = 2.0;
        double r2400493 = x;
        double r2400494 = r2400493 * r2400493;
        double r2400495 = r2400492 * r2400494;
        double r2400496 = 1.0;
        double r2400497 = r2400495 - r2400496;
        return r2400497;
}

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