Average Error: 14.8 → 0.3
Time: 16.0s
Precision: 64
$x \gt y$
$\frac{\sin x}{\sin \left(x - y\right)}$
$\frac{1}{\cos y - \frac{\sin y}{\sin x} \cdot \cos x}$
\frac{\sin x}{\sin \left(x - y\right)}
\frac{1}{\cos y - \frac{\sin y}{\sin x} \cdot \cos x}
double f(double x, double y) {
double r22334283 = x;
double r22334284 = sin(r22334283);
double r22334285 = y;
double r22334286 = r22334283 - r22334285;
double r22334287 = sin(r22334286);
double r22334288 = r22334284 / r22334287;
return r22334288;
}


double f(double x, double y) {
double r22334289 = 1.0;
double r22334290 = y;
double r22334291 = cos(r22334290);
double r22334292 = sin(r22334290);
double r22334293 = x;
double r22334294 = sin(r22334293);
double r22334295 = r22334292 / r22334294;
double r22334296 = cos(r22334293);
double r22334297 = r22334295 * r22334296;
double r22334298 = r22334291 - r22334297;
double r22334299 = r22334289 / r22334298;
return r22334299;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 14.8

$\frac{\sin x}{\sin \left(x - y\right)}$
2. Using strategy rm
3. Applied sin-diff0.2

$\leadsto \frac{\sin x}{\color{blue}{\sin x \cdot \cos y - \cos x \cdot \sin y}}$
4. Using strategy rm
5. Applied clear-num0.3

$\leadsto \color{blue}{\frac{1}{\frac{\sin x \cdot \cos y - \cos x \cdot \sin y}{\sin x}}}$
6. Simplified0.3

$\leadsto \frac{1}{\color{blue}{\cos y - \cos x \cdot \frac{\sin y}{\sin x}}}$
7. Final simplification0.3

$\leadsto \frac{1}{\cos y - \frac{\sin y}{\sin x} \cdot \cos x}$

# Reproduce

herbie shell --seed 1
(FPCore (x y)
:name "sin(x)/sin(x-y)"
:pre (> x y)
(/ (sin x) (sin (- x y))))