Average Error: 16.3 → 0.0
Time: 5.7s
Precision: binary64
Cost: 448
\[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)\]

Alternatives

Alternative 1
Error0.0
Cost448
\[\left(1 - y\right) + y \cdot x\]
Alternative 2
Error10.0
Cost962
\[\begin{array}{l} \mathbf{if}\;x \leq -9.060048472116547 \cdot 10^{+111}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 2848842482.5862455:\\ \;\;\;\;1 - y\\ \mathbf{else}:\\ \;\;\;\;y \cdot x - y\\ \end{array}\]
Alternative 3
Error10.1
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -2.5045084233652242 \cdot 10^{+113} \lor \neg \left(x \leq 8.148364193971165 \cdot 10^{+17}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 - y\\ \end{array}\]
Alternative 4
Error18.1
Cost192
\[1 - y\]
Alternative 5
Error36.1
Cost64
\[1\]

Error

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_1746216.3

    \[\leadsto x + \left(1 - x\right) \cdot \color{blue}{\left(1 + \left(-y\right)\right)}\]
  4. Applied distribute-rgt-in_binary64_1741916.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_174018.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. Simplified0.0

    \[\leadsto \color{blue}{1 + y \cdot \left(x + -1\right)}\]
  8. 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))))