Average Error: 15.6 → 0.1
Time: 12.9s
Precision: binary64
Cost: 60484
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}\\ t_1 := 0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\\ t_2 := 1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \mathbf{if}\;x \leq -0.00215:\\ \;\;\;\;\frac{t_1}{1 + \sqrt{\frac{0.015625 + \frac{-0.015625}{t_0 \cdot t_0}}{\left(0.125 + \frac{-0.125}{t_0}\right) \cdot \left(\frac{0.25}{1 + x \cdot x} + \left(0.25 + \frac{-0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}}\\ \mathbf{elif}\;x \leq 0.0018:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left({t_1}^{3}\right)}^{0.3333333333333333}}{t_2}\\ \end{array} \]
(FPCore (x)
 :precision binary64
 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (pow (hypot 1.0 x) 3.0))
        (t_1 (+ 0.5 (/ -0.5 (hypot 1.0 x))))
        (t_2 (+ 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 x)))))))
   (if (<= x -0.00215)
     (/
      t_1
      (+
       1.0
       (sqrt
        (/
         (+ 0.015625 (/ -0.015625 (* t_0 t_0)))
         (*
          (+ 0.125 (/ -0.125 t_0))
          (+ (/ 0.25 (+ 1.0 (* x x))) (+ 0.25 (/ -0.25 (hypot 1.0 x)))))))))
     (if (<= x 0.0018)
       (/ (fma 0.25 (* x x) (* -0.1875 (pow x 4.0))) t_2)
       (/ (pow (pow t_1 3.0) 0.3333333333333333) t_2)))))
double code(double x) {
	return 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
}
double code(double x) {
	double t_0 = pow(hypot(1.0, x), 3.0);
	double t_1 = 0.5 + (-0.5 / hypot(1.0, x));
	double t_2 = 1.0 + sqrt((0.5 + (0.5 / hypot(1.0, x))));
	double tmp;
	if (x <= -0.00215) {
		tmp = t_1 / (1.0 + sqrt(((0.015625 + (-0.015625 / (t_0 * t_0))) / ((0.125 + (-0.125 / t_0)) * ((0.25 / (1.0 + (x * x))) + (0.25 + (-0.25 / hypot(1.0, x))))))));
	} else if (x <= 0.0018) {
		tmp = fma(0.25, (x * x), (-0.1875 * pow(x, 4.0))) / t_2;
	} else {
		tmp = pow(pow(t_1, 3.0), 0.3333333333333333) / t_2;
	}
	return tmp;
}
function code(x)
	return Float64(1.0 - sqrt(Float64(0.5 * Float64(1.0 + Float64(1.0 / hypot(1.0, x))))))
end
function code(x)
	t_0 = hypot(1.0, x) ^ 3.0
	t_1 = Float64(0.5 + Float64(-0.5 / hypot(1.0, x)))
	t_2 = Float64(1.0 + sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, x)))))
	tmp = 0.0
	if (x <= -0.00215)
		tmp = Float64(t_1 / Float64(1.0 + sqrt(Float64(Float64(0.015625 + Float64(-0.015625 / Float64(t_0 * t_0))) / Float64(Float64(0.125 + Float64(-0.125 / t_0)) * Float64(Float64(0.25 / Float64(1.0 + Float64(x * x))) + Float64(0.25 + Float64(-0.25 / hypot(1.0, x)))))))));
	elseif (x <= 0.0018)
		tmp = Float64(fma(0.25, Float64(x * x), Float64(-0.1875 * (x ^ 4.0))) / t_2);
	else
		tmp = Float64(((t_1 ^ 3.0) ^ 0.3333333333333333) / t_2);
	end
	return tmp
end
code[x_] := N[(1.0 - N[Sqrt[N[(0.5 * N[(1.0 + N[(1.0 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Power[N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(-0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00215], N[(t$95$1 / N[(1.0 + N[Sqrt[N[(N[(0.015625 + N[(-0.015625 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.125 + N[(-0.125 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(0.25 / N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.25 + N[(-0.25 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0018], N[(N[(0.25 * N[(x * x), $MachinePrecision] + N[(-0.1875 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[Power[N[Power[t$95$1, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}\\
t_1 := 0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\\
t_2 := 1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\
\mathbf{if}\;x \leq -0.00215:\\
\;\;\;\;\frac{t_1}{1 + \sqrt{\frac{0.015625 + \frac{-0.015625}{t_0 \cdot t_0}}{\left(0.125 + \frac{-0.125}{t_0}\right) \cdot \left(\frac{0.25}{1 + x \cdot x} + \left(0.25 + \frac{-0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}}\\

\mathbf{elif}\;x \leq 0.0018:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{t_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left({t_1}^{3}\right)}^{0.3333333333333333}}{t_2}\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if x < -0.00215

    1. Initial program 1.0

      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
    2. Simplified1.0

      \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof

      [Start]1.0

      \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]

      distribute-lft-in [=>]1.0

      \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]1.0

      \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}} \]

      associate-*r/ [=>]1.0

      \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]1.0

      \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}} \]
    3. Applied egg-rr1.0

      \[\leadsto \color{blue}{\frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
    4. Simplified0.1

      \[\leadsto \color{blue}{\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
      Proof

      [Start]1.0

      \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      sqr-neg [=>]1.0

      \[ \frac{1 - \color{blue}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      rem-square-sqrt [=>]0.1

      \[ \frac{1 - \color{blue}{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      associate--r+ [=>]0.1

      \[ \frac{\color{blue}{\left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]0.1

      \[ \frac{\color{blue}{0.5} - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
    5. Applied egg-rr0.1

      \[\leadsto \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\color{blue}{\frac{0.015625 - \frac{\frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\left(\frac{0.25}{1 + x \cdot x} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right)}}}} \]
    6. Simplified0.1

      \[\leadsto \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\color{blue}{\frac{0.015625 - \frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3} \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(\frac{0.25}{x \cdot x + 1} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}}} \]
      Proof

      [Start]0.1

      \[ \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\frac{0.015625 - \frac{\frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\left(\frac{0.25}{1 + x \cdot x} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right)}}} \]

      associate-/l/ [=>]0.1

      \[ \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\frac{0.015625 - \color{blue}{\frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3} \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}}{\left(\frac{0.25}{1 + x \cdot x} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right)}}} \]

      *-commutative [=>]0.1

      \[ \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\frac{0.015625 - \frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3} \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\color{blue}{\left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(\frac{0.25}{1 + x \cdot x} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}}} \]

      +-commutative [=>]0.1

      \[ \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\frac{0.015625 - \frac{0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3} \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\left(0.125 - \frac{0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(\frac{0.25}{\color{blue}{x \cdot x + 1}} + \left(0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}} \]

    if -0.00215 < x < 0.0018

    1. Initial program 30.3

      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
    2. Simplified30.3

      \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof

      [Start]30.3

      \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]

      distribute-lft-in [=>]30.3

      \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]30.3

      \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}} \]

      associate-*r/ [=>]30.3

      \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]30.3

      \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}} \]
    3. Applied egg-rr30.3

      \[\leadsto \color{blue}{\frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
    4. Simplified30.2

      \[\leadsto \color{blue}{\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
      Proof

      [Start]30.3

      \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      sqr-neg [=>]30.3

      \[ \frac{1 - \color{blue}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      rem-square-sqrt [=>]30.3

      \[ \frac{1 - \color{blue}{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      associate--r+ [=>]30.2

      \[ \frac{\color{blue}{\left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]30.2

      \[ \frac{\color{blue}{0.5} - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
    5. Taylor expanded in x around 0 0.0

      \[\leadsto \frac{\color{blue}{0.25 \cdot {x}^{2} + -0.1875 \cdot {x}^{4}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
    6. Simplified0.0

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof

      [Start]0.0

      \[ \frac{0.25 \cdot {x}^{2} + -0.1875 \cdot {x}^{4}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      fma-def [=>]0.0

      \[ \frac{\color{blue}{\mathsf{fma}\left(0.25, {x}^{2}, -0.1875 \cdot {x}^{4}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      unpow2 [=>]0.0

      \[ \frac{\mathsf{fma}\left(0.25, \color{blue}{x \cdot x}, -0.1875 \cdot {x}^{4}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

    if 0.0018 < x

    1. Initial program 1.0

      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
    2. Simplified1.0

      \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof

      [Start]1.0

      \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]

      distribute-lft-in [=>]1.0

      \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]1.0

      \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}} \]

      associate-*r/ [=>]1.0

      \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]1.0

      \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}} \]
    3. Applied egg-rr1.1

      \[\leadsto \color{blue}{\frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
    4. Simplified0.1

      \[\leadsto \color{blue}{\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
      Proof

      [Start]1.1

      \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      sqr-neg [=>]1.1

      \[ \frac{1 - \color{blue}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      rem-square-sqrt [=>]0.1

      \[ \frac{1 - \color{blue}{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      associate--r+ [=>]0.1

      \[ \frac{\color{blue}{\left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]0.1

      \[ \frac{\color{blue}{0.5} - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
    5. Applied egg-rr0.1

      \[\leadsto \frac{\color{blue}{{\left({\left(0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{0.3333333333333333}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.00215:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{\frac{0.015625 + \frac{-0.015625}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3} \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}}{\left(0.125 + \frac{-0.125}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(\frac{0.25}{1 + x \cdot x} + \left(0.25 + \frac{-0.25}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}}\\ \mathbf{elif}\;x \leq 0.0018:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left({\left(0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{0.3333333333333333}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\\ \end{array} \]

Alternatives

Alternative 1
Error0.1
Cost47236
\[\begin{array}{l} t_0 := 0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\\ t_1 := 1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \mathbf{if}\;x \leq -0.00215:\\ \;\;\;\;\frac{t_0}{1 + \sqrt{\frac{0.0625 + \frac{-0.125}{2 \cdot \left(\mathsf{hypot}\left(1, x\right) \cdot {\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}\right)}}{t_0 \cdot \left(0.25 + \frac{0.25}{\mathsf{fma}\left(x, x, 1\right)}\right)}}}\\ \mathbf{elif}\;x \leq 0.0018:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left({t_0}^{3}\right)}^{0.3333333333333333}}{t_1}\\ \end{array} \]
Alternative 2
Error0.1
Cost39684
\[\begin{array}{l} t_0 := 1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0005:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left({\left(0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{0.3333333333333333}}{t_0}\\ \end{array} \]
Alternative 3
Error0.1
Cost33284
\[\begin{array}{l} t_0 := 1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0005:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, x \cdot x, -0.1875 \cdot {x}^{4}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{t_0}\\ \end{array} \]
Alternative 4
Error0.1
Cost26756
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0005:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\\ \end{array} \]
Alternative 5
Error0.6
Cost19908
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0005:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \end{array} \]
Alternative 6
Error0.5
Cost13960
\[\begin{array}{l} \mathbf{if}\;x \leq -0.0024:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \mathbf{elif}\;x \leq 0.65:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{x}}}\\ \end{array} \]
Alternative 7
Error0.8
Cost13316
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 8
Error0.6
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{1 + \sqrt{0.5 + \frac{-0.5}{x}}}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 9
Error1.3
Cost6857
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1 \lor \neg \left(x \leq 1.1\right):\\ \;\;\;\;1 - \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \end{array} \]
Alternative 10
Error24.8
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{2}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot x\right) \cdot -0.0859375\right)\\ \mathbf{else}:\\ \;\;\;\;0.25\\ \end{array} \]
Alternative 11
Error24.9
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.4:\\ \;\;\;\;0.25\\ \mathbf{elif}\;x \leq 1.4:\\ \;\;\;\;0.125 \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;0.25\\ \end{array} \]
Alternative 12
Error24.9
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{2}\\ \mathbf{elif}\;x \leq 1.4:\\ \;\;\;\;0.125 \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;0.25\\ \end{array} \]
Alternative 13
Error39.9
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-77}:\\ \;\;\;\;0.25\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-77}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25\\ \end{array} \]
Alternative 14
Error46.4
Cost64
\[0 \]

Error

Reproduce

herbie shell --seed 2023016 
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))