Average Error: 16.2 → 0.0
Time: 10.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 r30009184 = x;
        double r30009185 = 1.0;
        double r30009186 = r30009185 - r30009184;
        double r30009187 = y;
        double r30009188 = r30009185 - r30009187;
        double r30009189 = r30009186 * r30009188;
        double r30009190 = r30009184 + r30009189;
        return r30009190;
}

double f(double x, double y) {
        double r30009191 = 1.0;
        double r30009192 = x;
        double r30009193 = r30009192 - r30009191;
        double r30009194 = y;
        double r30009195 = r30009193 * r30009194;
        double r30009196 = r30009191 + r30009195;
        return r30009196;
}

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. 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. 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))))