Average Error: 0.0 → 0.0
Time: 21.0s
Precision: 64
$\frac{x}{\frac{2 \cdot \left(y + 1\right)}{y - 1}}$
$\frac{y - 1}{y + 1} \cdot \frac{x}{2}$
\frac{x}{\frac{2 \cdot \left(y + 1\right)}{y - 1}}
\frac{y - 1}{y + 1} \cdot \frac{x}{2}
double f(double x, double y) {
double r9980468 = x;
double r9980469 = 2.0;
double r9980470 = y;
double r9980471 = 1.0;
double r9980472 = r9980470 + r9980471;
double r9980473 = r9980469 * r9980472;
double r9980474 = r9980470 - r9980471;
double r9980475 = r9980473 / r9980474;
double r9980476 = r9980468 / r9980475;
return r9980476;
}


double f(double x, double y) {
double r9980477 = y;
double r9980478 = 1.0;
double r9980479 = r9980477 - r9980478;
double r9980480 = r9980477 + r9980478;
double r9980481 = r9980479 / r9980480;
double r9980482 = x;
double r9980483 = 2.0;
double r9980484 = r9980482 / r9980483;
double r9980485 = r9980481 * r9980484;
return r9980485;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\frac{x}{\frac{2 \cdot \left(y + 1\right)}{y - 1}}$
2. Using strategy rm
3. Applied associate-/l*0.0

$\leadsto \frac{x}{\color{blue}{\frac{2}{\frac{y - 1}{y + 1}}}}$
4. Using strategy rm
5. Applied associate-/r/0.0

$\leadsto \color{blue}{\frac{x}{2} \cdot \frac{y - 1}{y + 1}}$
6. Final simplification0.0

$\leadsto \frac{y - 1}{y + 1} \cdot \frac{x}{2}$

# Reproduce

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