Average Error: 16.3 → 0.0
Time: 9.3s
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 r457511 = x;
        double r457512 = 1.0;
        double r457513 = r457512 - r457511;
        double r457514 = y;
        double r457515 = r457512 - r457514;
        double r457516 = r457513 * r457515;
        double r457517 = r457511 + r457516;
        return r457517;
}

double f(double x, double y) {
        double r457518 = 1.0;
        double r457519 = x;
        double r457520 = r457519 - r457518;
        double r457521 = y;
        double r457522 = r457520 * r457521;
        double r457523 = r457518 + r457522;
        return r457523;
}

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

Derivation

  1. Initial program 16.3

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

    \[\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 2019194 
(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))))