\[\frac{1}{x} - \cot x\]
Test:
NMSE example 3.9
Bits:
128 bits
Bits error versus x
Time: 13.7 s
Input Error: 59.8
Output Error: 0.4
Log:
Profile: 🕒
\(x \cdot \frac{1}{3} + \left(\log \left(e^{\frac{2}{945} \cdot {x}^{5}}\right) + {x}^3 \cdot \frac{1}{45}\right)\)
  1. Started with
    \[\frac{1}{x} - \cot x\]
    59.8
  2. Applied taylor to get
    \[\frac{1}{x} - \cot x \leadsto \frac{2}{945} \cdot {x}^{5} + \left(\frac{1}{45} \cdot {x}^{3} + \frac{1}{3} \cdot x\right)\]
    0.3
  3. Taylor expanded around 0 to get
    \[\color{red}{\frac{2}{945} \cdot {x}^{5} + \left(\frac{1}{45} \cdot {x}^{3} + \frac{1}{3} \cdot x\right)} \leadsto \color{blue}{\frac{2}{945} \cdot {x}^{5} + \left(\frac{1}{45} \cdot {x}^{3} + \frac{1}{3} \cdot x\right)}\]
    0.3
  4. Applied simplify to get
    \[\color{red}{\frac{2}{945} \cdot {x}^{5} + \left(\frac{1}{45} \cdot {x}^{3} + \frac{1}{3} \cdot x\right)} \leadsto \color{blue}{x \cdot \frac{1}{3} + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right)}\]
    0.3
  5. Using strategy rm
    0.3
  6. Applied add-log-exp to get
    \[x \cdot \frac{1}{3} + \left(\color{red}{\frac{2}{945} \cdot {x}^{5}} + {x}^3 \cdot \frac{1}{45}\right) \leadsto x \cdot \frac{1}{3} + \left(\color{blue}{\log \left(e^{\frac{2}{945} \cdot {x}^{5}}\right)} + {x}^3 \cdot \frac{1}{45}\right)\]
    0.4

Original test:


(lambda ((x default))
  #:name "NMSE example 3.9"
  (- (/ 1 x) (cotan x))
  #:target
  (if (< (fabs x) 0.026) (* (/ x 3) (+ 1 (/ (sqr x) 15))) (- (/ 1 x) (cotan x))))