Average Error: 0.0 → 0.0
Time: 13.4s
Precision: 64
\[x \cdot \left(x - 1\right)\]
\[x \cdot x - x \cdot 1\]
x \cdot \left(x - 1\right)
x \cdot x - x \cdot 1
double f(double x) {
        double r17123306 = x;
        double r17123307 = 1.0;
        double r17123308 = r17123306 - r17123307;
        double r17123309 = r17123306 * r17123308;
        return r17123309;
}

double f(double x) {
        double r17123310 = x;
        double r17123311 = r17123310 * r17123310;
        double r17123312 = 1.0;
        double r17123313 = r17123310 * r17123312;
        double r17123314 = r17123311 - r17123313;
        return r17123314;
}

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. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{{x}^{2} - 1 \cdot x}\]
  3. Simplified0.0

    \[\leadsto \color{blue}{x \cdot x - 1 \cdot x}\]
  4. Final simplification0.0

    \[\leadsto x \cdot x - x \cdot 1\]

Reproduce

herbie shell --seed 2019200 
(FPCore (x)
  :name "Statistics.Correlation.Kendall:numOfTiesBy from math-functions-0.1.5.2"

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

  (* x (- x 1.0)))