Average Error: 0.0 → 0.0
Time: 1.8s
Precision: 64
\[\left(x \cdot x\right) \cdot 2 - 1\]
\[\left(x \cdot x\right) \cdot 2 - 1\]
\left(x \cdot x\right) \cdot 2 - 1
\left(x \cdot x\right) \cdot 2 - 1
double f(double x) {
        double r42011 = x;
        double r42012 = r42011 * r42011;
        double r42013 = 2.0;
        double r42014 = r42012 * r42013;
        double r42015 = 1.0;
        double r42016 = r42014 - r42015;
        return r42016;
}

double f(double x) {
        double r42017 = x;
        double r42018 = r42017 * r42017;
        double r42019 = 2.0;
        double r42020 = r42018 * r42019;
        double r42021 = 1.0;
        double r42022 = r42020 - r42021;
        return r42022;
}

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 \left(x \cdot x\right) \cdot 2 - 1\]

Reproduce

herbie shell --seed 2020047 
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  :precision binary64
  (- (* (* x x) 2) 1))