Average Error: 0.0 → 0.0
Time: 5.2s
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 r805768 = x;
        double r805769 = r805768 * r805768;
        double r805770 = 2.0;
        double r805771 = r805769 * r805770;
        double r805772 = 1.0;
        double r805773 = r805771 - r805772;
        return r805773;
}

double f(double x) {
        double r805774 = 2.0;
        double r805775 = x;
        double r805776 = r805775 * r805775;
        double r805777 = r805774 * r805776;
        double r805778 = 1.0;
        double r805779 = r805777 - r805778;
        return r805779;
}

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