Average Error: 9.8 → 0.1
Time: 9.4s
Precision: 64
Internal Precision: 1088
$\sin x - x$
$\begin{array}{l} \mathbf{if}\;x \le -0.043473338976223706 \lor \neg \left(x \le 0.046591036094757086\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 x < -0.043473338976223706 or 0.046591036094757086 < x

1. Initial program 0.0

$\sin x - x$

## if -0.043473338976223706 < x < 0.046591036094757086

1. Initial program 19.6

$\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.2

$\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.2

$\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. Final simplification0.1

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.043473338976223706 \lor \neg \left(x \le 0.046591036094757086\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: 9.4s)Debug log

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