Average Error: 0.0 → 0.0
Time: 4.7s
Precision: 64
\[x \cdot \left(x - 1.0\right)\]
\[x \cdot x - x \cdot 1.0\]
x \cdot \left(x - 1.0\right)
x \cdot x - x \cdot 1.0
double f(double x) {
        double r16525571 = x;
        double r16525572 = 1.0;
        double r16525573 = r16525571 - r16525572;
        double r16525574 = r16525571 * r16525573;
        return r16525574;
}

double f(double x) {
        double r16525575 = x;
        double r16525576 = r16525575 * r16525575;
        double r16525577 = 1.0;
        double r16525578 = r16525575 * r16525577;
        double r16525579 = r16525576 - r16525578;
        return r16525579;
}

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.0\right)\]
  2. Taylor expanded around 0 0.0

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

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

    \[\leadsto x \cdot x - x \cdot 1.0\]

Reproduce

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

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

  (* x (- x 1.0)))