Average Error: 15.9 → 0.0
Time: 20.3s
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 r25601817 = x;
        double r25601818 = 1.0;
        double r25601819 = r25601818 - r25601817;
        double r25601820 = y;
        double r25601821 = r25601818 - r25601820;
        double r25601822 = r25601819 * r25601821;
        double r25601823 = r25601817 + r25601822;
        return r25601823;
}

double f(double x, double y) {
        double r25601824 = 1.0;
        double r25601825 = y;
        double r25601826 = -r25601824;
        double r25601827 = r25601825 * r25601826;
        double r25601828 = x;
        double r25601829 = r25601828 * r25601825;
        double r25601830 = r25601827 + r25601829;
        double r25601831 = r25601824 + r25601830;
        return r25601831;
}

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