Average Error: 16.5 → 0.0
Time: 9.5s
Precision: 64
\[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
\[1.0 + \left(y \cdot \left(-1.0\right) + x \cdot y\right)\]
x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)
1.0 + \left(y \cdot \left(-1.0\right) + x \cdot y\right)
double f(double x, double y) {
        double r30318387 = x;
        double r30318388 = 1.0;
        double r30318389 = r30318388 - r30318387;
        double r30318390 = y;
        double r30318391 = r30318388 - r30318390;
        double r30318392 = r30318389 * r30318391;
        double r30318393 = r30318387 + r30318392;
        return r30318393;
}

double f(double x, double y) {
        double r30318394 = 1.0;
        double r30318395 = y;
        double r30318396 = -r30318394;
        double r30318397 = r30318395 * r30318396;
        double r30318398 = x;
        double r30318399 = r30318398 * r30318395;
        double r30318400 = r30318397 + r30318399;
        double r30318401 = r30318394 + r30318400;
        return r30318401;
}

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

Derivation

  1. Initial program 16.5

    \[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{\left(1.0 + x \cdot y\right) - 1.0 \cdot y}\]
  3. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - 1.0\right) + 1.0}\]
  4. Using strategy rm
  5. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-1.0\right)\right)} + 1.0\]
  6. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{\left(x \cdot y + \left(-1.0\right) \cdot y\right)} + 1.0\]
  7. Final simplification0.0

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

Reproduce

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