\[\frac{1}{x} - \cot x\]
Test:
NMSE example 3.9
Bits:
128 bits
Bits error versus x
Time: 7.1 s
Input Error: 29.4
Output Error: 0.4
Log:
Profile: 🕒
\((\left(\log \left(e^{{x}^3}\right)\right) * \frac{1}{45} + \left((\frac{2}{945} * \left({x}^{5}\right) + \left(x \cdot \frac{1}{3}\right))_*\right))_*\)
  1. Started with
    \[\frac{1}{x} - \cot x\]
    29.4
  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}{(\left({x}^3\right) * \frac{1}{45} + \left((\frac{2}{945} * \left({x}^{5}\right) + \left(x \cdot \frac{1}{3}\right))_*\right))_*}\]
    0.3
  5. Using strategy rm
    0.3
  6. Applied add-log-exp to get
    \[(\color{red}{\left({x}^3\right)} * \frac{1}{45} + \left((\frac{2}{945} * \left({x}^{5}\right) + \left(x \cdot \frac{1}{3}\right))_*\right))_* \leadsto (\color{blue}{\left(\log \left(e^{{x}^3}\right)\right)} * \frac{1}{45} + \left((\frac{2}{945} * \left({x}^{5}\right) + \left(x \cdot \frac{1}{3}\right))_*\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))))