Average Error: 15.9 → 0.0
Time: 9.8s
Precision: 64
\[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
\[1.0 + \left(y \cdot \left(-1.0\right) + x \cdot y\right)\]
x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)
1.0 + \left(y \cdot \left(-1.0\right) + x \cdot y\right)
double f(double x, double y) {
        double r30190763 = x;
        double r30190764 = 1.0;
        double r30190765 = r30190764 - r30190763;
        double r30190766 = y;
        double r30190767 = r30190764 - r30190766;
        double r30190768 = r30190765 * r30190767;
        double r30190769 = r30190763 + r30190768;
        return r30190769;
}

double f(double x, double y) {
        double r30190770 = 1.0;
        double r30190771 = y;
        double r30190772 = -r30190770;
        double r30190773 = r30190771 * r30190772;
        double r30190774 = x;
        double r30190775 = r30190774 * r30190771;
        double r30190776 = r30190773 + r30190775;
        double r30190777 = r30190770 + r30190776;
        return r30190777;
}

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

Derivation

  1. Initial program 15.9

    \[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
  2. Taylor expanded around 0 0.0

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

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

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

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

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

Reproduce

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