Average Error: 38.1 → 8.7
Time: 15.0s
Precision: 64
Internal Precision: 2368
\[\log \left(1 - \frac{\ell - r}{\ell}\right)\]
\[\begin{array}{l} \mathbf{if}\;r \le 3.6202312021135434 \cdot 10^{-294}:\\ \;\;\;\;\log \left(\frac{r}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\log r - \log \ell\\ \end{array}\]

Error

Bits error versus l

Bits error versus r

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if r < 3.6202312021135434e-294

    1. Initial program 39.0

      \[\log \left(1 - \frac{\ell - r}{\ell}\right)\]
    2. Initial simplification16.2

      \[\leadsto \log \left(\frac{r}{\ell}\right)\]

    if 3.6202312021135434e-294 < r

    1. Initial program 37.1

      \[\log \left(1 - \frac{\ell - r}{\ell}\right)\]
    2. Initial simplification15.2

      \[\leadsto \log \left(\frac{r}{\ell}\right)\]
    3. Using strategy rm
    4. Applied log-div0.6

      \[\leadsto \color{blue}{\log r - \log \ell}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;r \le 3.6202312021135434 \cdot 10^{-294}:\\ \;\;\;\;\log \left(\frac{r}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\log r - \log \ell\\ \end{array}\]

Runtime

Time bar (total: 15.0s)Debug log

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