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

  7. Applied final simplification

  8. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "NMSE example 3.10"
  (/ (log (- 1 x)) (log (+ 1 x)))
  #:target
  (- (+ (+ (+ 1 x) (/ (sqr x) 2)) (* 5/12 (pow x 3)))))