\[\log \left(1 + x\right)\]
Test:
ln(1 + x)
Bits:
128 bits
Bits error versus x
Time: 4.3 s
Input Error: 18.0
Output Error: 0.1
Log:
Profile: 🕒
\(\begin{cases} \left(\frac{1}{3} \cdot x - \frac{1}{2}\right) \cdot {x}^2 + x & \text{when } x \le 0.028850537f0 \\ \log \left(1 + x\right) & \text{otherwise} \end{cases}\)

    if x < 0.028850537f0

    1. Started with
      \[\log \left(1 + x\right)\]
      26.5
    2. Applied taylor to get
      \[\log \left(1 + x\right) \leadsto \left(\frac{1}{3} \cdot {x}^{3} + x\right) - \frac{1}{2} \cdot {x}^2\]
      0.1
    3. Taylor expanded around 0 to get
      \[\color{red}{\left(\frac{1}{3} \cdot {x}^{3} + x\right) - \frac{1}{2} \cdot {x}^2} \leadsto \color{blue}{\left(\frac{1}{3} \cdot {x}^{3} + x\right) - \frac{1}{2} \cdot {x}^2}\]
      0.1
    4. Applied simplify to get
      \[\color{red}{\left(\frac{1}{3} \cdot {x}^{3} + x\right) - \frac{1}{2} \cdot {x}^2} \leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot \frac{1}{3} - \frac{1}{2}\right) + x}\]
      0.1
    5. Applied simplify to get
      \[\color{red}{\left(x \cdot x\right) \cdot \left(x \cdot \frac{1}{3} - \frac{1}{2}\right)} + x \leadsto \color{blue}{\left(\frac{1}{3} \cdot x - \frac{1}{2}\right) \cdot {x}^2} + x\]
      0.1

    if 0.028850537f0 < x

    1. Started with
      \[\log \left(1 + x\right)\]
      0.1

  1. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "ln(1 + x)"
  (log (+ 1 x))
  #:target
  (if (= (+ 1 x) 1) x (/ (* x (log (+ 1 x))) (- (+ 1 x) 1))))