Average Error: 31.7 → 0.1
Time: 19.7s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -6.005412638913283 \cdot 10^{-09}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right)}^3\\
\mathbf{if}\;x \le 0.22614890659906178:\\
\;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right)}^3\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -6.005412638913283e-09 or 0.22614890659906178 < x
Initial program 0.2
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied add-cube-cbrt 0.3
\[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{x - \sin x}{x - \tan x}}\right)}^3}\]
if -6.005412638913283e-09 < x < 0.22614890659906178
Initial program 63.2
\[\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)}\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie shell --seed '#(1065003094 2074156664 2352254222 753858891 3745550101 3374585842)'
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))