Average Error: 16.3 → 0.0
Time: 6.7s
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 r12311708 = x;
        double r12311709 = 1.0;
        double r12311710 = r12311709 - r12311708;
        double r12311711 = y;
        double r12311712 = r12311709 - r12311711;
        double r12311713 = r12311710 * r12311712;
        double r12311714 = r12311708 + r12311713;
        return r12311714;
}

double f(double x, double y) {
        double r12311715 = 1.0;
        double r12311716 = x;
        double r12311717 = r12311716 - r12311715;
        double r12311718 = y;
        double r12311719 = r12311717 * r12311718;
        double r12311720 = r12311715 + r12311719;
        return r12311720;
}

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