Average Error: 16.6 → 0.0
Time: 32.0s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(y \cdot x + y \cdot \left(-1\right)\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(y \cdot x + y \cdot \left(-1\right)\right)
double f(double x, double y) {
        double r397236 = x;
        double r397237 = 1.0;
        double r397238 = r397237 - r397236;
        double r397239 = y;
        double r397240 = r397237 - r397239;
        double r397241 = r397238 * r397240;
        double r397242 = r397236 + r397241;
        return r397242;
}

double f(double x, double y) {
        double r397243 = 1.0;
        double r397244 = y;
        double r397245 = x;
        double r397246 = r397244 * r397245;
        double r397247 = -r397243;
        double r397248 = r397244 * r397247;
        double r397249 = r397246 + r397248;
        double r397250 = r397243 + r397249;
        return r397250;
}

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. Final simplification0.0

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

Reproduce

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