Average Error: 0.0 → 0.0
Time: 2.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 r2157096 = x;
        double r2157097 = r2157096 * r2157096;
        double r2157098 = 2.0;
        double r2157099 = r2157097 * r2157098;
        double r2157100 = 1.0;
        double r2157101 = r2157099 - r2157100;
        return r2157101;
}

double f(double x) {
        double r2157102 = 2.0;
        double r2157103 = x;
        double r2157104 = r2157103 * r2157103;
        double r2157105 = r2157102 * r2157104;
        double r2157106 = 1.0;
        double r2157107 = r2157105 - r2157106;
        return r2157107;
}

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))