Average Error: 0.0 → 0.0
Time: 845.0ms
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 r26607 = x;
        double r26608 = r26607 * r26607;
        double r26609 = 2.0;
        double r26610 = r26608 * r26609;
        double r26611 = 1.0;
        double r26612 = r26610 - r26611;
        return r26612;
}

double f(double x) {
        double r26613 = 2.0;
        double r26614 = x;
        double r26615 = r26614 * r26614;
        double r26616 = r26613 * r26615;
        double r26617 = 1.0;
        double r26618 = r26616 - r26617;
        return r26618;
}

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