Average Error: 15.9 → 0.0
Time: 7.4s
Precision: 64
\[x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)\]
\[1.0 + \left(\left(-1.0\right) \cdot y + y \cdot x\right)\]
x + \left(1.0 - x\right) \cdot \left(1.0 - y\right)
1.0 + \left(\left(-1.0\right) \cdot y + y \cdot x\right)
double f(double x, double y) {
        double r30764043 = x;
        double r30764044 = 1.0;
        double r30764045 = r30764044 - r30764043;
        double r30764046 = y;
        double r30764047 = r30764044 - r30764046;
        double r30764048 = r30764045 * r30764047;
        double r30764049 = r30764043 + r30764048;
        return r30764049;
}

double f(double x, double y) {
        double r30764050 = 1.0;
        double r30764051 = -r30764050;
        double r30764052 = y;
        double r30764053 = r30764051 * r30764052;
        double r30764054 = x;
        double r30764055 = r30764052 * r30764054;
        double r30764056 = r30764053 + r30764055;
        double r30764057 = r30764050 + r30764056;
        return r30764057;
}

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

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

    \[\leadsto 1.0 + \left(\left(-1.0\right) \cdot y + y \cdot x\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))))