Average Error: 16.1 → 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 r26179528 = x;
        double r26179529 = 1.0;
        double r26179530 = r26179529 - r26179528;
        double r26179531 = y;
        double r26179532 = r26179529 - r26179531;
        double r26179533 = r26179530 * r26179532;
        double r26179534 = r26179528 + r26179533;
        return r26179534;
}

double f(double x, double y) {
        double r26179535 = 1.0;
        double r26179536 = x;
        double r26179537 = r26179536 - r26179535;
        double r26179538 = y;
        double r26179539 = r26179537 * r26179538;
        double r26179540 = r26179535 + r26179539;
        return r26179540;
}

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

Derivation

  1. Initial program 16.1

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