Average Error: 30.9 → 0.1
Time: 1.4m
Precision: 64
Ground Truth: 128
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -7.829158115972637 \cdot 10^{-05}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \mathbf{if}\;x \le 849008901.3057916:\\ \;\;\;\;\frac{-1}{2} - \left({x}^{4} \cdot \frac{27}{2800} - x \cdot \left(x \cdot \frac{9}{40}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \sin x}{x - \tan x}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes.
  2. if x < -7.829158115972637e-05

    1. Initial program 0.2

      \[\frac{x - \sin x}{x - \tan x}\]

    if -7.829158115972637e-05 < x < 849008901.3057916

    1. Initial program 62.9

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt 63.6

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{x - \sin x}{x - \tan x}}\right)}^2}\]
    4. Applied taylor 63.6

      \[\leadsto \left({\left(\sqrt{\frac{-1}{2}}\right)}^2 + \frac{9}{40} \cdot {x}^2\right) - \frac{27}{2800} \cdot {x}^{4}\]
    5. Taylor expanded around 0 63.6

      \[\leadsto \color{blue}{\left({\left(\sqrt{\frac{-1}{2}}\right)}^2 + \frac{9}{40} \cdot {x}^2\right) - \frac{27}{2800} \cdot {x}^{4}}\]
    6. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{-1}{2} - \left({x}^{4} \cdot \frac{27}{2800} - x \cdot \left(x \cdot \frac{9}{40}\right)\right)}\]

    if 849008901.3057916 < x

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Total time: 1.4m Debug log

Please include this information when filing a bug report:

herbie --seed '#(4267190536 1155548794 4224813166 2347178597 3852352482 3815186076)'
(FPCore (x)
  :name "NMSE problem 3.4.5"
  (/ (- x (sin x)) (- x (tan x))))