Average Error: 31.4 → 0.1
Time: 40.6s
Precision: 64
Ground Truth: 128
\[\frac{x - \sin x}{x - \tan x}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le -4.436569855739804 \cdot 10^{-07}:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\mathbf{if}\;x \le 1.9330446047513736:\\
\;\;\;\;\frac{9}{40} \cdot {x}^2 - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if x < -4.436569855739804e-07 or 1.9330446047513736 < x
Initial program 0.2
\[\frac{x - \sin x}{x - \tan x}\]
if -4.436569855739804e-07 < x < 1.9330446047513736
Initial program 63.0
\[\frac{x - \sin x}{x - \tan x}\]
Applied taylor 0.0
\[\leadsto \frac{9}{40} \cdot {x}^2 - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)\]
Taylor expanded around 0 0.0
\[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^2 - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)}\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please report a bug with the following info:
herbie --seed '#(2450790218 3769101461 3677668716 1966659313 2958760900 2975588775)'
(FPCore (x)
:name "NMSE problem 3.4.5"
(/ (- x (sin x)) (- x (tan x))))