Average Error: 21.1 → 2.3
Time: 20.1s
Precision: 64
Internal Precision: 1344
$0.5 \cdot \left(1 + \frac{x}{\sqrt{100000.0 \cdot 100000.0 + x \cdot x}}\right)$
$\begin{array}{l} \mathbf{if}\;x \le -39576.05004285491:\\ \;\;\;\;\frac{1.5625 \cdot 10^{+29}}{{x}^{6}} - \left(\frac{1.875 \cdot 10^{+19}}{{x}^{4}} - \frac{2500000000.0}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}}\right)}^{3} + {0.5}^{3}}{0.5 \cdot 0.5 + \left(\frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} \cdot \frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} - \frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} \cdot 0.5\right)}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 2 regimes
2. ## if x < -39576.05004285491

1. Initial program 60.3

$0.5 \cdot \left(1 + \frac{x}{\sqrt{100000.0 \cdot 100000.0 + x \cdot x}}\right)$
2. Initial simplification60.3

$\leadsto 0.5 + \frac{0.5 \cdot x}{\sqrt{x \cdot x + 100000.0 \cdot 100000.0}}$
3. Taylor expanded around -inf 2.0

$\leadsto \color{blue}{\left(1.5625 \cdot 10^{+29} \cdot \frac{1}{{x}^{6}} + 2500000000.0 \cdot \frac{1}{{x}^{2}}\right) - 1.875 \cdot 10^{+19} \cdot \frac{1}{{x}^{4}}}$
4. Simplified2.0

$\leadsto \color{blue}{\frac{1.5625 \cdot 10^{+29}}{{x}^{6}} - \left(\frac{1.875 \cdot 10^{+19}}{{x}^{4}} - \frac{2500000000.0}{x \cdot x}\right)}$

## if -39576.05004285491 < x

1. Initial program 8.3

$0.5 \cdot \left(1 + \frac{x}{\sqrt{100000.0 \cdot 100000.0 + x \cdot x}}\right)$
2. Initial simplification8.3

$\leadsto 0.5 + \frac{0.5 \cdot x}{\sqrt{x \cdot x + 100000.0 \cdot 100000.0}}$
3. Taylor expanded around inf 2.4

$\leadsto 0.5 + \frac{0.5 \cdot x}{\color{blue}{\left(x + 5000000000.0 \cdot \frac{1}{x}\right) - 1.25 \cdot 10^{+19} \cdot \frac{1}{{x}^{3}}}}$
4. Simplified2.4

$\leadsto 0.5 + \frac{0.5 \cdot x}{\color{blue}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}}}$
5. Using strategy rm
6. Applied flip3-+2.4

$\leadsto \color{blue}{\frac{{0.5}^{3} + {\left(\frac{0.5 \cdot x}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}}\right)}^{3}}{0.5 \cdot 0.5 + \left(\frac{0.5 \cdot x}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} \cdot \frac{0.5 \cdot x}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} - 0.5 \cdot \frac{0.5 \cdot x}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}}\right)}}$
3. Recombined 2 regimes into one program.
4. Final simplification2.3

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -39576.05004285491:\\ \;\;\;\;\frac{1.5625 \cdot 10^{+29}}{{x}^{6}} - \left(\frac{1.875 \cdot 10^{+19}}{{x}^{4}} - \frac{2500000000.0}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}}\right)}^{3} + {0.5}^{3}}{0.5 \cdot 0.5 + \left(\frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} \cdot \frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} - \frac{x \cdot 0.5}{\left(x + \frac{5000000000.0}{x}\right) - \frac{\frac{1.25 \cdot 10^{+19}}{x}}{x \cdot x}} \cdot 0.5\right)}\\ \end{array}$

# Runtime

Time bar (total: 20.1s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (x)
:name "( 0.5 * (1 + x/(sqrt(100000.*100000. +x*x))))"
(* 0.5 (+ 1 (/ x (sqrt (+ (* 100000.0 100000.0) (* x x)))))))