Average Error: 0.2 → 0.2
Time: 8.6s
Precision: 64
$\left(x \cdot \sin x\right) \cdot \cos x$
$x \cdot \frac{\sin \left(x + x\right)}{2}$
\left(x \cdot \sin x\right) \cdot \cos x
x \cdot \frac{\sin \left(x + x\right)}{2}
double f(double x) {
double r1198226 = x;
double r1198227 = sin(r1198226);
double r1198228 = r1198226 * r1198227;
double r1198229 = cos(r1198226);
double r1198230 = r1198228 * r1198229;
return r1198230;
}


double f(double x) {
double r1198231 = x;
double r1198232 = r1198231 + r1198231;
double r1198233 = sin(r1198232);
double r1198234 = 2.0;
double r1198235 = r1198233 / r1198234;
double r1198236 = r1198231 * r1198235;
return r1198236;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.2

$\left(x \cdot \sin x\right) \cdot \cos x$
2. Using strategy rm
3. Applied associate-*l*0.2

$\leadsto \color{blue}{x \cdot \left(\sin x \cdot \cos x\right)}$
4. Using strategy rm
5. Applied sin-cos-mult0.2

$\leadsto x \cdot \color{blue}{\frac{\sin \left(x - x\right) + \sin \left(x + x\right)}{2}}$
6. Simplified0.2

$\leadsto x \cdot \frac{\color{blue}{\sin \left(x + x\right)}}{2}$
7. Final simplification0.2

$\leadsto x \cdot \frac{\sin \left(x + x\right)}{2}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "x*sin(x)*cos(x)"
:precision binary64
(* (* x (sin x)) (cos x)))