Average Error: 0.0 → 0.0
Time: 2.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 r41526 = x;
        double r41527 = r41526 * r41526;
        double r41528 = 2.0;
        double r41529 = r41527 * r41528;
        double r41530 = 1.0;
        double r41531 = r41529 - r41530;
        return r41531;
}

double f(double x) {
        double r41532 = 2.0;
        double r41533 = x;
        double r41534 = r41533 * r41533;
        double r41535 = r41532 * r41534;
        double r41536 = 1.0;
        double r41537 = r41535 - r41536;
        return r41537;
}

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