Average Error: 29.4 → 0.1
Time: 23.2s
Precision: 64
Internal Precision: 1344
\[\log \left(x + 1\right) - \log x\]
\[\begin{array}{l} \mathbf{if}\;x \le 8446.004109786509:\\ \;\;\;\;\log \left(\frac{1 + x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\frac{\frac{1}{3}}{x}}{x} + 1\right) - \frac{\frac{1}{2}}{x}}{x}\\ \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 < 8446.004109786509

    1. Initial program 0.1

      \[\log \left(x + 1\right) - \log x\]
    2. Initial simplification0.1

      \[\leadsto \log \left(1 + x\right) - \log x\]
    3. Using strategy rm
    4. Applied diff-log0.1

      \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)}\]

    if 8446.004109786509 < x

    1. Initial program 59.6

      \[\log \left(x + 1\right) - \log x\]
    2. Initial simplification59.6

      \[\leadsto \log \left(1 + x\right) - \log x\]
    3. Taylor expanded around inf 0.0

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{1}{3}}{x}}{x} + \left(1 - \frac{\frac{1}{2}}{x}\right)}{x}}\]
    5. Using strategy rm
    6. Applied associate-+r-0.0

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

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

Runtime

Time bar (total: 23.2s)Debug log

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