Average Error: 16.4 → 0.0
Time: 6.7s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(x \cdot y + y \cdot \left(-1\right)\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(x \cdot y + y \cdot \left(-1\right)\right)
double f(double x, double y) {
        double r25778173 = x;
        double r25778174 = 1.0;
        double r25778175 = r25778174 - r25778173;
        double r25778176 = y;
        double r25778177 = r25778174 - r25778176;
        double r25778178 = r25778175 * r25778177;
        double r25778179 = r25778173 + r25778178;
        return r25778179;
}

double f(double x, double y) {
        double r25778180 = 1.0;
        double r25778181 = x;
        double r25778182 = y;
        double r25778183 = r25778181 * r25778182;
        double r25778184 = -r25778180;
        double r25778185 = r25778182 * r25778184;
        double r25778186 = r25778183 + r25778185;
        double r25778187 = r25778180 + r25778186;
        return r25778187;
}

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

Derivation

  1. Initial program 16.4

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

Reproduce

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