Average Error: 31.2 → 0.0
Time: 53.7s
Precision: 64
Internal Precision: 2368
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03977511220299969:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{if}\;x \le 0.03999707453083916:\\ \;\;\;\;\log \left(\left(\left(x \cdot \frac{9}{40}\right) \cdot \frac{x}{e^{\frac{1}{2}}} + \frac{351}{22400} \cdot \frac{{x}^{4}}{e^{\frac{1}{2}}}\right) + e^{\frac{-1}{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -0.03977511220299969 or 0.03999707453083916 < x

    1. Initial program 0.0

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

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

    if -0.03977511220299969 < x < 0.03999707453083916

    1. Initial program 62.8

      \[\frac{x - \sin x}{x - \tan x}\]
    2. 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)}\]
    3. Using strategy rm
    4. Applied add-log-exp0.0

      \[\leadsto \frac{9}{40} \cdot {x}^{2} - \color{blue}{\log \left(e^{\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}}\right)}\]
    5. Applied add-log-exp0.0

      \[\leadsto \color{blue}{\log \left(e^{\frac{9}{40} \cdot {x}^{2}}\right)} - \log \left(e^{\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}}\right)\]
    6. Applied diff-log0.0

      \[\leadsto \color{blue}{\log \left(\frac{e^{\frac{9}{40} \cdot {x}^{2}}}{e^{\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}}}\right)}\]
    7. Taylor expanded around 0 0.0

      \[\leadsto \log \color{blue}{\left(\frac{351}{22400} \cdot \frac{{x}^{4}}{e^{\frac{1}{2}}} + \left(\frac{9}{40} \cdot \frac{{x}^{2}}{e^{\frac{1}{2}}} + \frac{1}{e^{\frac{1}{2}}}\right)\right)}\]
    8. Applied simplify0.0

      \[\leadsto \color{blue}{\log \left(\left(\left(x \cdot \frac{9}{40}\right) \cdot \frac{x}{e^{\frac{1}{2}}} + \frac{351}{22400} \cdot \frac{{x}^{4}}{e^{\frac{1}{2}}}\right) + e^{\frac{-1}{2}}\right)}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 53.7s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))