Average Error: 0.0 → 0.0
Time: 2.1s
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 r27420 = x;
        double r27421 = r27420 * r27420;
        double r27422 = 2.0;
        double r27423 = r27421 * r27422;
        double r27424 = 1.0;
        double r27425 = r27423 - r27424;
        return r27425;
}

double f(double x) {
        double r27426 = 2.0;
        double r27427 = x;
        double r27428 = r27427 * r27427;
        double r27429 = r27426 * r27428;
        double r27430 = 1.0;
        double r27431 = r27429 - r27430;
        return r27431;
}

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. Simplified0.0

    \[\leadsto \color{blue}{2 \cdot \left(x \cdot x\right) - 1}\]
  3. Final simplification0.0

    \[\leadsto 2 \cdot \left(x \cdot x\right) - 1\]

Reproduce

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