Average Error: 16.3 → 0.0
Time: 7.7s
Precision: binary64
\[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
\[1 + y \cdot \left(x + -1\right)\]
x + \left(1 - x\right) \cdot \left(1 - y\right)
1 + y \cdot \left(x + -1\right)
(FPCore (x y) :precision binary64 (+ x (* (- 1.0 x) (- 1.0 y))))
(FPCore (x y) :precision binary64 (+ 1.0 (* y (+ x -1.0))))
double code(double x, double y) {
	return x + ((1.0 - x) * (1.0 - y));
}
double code(double x, double y) {
	return 1.0 + (y * (x + -1.0));
}

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. Using strategy rm
  3. Applied sub-neg_binary64_1507516.3

    \[\leadsto x + \left(1 - x\right) \cdot \color{blue}{\left(1 + \left(-y\right)\right)}\]
  4. Applied distribute-rgt-in_binary64_1503216.3

    \[\leadsto x + \color{blue}{\left(1 \cdot \left(1 - x\right) + \left(-y\right) \cdot \left(1 - x\right)\right)}\]
  5. Applied associate-+r+_binary64_150148.4

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

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.Vectors:renderPlotVectors from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- (* y x) (- y 1.0))

  (+ x (* (- 1.0 x) (- 1.0 y))))