Average Error: 30.5 → 0.1
Time: 41.3s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -3.859884253300168 \cdot 10^{-07}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\mathbf{if}\;x \le 0.1441617602023804:\\
\;\;\;\;\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -3.859884253300168e-07 or 0.1441617602023804 < x
Initial program 0.3
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied add-log-exp 0.3
\[\leadsto \color{blue}{\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)}\]
if -3.859884253300168e-07 < x < 0.1441617602023804
Initial program 63.1
\[\frac{x - \sin x}{x - \tan x}\]
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 '#(2329929097 3210370195 3111198779 2406363002 3511342718 2136436390)'
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))