Average Error: 0.0 → 0.0
Time: 1.7s
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 r35841 = x;
        double r35842 = r35841 * r35841;
        double r35843 = 2.0;
        double r35844 = r35842 * r35843;
        double r35845 = 1.0;
        double r35846 = r35844 - r35845;
        return r35846;
}

double f(double x) {
        double r35847 = 2.0;
        double r35848 = x;
        double r35849 = r35848 * r35848;
        double r35850 = r35847 * r35849;
        double r35851 = 1.0;
        double r35852 = r35850 - r35851;
        return r35852;
}

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