Average Error: 59.5 → 14.5
Time: 21.3s
Precision: 64
Internal Precision: 2624
$\sqrt{2 - 2 \cdot \sqrt{1 - \frac{{x}^{2}}{4}}}$
$\begin{array}{l} \mathbf{if}\;x \le 3.58554793247417 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\left(\frac{1}{4} \cdot {x}^{2} + \frac{1}{512} \cdot {x}^{6}\right) + {x}^{4} \cdot \frac{1}{64}}\\ \mathbf{else}:\\ \;\;\;\;\frac{7}{4096} \cdot {x}^{5} + \left(\frac{1}{64} \cdot {x}^{3} + x \cdot \frac{1}{2}\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 < 3.58554793247417e-310

1. Initial program 59.5

$\sqrt{2 - 2 \cdot \sqrt{1 - \frac{{x}^{2}}{4}}}$
2. Initial simplification59.5

$\leadsto \sqrt{2 - \sqrt{1 - \frac{x \cdot x}{4}} \cdot 2}$
3. Taylor expanded around 0 28.8

$\leadsto \sqrt{\color{blue}{\frac{1}{64} \cdot {x}^{4} + \left(\frac{1}{4} \cdot {x}^{2} + \frac{1}{512} \cdot {x}^{6}\right)}}$

## if 3.58554793247417e-310 < x

1. Initial program 59.6

$\sqrt{2 - 2 \cdot \sqrt{1 - \frac{{x}^{2}}{4}}}$
2. Initial simplification59.6

$\leadsto \sqrt{2 - \sqrt{1 - \frac{x \cdot x}{4}} \cdot 2}$
3. Taylor expanded around 0 0.2

$\leadsto \color{blue}{\frac{7}{4096} \cdot {x}^{5} + \left(\frac{1}{64} \cdot {x}^{3} + \frac{1}{2} \cdot x\right)}$
3. Recombined 2 regimes into one program.
4. Final simplification14.5

$\leadsto \begin{array}{l} \mathbf{if}\;x \le 3.58554793247417 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\left(\frac{1}{4} \cdot {x}^{2} + \frac{1}{512} \cdot {x}^{6}\right) + {x}^{4} \cdot \frac{1}{64}}\\ \mathbf{else}:\\ \;\;\;\;\frac{7}{4096} \cdot {x}^{5} + \left(\frac{1}{64} \cdot {x}^{3} + x \cdot \frac{1}{2}\right)\\ \end{array}$

# Runtime

Time bar (total: 21.3s)Debug log

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