Average Error: 0.5 → 0.5
Time: 12.4s
Precision: 64
$\sin x \cdot \cos x + \sin x$
$e^{\log \left(\cos x + 1\right)} \cdot \sin x$
\sin x \cdot \cos x + \sin x
e^{\log \left(\cos x + 1\right)} \cdot \sin x
double f(double x) {
double r952470 = x;
double r952471 = sin(r952470);
double r952472 = cos(r952470);
double r952473 = r952471 * r952472;
double r952474 = r952473 + r952471;
return r952474;
}


double f(double x) {
double r952475 = x;
double r952476 = cos(r952475);
double r952477 = 1.0;
double r952478 = r952476 + r952477;
double r952479 = log(r952478);
double r952480 = exp(r952479);
double r952481 = sin(r952475);
double r952482 = r952480 * r952481;
return r952482;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.5

$\sin x \cdot \cos x + \sin x$
2. Simplified0.5

$\leadsto \color{blue}{\left(\cos x + 1\right) \cdot \sin x}$
3. Using strategy rm

$\leadsto \color{blue}{e^{\log \left(\cos x + 1\right)}} \cdot \sin x$
5. Final simplification0.5

$\leadsto e^{\log \left(\cos x + 1\right)} \cdot \sin x$

# Reproduce

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