Average Error: 9.8 → 0.3
Time: 16.4s
Precision: 64
Internal Precision: 1088
$\sin x - x$
$\begin{array}{l} \mathbf{if}\;\sin x - x \le -2.9050108653764914 \cdot 10^{-19} \lor \neg \left(\sin x - x \le 3.5836871547451 \cdot 10^{-310}\right):\\ \;\;\;\;\sin x - x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{120} \cdot {x}^{5} - \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot x\right)\right) + {x}^{7} \cdot \frac{1}{5040}\right)\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if (- (sin x) x) < -2.9050108653764914e-19 or 3.5836871547451e-310 < (- (sin x) x)

1. Initial program 0.5

$\sin x - x$

## if -2.9050108653764914e-19 < (- (sin x) x) < 3.5836871547451e-310

1. Initial program 19.5

$\sin x - x$
2. Taylor expanded around 0 0.1

$\leadsto \color{blue}{\frac{1}{120} \cdot {x}^{5} - \left(\frac{1}{6} \cdot {x}^{3} + \frac{1}{5040} \cdot {x}^{7}\right)}$
3. Using strategy rm
4. Applied unpow30.1

$\leadsto \frac{1}{120} \cdot {x}^{5} - \left(\frac{1}{6} \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + \frac{1}{5040} \cdot {x}^{7}\right)$
5. Applied associate-*r*0.1

$\leadsto \frac{1}{120} \cdot {x}^{5} - \left(\color{blue}{\left(\frac{1}{6} \cdot \left(x \cdot x\right)\right) \cdot x} + \frac{1}{5040} \cdot {x}^{7}\right)$
3. Recombined 2 regimes into one program.
4. Applied simplify0.3

$\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\sin x - x \le -2.9050108653764914 \cdot 10^{-19} \lor \neg \left(\sin x - x \le 3.5836871547451 \cdot 10^{-310}\right):\\ \;\;\;\;\sin x - x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{120} \cdot {x}^{5} - \left(x \cdot \left(\frac{1}{6} \cdot \left(x \cdot x\right)\right) + {x}^{7} \cdot \frac{1}{5040}\right)\\ \end{array}}$

# Runtime

Time bar (total: 16.4s)Debug log

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