Average Error: 0.0 → 0.0
Time: 2.7s
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 r2684469 = x;
        double r2684470 = r2684469 * r2684469;
        double r2684471 = 2.0;
        double r2684472 = r2684470 * r2684471;
        double r2684473 = 1.0;
        double r2684474 = r2684472 - r2684473;
        return r2684474;
}

double f(double x) {
        double r2684475 = 2.0;
        double r2684476 = x;
        double r2684477 = r2684476 * r2684476;
        double r2684478 = r2684475 * r2684477;
        double r2684479 = 1.0;
        double r2684480 = r2684478 - r2684479;
        return r2684480;
}

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))