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

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\right)\]

Derivation

  1. Initial program 15.9

    \[x + \left(1 - x\right) \cdot \left(1 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg_binary6415.9

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

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

    \[\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. Using strategy rm
  8. Applied distribute-lft-neg-out_binary640.0

    \[\leadsto 1 + \color{blue}{\left(-y \cdot \left(1 - x\right)\right)}\]
  9. Applied unsub-neg_binary640.0

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

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

Reproduce

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