Average Error: 39.0 → 0.5
Time: 18.7s
Precision: 64
Internal Precision: 1344
\[\log \left(1 + x \cdot 99999\right)\]
\[\begin{array}{l} \mathbf{if}\;\log \left(1 + x \cdot 99999\right) \le 0.11493253249631447:\\ \;\;\;\;99999 \cdot x + \left(x \cdot x\right) \cdot \left(333323333433333 \cdot x - \frac{9999800001}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\frac{1}{99999}}{x} + \log x\right) + \log 99999\right) - \frac{\frac{1}{19999600002}}{x \cdot 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 (log (+ 1 (* x 99999))) < 0.11493253249631447

    1. Initial program 58.6

      \[\log \left(1 + x \cdot 99999\right)\]
    2. Taylor expanded around 0 0.4

      \[\leadsto \color{blue}{\left(333323333433333 \cdot {x}^{3} + 99999 \cdot x\right) - \frac{9999800001}{2} \cdot {x}^{2}}\]
    3. Applied simplify0.4

      \[\leadsto \color{blue}{99999 \cdot x + \left(x \cdot x\right) \cdot \left(333323333433333 \cdot x - \frac{9999800001}{2}\right)}\]

    if 0.11493253249631447 < (log (+ 1 (* x 99999)))

    1. Initial program 1.0

      \[\log \left(1 + x \cdot 99999\right)\]
    2. Taylor expanded around inf 0.8

      \[\leadsto \color{blue}{\left(\frac{1}{99999} \cdot \frac{1}{x} + \log 99999\right) - \left(\frac{1}{19999600002} \cdot \frac{1}{{x}^{2}} + \log \left(\frac{1}{x}\right)\right)}\]
    3. Applied simplify0.8

      \[\leadsto \color{blue}{\left(\left(\frac{\frac{1}{99999}}{x} + \log x\right) + \log 99999\right) - \frac{\frac{1}{19999600002}}{x \cdot x}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 18.7s)Debug log

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