Average Error: 16.5 → 0.0
Time: 4.9s
Precision: 64
\[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
\[1.0 + \left(\left(-1.0\right) \cdot y + y \cdot x\right)\]
x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)
1.0 + \left(\left(-1.0\right) \cdot y + y \cdot x\right)
double f(double x, double y) {
        double r11495605 = x;
        double r11495606 = 1.0;
        double r11495607 = r11495606 - r11495605;
        double r11495608 = y;
        double r11495609 = r11495606 - r11495608;
        double r11495610 = r11495607 * r11495609;
        double r11495611 = r11495605 + r11495610;
        return r11495611;
}

double f(double x, double y) {
        double r11495612 = 1.0;
        double r11495613 = -r11495612;
        double r11495614 = y;
        double r11495615 = r11495613 * r11495614;
        double r11495616 = x;
        double r11495617 = r11495614 * r11495616;
        double r11495618 = r11495615 + r11495617;
        double r11495619 = r11495612 + r11495618;
        return r11495619;
}

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.5
Target0.0
Herbie0.0
\[y \cdot x - \left(y - 1.0\right)\]

Derivation

  1. Initial program 16.5

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019156 
(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))))