Average Error: 29.6 → 0.3
Time: 15.7s
Precision: 64
$\sin x - \sin \left(x - 1\right)$
$\left(\sin x - \left(\sin x \cdot \left(\sqrt[3]{\cos 1} \cdot \sqrt[3]{\cos 1}\right)\right) \cdot \sqrt[3]{\cos 1}\right) + \sin 1 \cdot \cos x$
\sin x - \sin \left(x - 1\right)
\left(\sin x - \left(\sin x \cdot \left(\sqrt[3]{\cos 1} \cdot \sqrt[3]{\cos 1}\right)\right) \cdot \sqrt[3]{\cos 1}\right) + \sin 1 \cdot \cos x
double f(double x) {
double r21565078 = x;
double r21565079 = sin(r21565078);
double r21565080 = 1.0;
double r21565081 = r21565078 - r21565080;
double r21565082 = sin(r21565081);
double r21565083 = r21565079 - r21565082;
return r21565083;
}


double f(double x) {
double r21565084 = x;
double r21565085 = sin(r21565084);
double r21565086 = 1.0;
double r21565087 = cos(r21565086);
double r21565088 = cbrt(r21565087);
double r21565089 = r21565088 * r21565088;
double r21565090 = r21565085 * r21565089;
double r21565091 = r21565090 * r21565088;
double r21565092 = r21565085 - r21565091;
double r21565093 = sin(r21565086);
double r21565094 = cos(r21565084);
double r21565095 = r21565093 * r21565094;
double r21565096 = r21565092 + r21565095;
return r21565096;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 29.6

$\sin x - \sin \left(x - 1\right)$
2. Using strategy rm
3. Applied sin-diff0.4

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

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

$\leadsto \left(\sin x - \sin x \cdot \color{blue}{\left(\left(\sqrt[3]{\cos 1} \cdot \sqrt[3]{\cos 1}\right) \cdot \sqrt[3]{\cos 1}\right)}\right) + \cos x \cdot \sin 1$
7. Applied associate-*r*0.3

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

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

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "sin(x)-sin(x-1)"
(- (sin x) (sin (- x 1.0))))