Average Error: 30.7 → 0.0
Time: 18.5s
Precision: 64
Internal precision: 2432
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.009369761232765748:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{if}\;x \le 0.06423521200938427:\\ \;\;\;\;\left(x \cdot \left(x \cdot \frac{9}{40}\right) - \frac{1}{2}\right) - \frac{27}{2800} \cdot {x}^{4}\\ \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 < -0.009369761232765748

    1. Initial program 0.1

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

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

    if -0.009369761232765748 < x < 0.06423521200938427

    1. Initial program 62.7

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

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt 62.6

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\right)}^3}\]
    6. Applied taylor 1.0

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

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

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

    if 0.06423521200938427 < 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

Time bar (total: 18.5s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1067488128 1186562765 67428877 2948030040 4169093828 3206893112)'
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))