Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[\left(x \cdot x\right) \cdot 2.0 - 1.0\]
\[2.0 \cdot \left(x \cdot x\right) - 1.0\]
\left(x \cdot x\right) \cdot 2.0 - 1.0
2.0 \cdot \left(x \cdot x\right) - 1.0
double f(double x) {
        double r2626738 = x;
        double r2626739 = r2626738 * r2626738;
        double r2626740 = 2.0;
        double r2626741 = r2626739 * r2626740;
        double r2626742 = 1.0;
        double r2626743 = r2626741 - r2626742;
        return r2626743;
}

double f(double x) {
        double r2626744 = 2.0;
        double r2626745 = x;
        double r2626746 = r2626745 * r2626745;
        double r2626747 = r2626744 * r2626746;
        double r2626748 = 1.0;
        double r2626749 = r2626747 - r2626748;
        return r2626749;
}

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.0 - 1.0\]
  2. Final simplification0.0

    \[\leadsto 2.0 \cdot \left(x \cdot x\right) - 1.0\]

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:logGammaCorrection from math-functions-0.1.5.2"
  (- (* (* x x) 2.0) 1.0))