\left(x + y\right) - x \cdot y
x + y \cdot \left(1 - x\right)
(FPCore (x y) :precision binary64 (- (+ x y) (* x y)))
(FPCore (x y) :precision binary64 (+ x (* y (- 1.0 x))))
double code(double x, double y) {
return (x + y) - (x * y);
}
double code(double x, double y) {
return x + (y * (1.0 - x));
}









Bits error versus x









Bits error versus y
Results
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 448 |
| Alternative 2 | |
|---|---|
| Error | 1.0 |
| Cost | 648 |
| Alternative 3 | |
|---|---|
| Error | 11.3 |
| Cost | 1540 |
| Alternative 4 | |
|---|---|
| Error | 9.4 |
| Cost | 192 |
| Alternative 5 | |
|---|---|
| Error | 18.2 |
| Cost | 706 |
| Alternative 6 | |
|---|---|
| Error | 36.2 |
| Cost | 64 |


Initial program 0.0
rmApplied associate--l+_binary64_105860.0
rmApplied *-un-lft-identity_binary64_106490.0
Applied distribute-rgt-out--_binary64_106030.0
rmApplied +-commutative_binary64_105790.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021040
(FPCore (x y)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A"
:precision binary64
(- (+ x y) (* x y)))