Average Error: 30.6 → 0.3
Time: 24.2s
Precision: 64
Internal Precision: 2368
$\frac{\sin x}{{x}^{2}} - \frac{\cos x}{x}$
$\begin{array}{l} \mathbf{if}\;x \le -0.04242194793463719 \lor \neg \left(x \le 0.046591036094757086\right):\\ \;\;\;\;\frac{\sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}}} \cdot \frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}} \cdot \sqrt[3]{{x}^{2}}} - \frac{\cos x}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{840} \cdot {x}^{5} + \frac{1}{3} \cdot x\right) - \frac{1}{30} \cdot {x}^{3}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if x < -0.04242194793463719 or 0.046591036094757086 < x

1. Initial program 0.2

$\frac{\sin x}{{x}^{2}} - \frac{\cos x}{x}$
2. Using strategy rm

$\leadsto \frac{\sin x}{\color{blue}{\left(\sqrt[3]{{x}^{2}} \cdot \sqrt[3]{{x}^{2}}\right) \cdot \sqrt[3]{{x}^{2}}}} - \frac{\cos x}{x}$

$\leadsto \frac{\color{blue}{\left(\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}\right) \cdot \sqrt[3]{\sin x}}}{\left(\sqrt[3]{{x}^{2}} \cdot \sqrt[3]{{x}^{2}}\right) \cdot \sqrt[3]{{x}^{2}}} - \frac{\cos x}{x}$
5. Applied times-frac0.2

$\leadsto \color{blue}{\frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}} \cdot \sqrt[3]{{x}^{2}}} \cdot \frac{\sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}}}} - \frac{\cos x}{x}$

## if -0.04242194793463719 < x < 0.046591036094757086

1. Initial program 61.4

$\frac{\sin x}{{x}^{2}} - \frac{\cos x}{x}$
2. Taylor expanded around 0 0.4

$\leadsto \color{blue}{\left(\frac{1}{840} \cdot {x}^{5} + \frac{1}{3} \cdot x\right) - \frac{1}{30} \cdot {x}^{3}}$
3. Recombined 2 regimes into one program.
4. Final simplification0.3

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.04242194793463719 \lor \neg \left(x \le 0.046591036094757086\right):\\ \;\;\;\;\frac{\sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}}} \cdot \frac{\sqrt[3]{\sin x} \cdot \sqrt[3]{\sin x}}{\sqrt[3]{{x}^{2}} \cdot \sqrt[3]{{x}^{2}}} - \frac{\cos x}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{840} \cdot {x}^{5} + \frac{1}{3} \cdot x\right) - \frac{1}{30} \cdot {x}^{3}\\ \end{array}$

# Runtime

Time bar (total: 24.2s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (x)
:name "sin(x)/x^2-cos(x)/x"
(- (/ (sin x) (pow x 2)) (/ (cos x) x)))