Average Error: 31.2 → 0.0
Time: 8.2m
Precision: 64
Internal Precision: 2368
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.03368541449468662 \lor \neg \left(x \le 0.0313826824217051\right):\\ \;\;\;\;\sqrt{\left(\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}\right) \cdot \left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right)} \cdot \frac{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{2} \cdot \frac{9}{40} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -0.03368541449468662 or 0.0313826824217051 < x

    1. Initial program 0.1

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

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied flip--0.1

      \[\leadsto \color{blue}{\frac{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity0.1

      \[\leadsto \frac{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}{\color{blue}{1 \cdot \left(\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}\right)}}\]
    8. Applied add-sqr-sqrt0.1

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}} \cdot \sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}}{1 \cdot \left(\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}\right)}\]
    9. Applied times-frac0.1

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}{1} \cdot \frac{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}}\]
    10. Applied simplify0.1

      \[\leadsto \color{blue}{\sqrt{\left(\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}\right) \cdot \left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right)}} \cdot \frac{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\]

    if -0.03368541449468662 < x < 0.0313826824217051

    1. Initial program 62.6

      \[\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. Recombined 2 regimes into one program.
  4. Applied simplify0.0

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;x \le -0.03368541449468662 \lor \neg \left(x \le 0.0313826824217051\right):\\ \;\;\;\;\sqrt{\left(\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}\right) \cdot \left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right)} \cdot \frac{\sqrt{\frac{x}{x - \tan x} \cdot \frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x} \cdot \frac{\sin x}{x - \tan x}}}{\frac{x}{x - \tan x} + \frac{\sin x}{x - \tan x}}\\ \mathbf{else}:\\ \;\;\;\;{x}^{2} \cdot \frac{9}{40} - \left(\frac{1}{2} + \frac{27}{2800} \cdot {x}^{4}\right)\\ \end{array}}\]

Runtime

Time bar (total: 8.2m)Debug logProfile

herbie shell --seed 2018193 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))