Average Error: 0.0 → 0.0
Time: 5.9s
Precision: 64
\[x \cdot \left(x - 1\right)\]
\[{x}^{2} + 1 \cdot \left(-x\right)\]
x \cdot \left(x - 1\right)
{x}^{2} + 1 \cdot \left(-x\right)
double f(double x) {
        double r290422 = x;
        double r290423 = 1.0;
        double r290424 = r290422 - r290423;
        double r290425 = r290422 * r290424;
        return r290425;
}

double f(double x) {
        double r290426 = x;
        double r290427 = 2.0;
        double r290428 = pow(r290426, r290427);
        double r290429 = 1.0;
        double r290430 = -r290426;
        double r290431 = r290429 * r290430;
        double r290432 = r290428 + r290431;
        return r290432;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x \cdot x - x\]

Derivation

  1. Initial program 0.0

    \[x \cdot \left(x - 1\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x \cdot \color{blue}{\left(x + \left(-1\right)\right)}\]
  4. Applied distribute-lft-in0.0

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

    \[\leadsto \color{blue}{{x}^{2}} + x \cdot \left(-1\right)\]
  6. Simplified0.0

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

    \[\leadsto {x}^{2} + 1 \cdot \left(-x\right)\]

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(FPCore (x)
  :name "Statistics.Correlation.Kendall:numOfTiesBy from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (- (* x x) x)

  (* x (- x 1)))