Average Error: 39.2 → 0.1
Time: 16.2s
Precision: 64
Internal Precision: 1344
\[\log \left(\frac{x}{1 + x}\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -7181.902587127047 \lor \neg \left(x \le 7113.091247550719\right):\\ \;\;\;\;\frac{\left(\frac{\frac{1}{2}}{x} - 1\right) - \frac{\frac{1}{3}}{x \cdot x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\log \left(\sqrt{\frac{x}{x + 1}}\right) + \log \left(\sqrt{\frac{x}{x + 1}}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -7181.902587127047 or 7113.091247550719 < x

    1. Initial program 59.3

      \[\log \left(\frac{x}{1 + x}\right)\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{1}{{x}^{2}} - \left(\frac{1}{x} + \frac{1}{3} \cdot \frac{1}{{x}^{3}}\right)}\]
    3. Simplified0.0

      \[\leadsto \color{blue}{\frac{\left(\frac{\frac{1}{2}}{x} - 1\right) - \frac{\frac{1}{3}}{x \cdot x}}{x}}\]

    if -7181.902587127047 < x < 7113.091247550719

    1. Initial program 0.1

      \[\log \left(\frac{x}{1 + x}\right)\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.2

      \[\leadsto \log \color{blue}{\left(\sqrt{\frac{x}{1 + x}} \cdot \sqrt{\frac{x}{1 + x}}\right)}\]
    4. Applied log-prod0.2

      \[\leadsto \color{blue}{\log \left(\sqrt{\frac{x}{1 + x}}\right) + \log \left(\sqrt{\frac{x}{1 + x}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -7181.902587127047 \lor \neg \left(x \le 7113.091247550719\right):\\ \;\;\;\;\frac{\left(\frac{\frac{1}{2}}{x} - 1\right) - \frac{\frac{1}{3}}{x \cdot x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\log \left(\sqrt{\frac{x}{x + 1}}\right) + \log \left(\sqrt{\frac{x}{x + 1}}\right)\\ \end{array}\]

Runtime

Time bar (total: 16.2s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "log(x/(1+x))"
  (log (/ x (+ 1 x))))