Average Error: 16.7 → 0.0
Time: 8.7s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + y \cdot \left(x - 1\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + y \cdot \left(x - 1\right)
double f(double x, double y) {
        double r42709513 = x;
        double r42709514 = 1.0;
        double r42709515 = r42709514 - r42709513;
        double r42709516 = y;
        double r42709517 = r42709514 - r42709516;
        double r42709518 = r42709515 * r42709517;
        double r42709519 = r42709513 + r42709518;
        return r42709519;
}

double f(double x, double y) {
        double r42709520 = 1.0;
        double r42709521 = y;
        double r42709522 = x;
        double r42709523 = r42709522 - r42709520;
        double r42709524 = r42709521 * r42709523;
        double r42709525 = r42709520 + r42709524;
        return r42709525;
}

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

Derivation

  1. Initial program 16.7

    \[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 + y \cdot \left(x - 1\right)\]

Reproduce

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