Average Error: 31.4 → 0.1
Time: 55.7s
Precision: 64
Ground Truth: 128
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -8.658073314327725 \cdot 10^{-05}:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\
\mathbf{if}\;x \le 0.10844290020720185:\\
\;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -8.658073314327725e-05 or 0.10844290020720185 < x
Initial program 0.1
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm
Applied div-sub 0.1
\[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
if -8.658073314327725e-05 < x < 0.10844290020720185
Initial program 63.1
\[\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 --seed '#(925454495 2186793034 1557910699 2722386145 337930805 3187467667)'
(FPCore (x)
:name "NMSE problem 3.4.5"
(/ (- x (sin x)) (- x (tan x))))