Average Error: 31.0 → 0.5
Time: 19.7s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -5.5164922447739564 \cdot 10^{-14}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)}^3\\
\mathbf{if}\;x \le 0.22138222595296528:\\
\;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)}^3\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -5.5164922447739564e-14 or 0.22138222595296528 < x
Initial program 0.9
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied add-cube-cbrt 2.2
\[\leadsto \frac{x - \sin x}{\color{blue}{{\left(\sqrt[3]{x - \tan x}\right)}^3}}\]
Applied add-cube-cbrt 0.9
\[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{x - \sin x}\right)}^3}}{{\left(\sqrt[3]{x - \tan x}\right)}^3}\]
Applied cube-undiv 0.9
\[\leadsto \color{blue}{{\left(\frac{\sqrt[3]{x - \sin x}}{\sqrt[3]{x - \tan x}}\right)}^3}\]
if -5.5164922447739564e-14 < x < 0.22138222595296528
Initial program 63.0
\[\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 '#(1064651971 495577305 2200811460 13024471 864198081 231948279)'
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))