Average Error: 0.0 → 0.0
Time: 6.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 r2323342 = x;
        double r2323343 = r2323342 * r2323342;
        double r2323344 = 2.0;
        double r2323345 = r2323343 * r2323344;
        double r2323346 = 1.0;
        double r2323347 = r2323345 - r2323346;
        return r2323347;
}

double f(double x) {
        double r2323348 = 2.0;
        double r2323349 = x;
        double r2323350 = r2323349 * r2323349;
        double r2323351 = r2323348 * r2323350;
        double r2323352 = 1.0;
        double r2323353 = r2323351 - r2323352;
        return r2323353;
}

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