Average Error: 0.0 → 0.0
Time: 1.8s
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 r1741573 = x;
        double r1741574 = r1741573 * r1741573;
        double r1741575 = 2.0;
        double r1741576 = r1741574 * r1741575;
        double r1741577 = 1.0;
        double r1741578 = r1741576 - r1741577;
        return r1741578;
}

double f(double x) {
        double r1741579 = 2.0;
        double r1741580 = x;
        double r1741581 = r1741580 * r1741580;
        double r1741582 = r1741579 * r1741581;
        double r1741583 = 1.0;
        double r1741584 = r1741582 - r1741583;
        return r1741584;
}

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