Average Error: 0.0 → 0.0
Time: 1.6s
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 r1893236 = x;
        double r1893237 = r1893236 * r1893236;
        double r1893238 = 2.0;
        double r1893239 = r1893237 * r1893238;
        double r1893240 = 1.0;
        double r1893241 = r1893239 - r1893240;
        return r1893241;
}

double f(double x) {
        double r1893242 = 2.0;
        double r1893243 = x;
        double r1893244 = r1893243 * r1893243;
        double r1893245 = r1893242 * r1893244;
        double r1893246 = 1.0;
        double r1893247 = r1893245 - r1893246;
        return r1893247;
}

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