Average Error: 15.9 → 0.0
Time: 32.4s
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 r442457 = x;
        double r442458 = 1.0;
        double r442459 = r442458 - r442457;
        double r442460 = y;
        double r442461 = r442458 - r442460;
        double r442462 = r442459 * r442461;
        double r442463 = r442457 + r442462;
        return r442463;
}

double f(double x, double y) {
        double r442464 = 1.0;
        double r442465 = y;
        double r442466 = x;
        double r442467 = r442465 * r442466;
        double r442468 = -r442464;
        double r442469 = r442465 * r442468;
        double r442470 = r442467 + r442469;
        double r442471 = r442464 + r442470;
        return r442471;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.9
Target0.0
Herbie0.0
\[y \cdot x - \left(y - 1\right)\]

Derivation

  1. Initial program 15.9

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