Average Error: 16.8 → 0.0
Time: 14.5s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 \cdot \left(-y\right) + \left(y \cdot x + 1\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 \cdot \left(-y\right) + \left(y \cdot x + 1\right)
double f(double x, double y) {
        double r30109528 = x;
        double r30109529 = 1.0;
        double r30109530 = r30109529 - r30109528;
        double r30109531 = y;
        double r30109532 = r30109529 - r30109531;
        double r30109533 = r30109530 * r30109532;
        double r30109534 = r30109528 + r30109533;
        return r30109534;
}

double f(double x, double y) {
        double r30109535 = 1.0;
        double r30109536 = y;
        double r30109537 = -r30109536;
        double r30109538 = r30109535 * r30109537;
        double r30109539 = x;
        double r30109540 = r30109536 * r30109539;
        double r30109541 = r30109540 + r30109535;
        double r30109542 = r30109538 + r30109541;
        return r30109542;
}

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

Derivation

  1. Initial program 16.8

    \[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-rgt-in0.0

    \[\leadsto 1 + \color{blue}{\left(x \cdot y + \left(-1\right) \cdot y\right)}\]
  7. Applied associate-+r+0.0

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

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

Reproduce

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