Average Error: 14.7 → 0.0
Time: 9.0s
Precision: 64
Internal Precision: 576
$1 + \sqrt{1 + {x}^{2}}$
$\begin{array}{l} \mathbf{if}\;x \le -1.3352415157792068 \cdot 10^{+154}:\\ \;\;\;\;1 + \left(\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \left(\frac{\frac{1}{2}}{x} + x\right)\right)\\ \mathbf{elif}\;x \le 353.22601608574234:\\ \;\;\;\;\sqrt{x \cdot x + 1} + 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\frac{1}{2}}{x} + x\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right) + 1\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 3 regimes
2. ## if x < -1.3352415157792068e+154

1. Initial program 59.6

$1 + \sqrt{1 + {x}^{2}}$
2. Initial simplification59.6

$\leadsto 1 + \sqrt{x \cdot x + 1}$
3. Taylor expanded around -inf 0

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

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

## if -1.3352415157792068e+154 < x < 353.22601608574234

1. Initial program 0.0

$1 + \sqrt{1 + {x}^{2}}$
2. Initial simplification0.0

$\leadsto 1 + \sqrt{x \cdot x + 1}$

## if 353.22601608574234 < x

1. Initial program 28.8

$1 + \sqrt{1 + {x}^{2}}$
2. Initial simplification28.8

$\leadsto 1 + \sqrt{x \cdot x + 1}$
3. Taylor expanded around inf 0.0

$\leadsto 1 + \color{blue}{\left(\left(x + \frac{1}{2} \cdot \frac{1}{x}\right) - \frac{1}{8} \cdot \frac{1}{{x}^{3}}\right)}$
4. Simplified0.0

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

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.3352415157792068 \cdot 10^{+154}:\\ \;\;\;\;1 + \left(\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \left(\frac{\frac{1}{2}}{x} + x\right)\right)\\ \mathbf{elif}\;x \le 353.22601608574234:\\ \;\;\;\;\sqrt{x \cdot x + 1} + 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\frac{1}{2}}{x} + x\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right) + 1\\ \end{array}$

# Runtime

Time bar (total: 9.0s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (x)
:name "1+sqrt(1+x^2)"
(+ 1 (sqrt (+ 1 (pow x 2)))))