Average Error: 0.0 → 0.0
Time: 1.6s
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 r1438892 = x;
        double r1438893 = r1438892 * r1438892;
        double r1438894 = 2.0;
        double r1438895 = r1438893 * r1438894;
        double r1438896 = 1.0;
        double r1438897 = r1438895 - r1438896;
        return r1438897;
}

double f(double x) {
        double r1438898 = 2.0;
        double r1438899 = x;
        double r1438900 = r1438899 * r1438899;
        double r1438901 = r1438898 * r1438900;
        double r1438902 = 1.0;
        double r1438903 = r1438901 - r1438902;
        return r1438903;
}

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