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

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

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

1. Initial program 35.9

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

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

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

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

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

1. Initial program 8.0

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

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

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

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

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

# Runtime

Time bar (total: 19.2s)Debug log

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