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 r37010 = x;
        double r37011 = r37010 * r37010;
        double r37012 = 2.0;
        double r37013 = r37011 * r37012;
        double r37014 = 1.0;
        double r37015 = r37013 - r37014;
        return r37015;
}

double f(double x) {
        double r37016 = 2.0;
        double r37017 = x;
        double r37018 = r37017 * r37017;
        double r37019 = r37016 * r37018;
        double r37020 = 1.0;
        double r37021 = r37019 - r37020;
        return r37021;
}

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