Average Error: 26.8 → 0.8
Time: 11.9s
Precision: 64
$\sin \left(x + 1\right) - \cos \left(x + 1\right)$
$\left(\left(\sin x \cdot \cos 1 + \sin 1 \cdot \cos x\right) - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1$
\sin \left(x + 1\right) - \cos \left(x + 1\right)
\left(\left(\sin x \cdot \cos 1 + \sin 1 \cdot \cos x\right) - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1
double f(double x) {
double r1690450 = x;
double r1690451 = 1.0;
double r1690452 = r1690450 + r1690451;
double r1690453 = sin(r1690452);
double r1690454 = cos(r1690452);
double r1690455 = r1690453 - r1690454;
return r1690455;
}


double f(double x) {
double r1690456 = x;
double r1690457 = sin(r1690456);
double r1690458 = 1.0;
double r1690459 = cos(r1690458);
double r1690460 = r1690457 * r1690459;
double r1690461 = sin(r1690458);
double r1690462 = cos(r1690456);
double r1690463 = r1690461 * r1690462;
double r1690464 = r1690460 + r1690463;
double r1690465 = r1690462 * r1690459;
double r1690466 = r1690464 - r1690465;
double r1690467 = r1690457 * r1690461;
double r1690468 = r1690466 + r1690467;
return r1690468;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 26.8

$\sin \left(x + 1\right) - \cos \left(x + 1\right)$
2. Using strategy rm
3. Applied cos-sum25.9

$\leadsto \sin \left(x + 1\right) - \color{blue}{\left(\cos x \cdot \cos 1 - \sin x \cdot \sin 1\right)}$
4. Applied associate--r-25.9

$\leadsto \color{blue}{\left(\sin \left(x + 1\right) - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1}$
5. Using strategy rm
6. Applied sin-sum0.8

$\leadsto \left(\color{blue}{\left(\sin x \cdot \cos 1 + \cos x \cdot \sin 1\right)} - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1$
7. Simplified0.8

$\leadsto \left(\left(\sin x \cdot \cos 1 + \color{blue}{\sin 1 \cdot \cos x}\right) - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1$
8. Final simplification0.8

$\leadsto \left(\left(\sin x \cdot \cos 1 + \sin 1 \cdot \cos x\right) - \cos x \cdot \cos 1\right) + \sin x \cdot \sin 1$

# Reproduce

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