Average Error: 31.4 → 0.0
Time: 26.4s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -0.015158747109532486:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\mathbf{if}\;x \le 659531696.815955:\\
\;\;\;\;\left(\frac{9}{40} \cdot {x}^2 - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -0.015158747109532486 or 659531696.815955 < x
Initial program 0.0
\[\frac{x - \sin x}{x - \tan x}\]
if -0.015158747109532486 < x < 659531696.815955
Initial program 62.7
\[\frac{x - \sin x}{x - \tan x}\]
Applied taylor 0.0
\[\leadsto \frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\]
Taylor expanded around 0 0.0
\[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
- Using strategy
rm
Applied associate--r+ 0.0
\[\leadsto \color{blue}{\left(\frac{9}{40} \cdot {x}^2 - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}}\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie shell --seed '#(644180380 3784176976 401987740 22459203 1940947670 3323606534)'
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))