Average Error: 30.1 → 0.6
Time: 17.0s
Precision: 64
$\cos \left(x + 1\right) - \cos x$
$\sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}$
\cos \left(x + 1\right) - \cos x
\sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}
double f(double x) {
double r58843379 = x;
double r58843380 = 1.0;
double r58843381 = r58843379 + r58843380;
double r58843382 = cos(r58843381);
double r58843383 = cos(r58843379);
double r58843384 = r58843382 - r58843383;
return r58843384;
}


double f(double x) {
double r58843385 = 1.0;
double r58843386 = cos(r58843385);
double r58843387 = x;
double r58843388 = cos(r58843387);
double r58843389 = r58843386 * r58843388;
double r58843390 = sin(r58843387);
double r58843391 = sin(r58843385);
double r58843392 = r58843390 * r58843391;
double r58843393 = r58843392 + r58843388;
double r58843394 = r58843389 - r58843393;
double r58843395 = r58843394 * r58843394;
double r58843396 = r58843395 * r58843394;
double r58843397 = cbrt(r58843396);
return r58843397;
}



# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 30.1

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

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

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

$\leadsto \color{blue}{\sqrt[3]{\left(\left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}}$
7. Final simplification0.6

$\leadsto \sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}$

# Reproduce

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