Average Error: 0.0 → 0.0
Time: 2.5s
Precision: binary64
Cost: 704
\[\frac{x - y}{1 - y}\]
\[\frac{x}{1 - y} - \frac{y}{1 - y}\]
\frac{x - y}{1 - y}
\frac{x}{1 - y} - \frac{y}{1 - y}
(FPCore (x y) :precision binary64 (/ (- x y) (- 1.0 y)))
(FPCore (x y) :precision binary64 (- (/ x (- 1.0 y)) (/ y (- 1.0 y))))
double code(double x, double y) {
	return (x - y) / (1.0 - y);
}
double code(double x, double y) {
	return (x / (1.0 - y)) - (y / (1.0 - y));
}

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
\[\frac{x - y}{1 - y}\]
Alternative 2
Error8.3
Cost776
\[\begin{array}{l} \mathbf{if}\;y \leq -0.7197002377700772 \lor \neg \left(y \leq 0.00011239463762152483\right):\\ \;\;\;\;-\frac{y}{1 - y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) + x \cdot y\\ \end{array}\]
Alternative 3
Error16.3
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -3.791459756246493 \cdot 10^{-35} \lor \neg \left(x \leq 8.876295488190439 \cdot 10^{-17}\right):\\ \;\;\;\;\frac{x}{1 - y}\\ \mathbf{else}:\\ \;\;\;\;-\frac{y}{1 - y}\\ \end{array}\]
Alternative 4
Error15.7
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -130185927675782.77:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 22670298815293596:\\ \;\;\;\;\frac{x}{1 - y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 5
Error16.2
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -0.8023789687315643:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.0025539630758997:\\ \;\;\;\;x + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 6
Error16.4
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -9.940976798148478:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.0025539630758997:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 7
Error38.5
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{1 - y}\]
  2. Using strategy rm
  3. Applied div-sub_binary64_51980.0

    \[\leadsto \color{blue}{\frac{x}{1 - y} - \frac{y}{1 - y}}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\frac{x}{1 - y} - \frac{y}{1 - y}}\]
  5. Final simplification0.0

    \[\leadsto \frac{x}{1 - y} - \frac{y}{1 - y}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, C"
  :precision binary64
  (/ (- x y) (- 1.0 y)))