Average Error: 16.2 → 0.0
Time: 7.2s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(x \cdot y + \left(-1 \cdot y\right)\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(x \cdot y + \left(-1 \cdot y\right)\right)
double f(double x, double y) {
        double r483091 = x;
        double r483092 = 1.0;
        double r483093 = r483092 - r483091;
        double r483094 = y;
        double r483095 = r483092 - r483094;
        double r483096 = r483093 * r483095;
        double r483097 = r483091 + r483096;
        return r483097;
}

double f(double x, double y) {
        double r483098 = 1.0;
        double r483099 = x;
        double r483100 = y;
        double r483101 = r483099 * r483100;
        double r483102 = r483098 * r483100;
        double r483103 = -r483102;
        double r483104 = r483101 + r483103;
        double r483105 = r483098 + r483104;
        return r483105;
}

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

Derivation

  1. Initial program 16.2

    \[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
  2. Simplified16.2

    \[\leadsto \color{blue}{\left(1 - y\right) \cdot \left(1 - x\right) + x}\]
  3. Taylor expanded around 0 0.0

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

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

    \[\leadsto 1 + y \cdot \color{blue}{\left(x + \left(-1\right)\right)}\]
  7. Applied distribute-lft-in0.0

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

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

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

Reproduce

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