Average Error: 0.0 → 0.0
Time: 2.9s
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 r35090 = x;
        double r35091 = r35090 * r35090;
        double r35092 = 2.0;
        double r35093 = r35091 * r35092;
        double r35094 = 1.0;
        double r35095 = r35093 - r35094;
        return r35095;
}

double f(double x) {
        double r35096 = x;
        double r35097 = r35096 * r35096;
        double r35098 = 2.0;
        double r35099 = r35097 * r35098;
        double r35100 = 1.0;
        double r35101 = r35099 - r35100;
        return r35101;
}

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