\[\tan \left(x + \varepsilon\right) - \tan x\]
Test:
NMSE problem 3.3.2
Bits:
128 bits
Bits error versus x
Bits error versus eps
Time: 16.7 s
Input Error: 16.7
Output Error: 12.4
Log:
Profile: 🕒
\(\begin{cases} \tan \left(x + \varepsilon\right) - \frac{\sin x}{\cos x} & \text{when } \varepsilon \le -9.268573f-09 \\ \varepsilon + \left({\varepsilon}^{3} \cdot {x}^2 + {\varepsilon}^{4} \cdot {x}^{3}\right) & \text{when } \varepsilon \le 0.0023221506f0 \\ \log_* (1 + (e^{{\left(\sqrt[3]{\tan \left(x + \varepsilon\right)}\right)}^3} - 1)^*) - \frac{1}{\cot x} & \text{otherwise} \end{cases}\)

    if eps < -9.268573f-09

    1. Started with
      \[\tan \left(x + \varepsilon\right) - \tan x\]
      14.0
    2. Using strategy rm
      14.0
    3. Applied tan-quot to get
      \[\tan \left(x + \varepsilon\right) - \color{red}{\tan x} \leadsto \tan \left(x + \varepsilon\right) - \color{blue}{\frac{\sin x}{\cos x}}\]
      13.8

    if -9.268573f-09 < eps < 0.0023221506f0

    1. Started with
      \[\tan \left(x + \varepsilon\right) - \tan x\]
      20.4
    2. Applied taylor to get
      \[\tan \left(x + \varepsilon\right) - \tan x \leadsto \varepsilon + \left({\varepsilon}^{3} \cdot {x}^2 + {\varepsilon}^{4} \cdot {x}^{3}\right)\]
      9.7
    3. Taylor expanded around 0 to get
      \[\color{red}{\varepsilon + \left({\varepsilon}^{3} \cdot {x}^2 + {\varepsilon}^{4} \cdot {x}^{3}\right)} \leadsto \color{blue}{\varepsilon + \left({\varepsilon}^{3} \cdot {x}^2 + {\varepsilon}^{4} \cdot {x}^{3}\right)}\]
      9.7

    if 0.0023221506f0 < eps

    1. Started with
      \[\tan \left(x + \varepsilon\right) - \tan x\]
      14.2
    2. Using strategy rm
      14.2
    3. Applied tan-cotan to get
      \[\tan \left(x + \varepsilon\right) - \color{red}{\tan x} \leadsto \tan \left(x + \varepsilon\right) - \color{blue}{\frac{1}{\cot x}}\]
      14.1
    4. Using strategy rm
      14.1
    5. Applied log1p-expm1-u to get
      \[\color{red}{\tan \left(x + \varepsilon\right)} - \frac{1}{\cot x} \leadsto \color{blue}{\log_* (1 + (e^{\tan \left(x + \varepsilon\right)} - 1)^*)} - \frac{1}{\cot x}\]
      14.7
    6. Using strategy rm
      14.7
    7. Applied add-cube-cbrt to get
      \[\log_* (1 + (e^{\color{red}{\tan \left(x + \varepsilon\right)}} - 1)^*) - \frac{1}{\cot x} \leadsto \log_* (1 + (e^{\color{blue}{{\left(\sqrt[3]{\tan \left(x + \varepsilon\right)}\right)}^3}} - 1)^*) - \frac{1}{\cot x}\]
      14.9

  1. Removed slow pow expressions

Original test:


(lambda ((x default) (eps default))
  #:name "NMSE problem 3.3.2"
  (- (tan (+ x eps)) (tan x))
  #:target
  (/ (sin eps) (* (cos x) (cos (+ x eps)))))