Average Error: 0.0 → 0.0
Time: 1.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 r48502 = x;
        double r48503 = r48502 * r48502;
        double r48504 = 2.0;
        double r48505 = r48503 * r48504;
        double r48506 = 1.0;
        double r48507 = r48505 - r48506;
        return r48507;
}

double f(double x) {
        double r48508 = 2.0;
        double r48509 = x;
        double r48510 = r48509 * r48509;
        double r48511 = r48508 * r48510;
        double r48512 = 1.0;
        double r48513 = r48511 - r48512;
        return r48513;
}

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