Average Error: 31.6 → 0.1
Time: 18.8s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.010384934750878 \cdot 10^{-06}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{if}\;x \le 18533.742864951855:\\ \;\;\;\;\left(\frac{9}{40} \cdot {x}^2 - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\frac{x - \sin x}{x - \tan x}}\right)}^2\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes.
  2. if x < -4.010384934750878e-06

    1. Initial program 0.3

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub 0.3

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]

    if -4.010384934750878e-06 < x < 18533.742864951855

    1. Initial program 62.8

      \[\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(\sqrt{\frac{9}{40} \cdot {x}^2 - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\right)}^2\]
    5. Taylor expanded around 0 63.6

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

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

    if 18533.742864951855 < x

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{x - \sin x}{x - \tan x}}\right)}^2}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 18.8s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1066785882 2324371342 4059510649 1466361199 2701357084 1216585281)'
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))