Average Error: 0.0 → 0.0
Time: 1.2s
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 r37901 = x;
        double r37902 = r37901 * r37901;
        double r37903 = 2.0;
        double r37904 = r37902 * r37903;
        double r37905 = 1.0;
        double r37906 = r37904 - r37905;
        return r37906;
}

double f(double x) {
        double r37907 = x;
        double r37908 = r37907 * r37907;
        double r37909 = 2.0;
        double r37910 = r37908 * r37909;
        double r37911 = 1.0;
        double r37912 = r37910 - r37911;
        return r37912;
}

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 2020057 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  :precision binary64
  (- (* (* x x) 2) 1))