Average Error: 16.0 → 8.8
Time: 17.5s
Precision: 64
Internal Precision: 576
$\frac{x - y}{\log \left(\frac{x}{y}\right)}$
$\begin{array}{l} \mathbf{if}\;y \le 3.6202312021135434 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{\log \left(\frac{x}{y}\right)} - \frac{y}{\log \left(\frac{x}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\log x - \log y}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

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

1. Initial program 16.5

$\frac{x - y}{\log \left(\frac{x}{y}\right)}$
2. Initial simplification16.5

$\leadsto \frac{x - y}{\log \left(\frac{x}{y}\right)}$
3. Using strategy rm
4. Applied div-sub16.5

$\leadsto \color{blue}{\frac{x}{\log \left(\frac{x}{y}\right)} - \frac{y}{\log \left(\frac{x}{y}\right)}}$

## if 3.6202312021135434e-294 < y

1. Initial program 15.4

$\frac{x - y}{\log \left(\frac{x}{y}\right)}$
2. Initial simplification15.4

$\leadsto \frac{x - y}{\log \left(\frac{x}{y}\right)}$
3. Taylor expanded around 0 0.6

$\leadsto \frac{x - y}{\color{blue}{\log x - \log y}}$
3. Recombined 2 regimes into one program.
4. Final simplification8.8

$\leadsto \begin{array}{l} \mathbf{if}\;y \le 3.6202312021135434 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{\log \left(\frac{x}{y}\right)} - \frac{y}{\log \left(\frac{x}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{\log x - \log y}\\ \end{array}$

# Runtime

Time bar (total: 17.5s)Debug log

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