Average Error: 16.4 → 0.0
Time: 8.4s
Precision: 64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + \left(x \cdot y + y \cdot \left(-1\right)\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + \left(x \cdot y + y \cdot \left(-1\right)\right)
double f(double x, double y) {
        double r27262870 = x;
        double r27262871 = 1.0;
        double r27262872 = r27262871 - r27262870;
        double r27262873 = y;
        double r27262874 = r27262871 - r27262873;
        double r27262875 = r27262872 * r27262874;
        double r27262876 = r27262870 + r27262875;
        return r27262876;
}

double f(double x, double y) {
        double r27262877 = 1.0;
        double r27262878 = x;
        double r27262879 = y;
        double r27262880 = r27262878 * r27262879;
        double r27262881 = -r27262877;
        double r27262882 = r27262879 * r27262881;
        double r27262883 = r27262880 + r27262882;
        double r27262884 = r27262877 + r27262883;
        return r27262884;
}

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

Derivation

  1. Initial program 16.4

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

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

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

Reproduce

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