Average Error: 16.2 → 0.0
Time: 6.9s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(x - 1\right) \cdot y\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(x - 1\right) \cdot y
double f(double x, double y) {
        double r354424 = x;
        double r354425 = 1.0;
        double r354426 = r354425 - r354424;
        double r354427 = y;
        double r354428 = r354425 - r354427;
        double r354429 = r354426 * r354428;
        double r354430 = r354424 + r354429;
        return r354430;
}

double f(double x, double y) {
        double r354431 = 1.0;
        double r354432 = x;
        double r354433 = r354432 - r354431;
        double r354434 = y;
        double r354435 = r354433 * r354434;
        double r354436 = r354431 + r354435;
        return r354436;
}

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

Derivation

  1. Initial program 16.2

    \[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
  2. Simplified16.2

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

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

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

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

Reproduce

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