Average Error: 0.0 → 0.0
Time: 4.0s
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 r650719 = x;
        double r650720 = r650719 * r650719;
        double r650721 = 2.0;
        double r650722 = r650720 * r650721;
        double r650723 = 1.0;
        double r650724 = r650722 - r650723;
        return r650724;
}

double f(double x) {
        double r650725 = 2.0;
        double r650726 = x;
        double r650727 = r650726 * r650726;
        double r650728 = r650725 * r650727;
        double r650729 = 1.0;
        double r650730 = r650728 - r650729;
        return r650730;
}

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