Average Error: 15.9 → 0.0
Time: 10.7s
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 r22688915 = x;
        double r22688916 = 1.0;
        double r22688917 = r22688916 - r22688915;
        double r22688918 = y;
        double r22688919 = r22688916 - r22688918;
        double r22688920 = r22688917 * r22688919;
        double r22688921 = r22688915 + r22688920;
        return r22688921;
}

double f(double x, double y) {
        double r22688922 = 1.0;
        double r22688923 = y;
        double r22688924 = -r22688922;
        double r22688925 = r22688923 * r22688924;
        double r22688926 = x;
        double r22688927 = r22688926 * r22688923;
        double r22688928 = r22688925 + r22688927;
        double r22688929 = r22688922 + r22688928;
        return r22688929;
}

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))))