Average Error: 0.0 → 0.0
Time: 7.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 r2729174 = x;
        double r2729175 = r2729174 * r2729174;
        double r2729176 = 2.0;
        double r2729177 = r2729175 * r2729176;
        double r2729178 = 1.0;
        double r2729179 = r2729177 - r2729178;
        return r2729179;
}

double f(double x) {
        double r2729180 = 2.0;
        double r2729181 = x;
        double r2729182 = r2729181 * r2729181;
        double r2729183 = r2729180 * r2729182;
        double r2729184 = 1.0;
        double r2729185 = r2729183 - r2729184;
        return r2729185;
}

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