Average Error: 16.6 → 0.0
Time: 15.0s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(y \cdot x + y \cdot \left(-1\right)\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(y \cdot x + y \cdot \left(-1\right)\right)
double f(double x, double y) {
        double r102995539 = x;
        double r102995540 = 1.0;
        double r102995541 = r102995540 - r102995539;
        double r102995542 = y;
        double r102995543 = r102995540 - r102995542;
        double r102995544 = r102995541 * r102995543;
        double r102995545 = r102995539 + r102995544;
        return r102995545;
}

double f(double x, double y) {
        double r102995546 = 1.0;
        double r102995547 = y;
        double r102995548 = x;
        double r102995549 = r102995547 * r102995548;
        double r102995550 = -r102995546;
        double r102995551 = r102995547 * r102995550;
        double r102995552 = r102995549 + r102995551;
        double r102995553 = r102995546 + r102995552;
        return r102995553;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.6
Target0.0
Herbie0.0
\[y \cdot x - \left(y - 1\right)\]

Derivation

  1. Initial program 16.6

    \[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
  2. Taylor expanded around 0 0.0

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

    \[\leadsto \color{blue}{1 + y \cdot \left(x - 1\right)}\]
  4. Using strategy rm
  5. Applied sub-neg0.0

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

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

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

Reproduce

herbie shell --seed 2019173 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.Vectors:renderPlotVectors from Chart-1.5.3"

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

  (+ x (* (- 1.0 x) (- 1.0 y))))