Average Error: 16.3 → 0.0
Time: 13.3s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[\left(x - 1\right) \cdot y + 1\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
\left(x - 1\right) \cdot y + 1
double f(double x, double y) {
        double r31017919 = x;
        double r31017920 = 1.0;
        double r31017921 = r31017920 - r31017919;
        double r31017922 = y;
        double r31017923 = r31017920 - r31017922;
        double r31017924 = r31017921 * r31017923;
        double r31017925 = r31017919 + r31017924;
        return r31017925;
}

double f(double x, double y) {
        double r31017926 = x;
        double r31017927 = 1.0;
        double r31017928 = r31017926 - r31017927;
        double r31017929 = y;
        double r31017930 = r31017928 * r31017929;
        double r31017931 = r31017930 + r31017927;
        return r31017931;
}

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

Derivation

  1. Initial program 16.3

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

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

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

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

Reproduce

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