Average Error: 24.9 → 0.9
Time: 19.3s
Precision: 64
Internal Precision: 576
$\frac{1 - \left(x - y\right) \cdot \left(x - y\right)}{\left(4 \cdot x\right) \cdot y}$
$\begin{array}{l} \mathbf{if}\;y \le -86.726910540641 \lor \neg \left(y \le 1.1813564328514398 \cdot 10^{-06}\right):\\ \;\;\;\;\frac{1}{2} - \frac{1}{4} \cdot \left(\frac{y}{x} + \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} - \frac{\frac{1}{4}}{y} \cdot \left(x - \frac{1}{x}\right)\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if y < -86.726910540641 or 1.1813564328514398e-06 < y

1. Initial program 35.9

$\frac{1 - \left(x - y\right) \cdot \left(x - y\right)}{\left(4 \cdot x\right) \cdot y}$
2. Initial simplification35.9

$\leadsto \frac{1 - \left(x - y\right) \cdot \left(x - y\right)}{x \cdot \left(y \cdot 4\right)}$
3. Taylor expanded around -inf 0.9

$\leadsto \color{blue}{\frac{1}{2} - \left(\frac{1}{4} \cdot \frac{y}{x} + \frac{1}{4} \cdot \frac{x}{y}\right)}$
4. Simplified0.9

$\leadsto \color{blue}{\frac{1}{2} - \left(\frac{y}{x} + \frac{x}{y}\right) \cdot \frac{1}{4}}$

## if -86.726910540641 < y < 1.1813564328514398e-06

1. Initial program 8.0

$\frac{1 - \left(x - y\right) \cdot \left(x - y\right)}{\left(4 \cdot x\right) \cdot y}$
2. Initial simplification8.0

$\leadsto \frac{1 - \left(x - y\right) \cdot \left(x - y\right)}{x \cdot \left(y \cdot 4\right)}$
3. Taylor expanded around 0 0.9

$\leadsto \color{blue}{\left(\frac{1}{4} \cdot \frac{1}{x \cdot y} + \frac{1}{2}\right) - \frac{1}{4} \cdot \frac{x}{y}}$
4. Simplified0.9

$\leadsto \color{blue}{\frac{1}{2} - \left(x - \frac{1}{x}\right) \cdot \frac{\frac{1}{4}}{y}}$
3. Recombined 2 regimes into one program.
4. Final simplification0.9

$\leadsto \begin{array}{l} \mathbf{if}\;y \le -86.726910540641 \lor \neg \left(y \le 1.1813564328514398 \cdot 10^{-06}\right):\\ \;\;\;\;\frac{1}{2} - \frac{1}{4} \cdot \left(\frac{y}{x} + \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} - \frac{\frac{1}{4}}{y} \cdot \left(x - \frac{1}{x}\right)\\ \end{array}$

# Runtime

Time bar (total: 19.3s)Debug log

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