Average Error: 0.0 → 0.0
Time: 3.4min
Precision: binary64
Cost: 448
\[\left(x + y\right) - x \cdot y\]
\[x + y \cdot \left(1 - x\right)\]
\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));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.0
Cost448
\[\left(y + x\right) - y \cdot x\]
Alternative 2
Error1.0
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -593851404.9764618 \lor \neg \left(x \leq 0.9902767981226298\right):\\ \;\;\;\;x - y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array}\]
Alternative 3
Error11.3
Cost1540
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2676434465687404 \cdot 10^{+186}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -9.418554090792549 \cdot 10^{+61}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;x \leq 1771.0184468490431:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq 2.113375967930279 \cdot 10^{+66}:\\ \;\;\;\;-y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 4
Error9.4
Cost192
\[y + x\]
Alternative 5
Error18.2
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -1.9332129628652103 \cdot 10^{-48}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 6.405195131067386 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array}\]
Alternative 6
Error36.2
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) - x \cdot y\]
  2. Using strategy rm
  3. Applied associate--l+_binary64_105860.0

    \[\leadsto \color{blue}{x + \left(y - x \cdot y\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity_binary64_106490.0

    \[\leadsto x + \left(\color{blue}{1 \cdot y} - x \cdot y\right)\]
  6. Applied distribute-rgt-out--_binary64_106030.0

    \[\leadsto x + \color{blue}{y \cdot \left(1 - x\right)}\]
  7. Using strategy rm
  8. Applied +-commutative_binary64_105790.0

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

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

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

Reproduce

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