Average Error: 16.6 → 0.0
Time: 17.0s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(x \cdot y + \left(-1\right) \cdot y\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(x \cdot y + \left(-1\right) \cdot y\right)
double f(double x, double y) {
        double r915422 = x;
        double r915423 = 1.0;
        double r915424 = r915423 - r915422;
        double r915425 = y;
        double r915426 = r915423 - r915425;
        double r915427 = r915424 * r915426;
        double r915428 = r915422 + r915427;
        return r915428;
}

double f(double x, double y) {
        double r915429 = 1.0;
        double r915430 = x;
        double r915431 = y;
        double r915432 = r915430 * r915431;
        double r915433 = -r915429;
        double r915434 = r915433 * r915431;
        double r915435 = r915432 + r915434;
        double r915436 = r915429 + r915435;
        return r915436;
}

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(x \cdot y + 1\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. Simplified0.0

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

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

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

Reproduce

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

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

  (+ x (* (- 1 x) (- 1 y))))