Average Error: 16.5 → 0.0
Time: 16.8s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(\left(-1\right) \cdot y + y \cdot x\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(\left(-1\right) \cdot y + y \cdot x\right)
double f(double x, double y) {
        double r31854331 = x;
        double r31854332 = 1.0;
        double r31854333 = r31854332 - r31854331;
        double r31854334 = y;
        double r31854335 = r31854332 - r31854334;
        double r31854336 = r31854333 * r31854335;
        double r31854337 = r31854331 + r31854336;
        return r31854337;
}

double f(double x, double y) {
        double r31854338 = 1.0;
        double r31854339 = -r31854338;
        double r31854340 = y;
        double r31854341 = r31854339 * r31854340;
        double r31854342 = x;
        double r31854343 = r31854340 * r31854342;
        double r31854344 = r31854341 + r31854343;
        double r31854345 = r31854338 + r31854344;
        return r31854345;
}

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\right)\]

Derivation

  1. Initial program 16.5

    \[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}{y \cdot \left(x - 1\right) + 1}\]
  4. Using strategy rm
  5. Applied sub-neg0.0

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

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

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