Average Error: 0.0 → 0.0
Time: 4.4s
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 r741603 = x;
        double r741604 = r741603 * r741603;
        double r741605 = 2.0;
        double r741606 = r741604 * r741605;
        double r741607 = 1.0;
        double r741608 = r741606 - r741607;
        return r741608;
}

double f(double x) {
        double r741609 = 2.0;
        double r741610 = x;
        double r741611 = r741610 * r741610;
        double r741612 = r741609 * r741611;
        double r741613 = 1.0;
        double r741614 = r741612 - r741613;
        return r741614;
}

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