Average Error: 0.0 → 0.0
Time: 12.4s
Precision: 64
\[x \cdot x - x\]
\[x \cdot \left(x - 1\right)\]
x \cdot x - x
x \cdot \left(x - 1\right)
double f(double x) {
        double r3371163 = x;
        double r3371164 = r3371163 * r3371163;
        double r3371165 = r3371164 - r3371163;
        return r3371165;
}

double f(double x) {
        double r3371166 = x;
        double r3371167 = 1.0;
        double r3371168 = r3371166 - r3371167;
        double r3371169 = r3371166 * r3371168;
        return r3371169;
}

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

    \[x \cdot x - x\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto x \cdot x - \color{blue}{1 \cdot x}\]
  4. Applied distribute-rgt-out--0.0

    \[\leadsto \color{blue}{x \cdot \left(x - 1\right)}\]
  5. Final simplification0.0

    \[\leadsto x \cdot \left(x - 1\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "x * x - x"
  :precision binary64
  (- (* x x) x))