Average Error: 0.0 → 0.0
Time: 12.9s
Precision: 64
$\frac{x}{x - y} + \frac{y}{x - y}$
$\frac{\frac{x}{x - y} \cdot \frac{x}{x - y} - \frac{y}{x - y} \cdot \frac{y}{x - y}}{\frac{x}{x - y} - \frac{y}{x - y}}$
\frac{x}{x - y} + \frac{y}{x - y}
\frac{\frac{x}{x - y} \cdot \frac{x}{x - y} - \frac{y}{x - y} \cdot \frac{y}{x - y}}{\frac{x}{x - y} - \frac{y}{x - y}}
double f(double x, double y) {
double r7832416 = x;
double r7832417 = y;
double r7832418 = r7832416 - r7832417;
double r7832419 = r7832416 / r7832418;
double r7832420 = r7832417 / r7832418;
double r7832421 = r7832419 + r7832420;
return r7832421;
}


double f(double x, double y) {
double r7832422 = x;
double r7832423 = y;
double r7832424 = r7832422 - r7832423;
double r7832425 = r7832422 / r7832424;
double r7832426 = r7832425 * r7832425;
double r7832427 = r7832423 / r7832424;
double r7832428 = r7832427 * r7832427;
double r7832429 = r7832426 - r7832428;
double r7832430 = r7832425 - r7832427;
double r7832431 = r7832429 / r7832430;
return r7832431;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\frac{x}{x - y} + \frac{y}{x - y}$
2. Using strategy rm
3. Applied flip-+0.0

$\leadsto \color{blue}{\frac{\frac{x}{x - y} \cdot \frac{x}{x - y} - \frac{y}{x - y} \cdot \frac{y}{x - y}}{\frac{x}{x - y} - \frac{y}{x - y}}}$
4. Final simplification0.0

$\leadsto \frac{\frac{x}{x - y} \cdot \frac{x}{x - y} - \frac{y}{x - y} \cdot \frac{y}{x - y}}{\frac{x}{x - y} - \frac{y}{x - y}}$

# Reproduce

herbie shell --seed 1
(FPCore (x y)
:name "x/(x-y)+y/(x-y)"
(+ (/ x (- x y)) (/ y (- x y))))