Average Error: 0.0 → 0.0
Time: 5.5s
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 r1942133 = x;
        double r1942134 = r1942133 * r1942133;
        double r1942135 = 2.0;
        double r1942136 = r1942134 * r1942135;
        double r1942137 = 1.0;
        double r1942138 = r1942136 - r1942137;
        return r1942138;
}

double f(double x) {
        double r1942139 = 2.0;
        double r1942140 = x;
        double r1942141 = r1942140 * r1942140;
        double r1942142 = r1942139 * r1942141;
        double r1942143 = 1.0;
        double r1942144 = r1942142 - r1942143;
        return r1942144;
}

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