Average Error: 0.0 → 0.0
Time: 24.8min
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
Error15.9
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -5.4283417043510584 \cdot 10^{-15} \lor \neg \left(x \leq 3.7476872875962806 \cdot 10^{-10}\right):\\ \;\;\;\;\frac{x}{1 - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{y + -1}\\ \end{array}\]
Alternative 3
Error16.0
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -37137942247331.36:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1439687.566772544:\\ \;\;\;\;\frac{x}{1 - y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 4
Error16.5
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -0.3120786135764127:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.0198125341557973:\\ \;\;\;\;x + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 5
Error16.7
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -0.7010450088530445:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.0198125341557973:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 6
Error39.1
Cost64
\[1\]

Error

Time

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{1 - y}\]
  2. Using strategy rm
  3. Applied div-sub_binary64_99720.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 2021040 
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, C"
  :precision binary64
  (/ (- x y) (- 1.0 y)))