\[\frac{1}{x} - \cot x\]
Test:
NMSE example 3.9
Bits:
128 bits
Bits error versus x
Time: 7.5 s
Input Error: 59.8
Output Error: 0.3
Log:
Profile: 🕒
\(\left({x}^3 \cdot \frac{1}{45} + x \cdot \frac{1}{3}\right) + \frac{2}{945} \cdot {x}^{5}\)
  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-cube-cbrt to get
    \[\color{red}{x \cdot \frac{1}{3}} + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right) \leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \frac{1}{3}}\right)}^3} + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right)\]
    1.5
  7. Using strategy rm
    1.5
  8. Applied add-cube-cbrt to get
    \[{\color{red}{\left(\sqrt[3]{x \cdot \frac{1}{3}}\right)}}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right) \leadsto {\color{blue}{\left({\left(\sqrt[3]{\sqrt[3]{x \cdot \frac{1}{3}}}\right)}^3\right)}}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right)\]
    2.7
  9. Applied taylor to get
    \[{\left({\left(\sqrt[3]{\sqrt[3]{x \cdot \frac{1}{3}}}\right)}^3\right)}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right) \leadsto {\left({\left(\sqrt[3]{\sqrt[3]{\frac{1}{3} \cdot x}}\right)}^3\right)}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right)\]
    2.7
  10. Taylor expanded around 0 to get
    \[{\left({\color{red}{\left(\sqrt[3]{\sqrt[3]{\frac{1}{3} \cdot x}}\right)}}^3\right)}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right) \leadsto {\left({\color{blue}{\left(\sqrt[3]{\sqrt[3]{\frac{1}{3} \cdot x}}\right)}}^3\right)}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right)\]
    2.7
  11. Applied simplify to get
    \[{\left({\left(\sqrt[3]{\sqrt[3]{\frac{1}{3} \cdot x}}\right)}^3\right)}^3 + \left(\frac{2}{945} \cdot {x}^{5} + {x}^3 \cdot \frac{1}{45}\right) \leadsto \left({x}^3 \cdot \frac{1}{45} + x \cdot \frac{1}{3}\right) + \frac{2}{945} \cdot {x}^{5}\]
    0.3

  12. Applied final simplification

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))))