?

Average Accuracy: 76.0% → 99.9%
Time: 24.0s
Precision: binary64
Cost: 33736

?

\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
\[\begin{array}{l} t_0 := \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\\ t_1 := 0.5 + t_0\\ t_2 := \sqrt{t_1}\\ \mathbf{if}\;x \leq -0.0025:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + t_2}\\ \mathbf{elif}\;x \leq 0.00235:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - {t_1}^{1.5}}{t_0 + \left(t_2 + 1.5\right)}\\ \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 (/ 0.5 (hypot 1.0 x))) (t_1 (+ 0.5 t_0)) (t_2 (sqrt t_1)))
   (if (<= x -0.0025)
     (/ (+ 0.5 (/ -0.5 (hypot 1.0 x))) (+ 1.0 t_2))
     (if (<= x 0.00235)
       (* (* x x) (+ (* (* x x) -0.0859375) 0.125))
       (/ (- 1.0 (pow t_1 1.5)) (+ t_0 (+ t_2 1.5)))))))
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 = 0.5 / hypot(1.0, x);
	double t_1 = 0.5 + t_0;
	double t_2 = sqrt(t_1);
	double tmp;
	if (x <= -0.0025) {
		tmp = (0.5 + (-0.5 / hypot(1.0, x))) / (1.0 + t_2);
	} else if (x <= 0.00235) {
		tmp = (x * x) * (((x * x) * -0.0859375) + 0.125);
	} else {
		tmp = (1.0 - pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5));
	}
	return tmp;
}
public static double code(double x) {
	return 1.0 - Math.sqrt((0.5 * (1.0 + (1.0 / Math.hypot(1.0, x)))));
}
public static double code(double x) {
	double t_0 = 0.5 / Math.hypot(1.0, x);
	double t_1 = 0.5 + t_0;
	double t_2 = Math.sqrt(t_1);
	double tmp;
	if (x <= -0.0025) {
		tmp = (0.5 + (-0.5 / Math.hypot(1.0, x))) / (1.0 + t_2);
	} else if (x <= 0.00235) {
		tmp = (x * x) * (((x * x) * -0.0859375) + 0.125);
	} else {
		tmp = (1.0 - Math.pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5));
	}
	return tmp;
}
def code(x):
	return 1.0 - math.sqrt((0.5 * (1.0 + (1.0 / math.hypot(1.0, x)))))
def code(x):
	t_0 = 0.5 / math.hypot(1.0, x)
	t_1 = 0.5 + t_0
	t_2 = math.sqrt(t_1)
	tmp = 0
	if x <= -0.0025:
		tmp = (0.5 + (-0.5 / math.hypot(1.0, x))) / (1.0 + t_2)
	elif x <= 0.00235:
		tmp = (x * x) * (((x * x) * -0.0859375) + 0.125)
	else:
		tmp = (1.0 - math.pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5))
	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 = Float64(0.5 / hypot(1.0, x))
	t_1 = Float64(0.5 + t_0)
	t_2 = sqrt(t_1)
	tmp = 0.0
	if (x <= -0.0025)
		tmp = Float64(Float64(0.5 + Float64(-0.5 / hypot(1.0, x))) / Float64(1.0 + t_2));
	elseif (x <= 0.00235)
		tmp = Float64(Float64(x * x) * Float64(Float64(Float64(x * x) * -0.0859375) + 0.125));
	else
		tmp = Float64(Float64(1.0 - (t_1 ^ 1.5)) / Float64(t_0 + Float64(t_2 + 1.5)));
	end
	return tmp
end
function tmp = code(x)
	tmp = 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
end
function tmp_2 = code(x)
	t_0 = 0.5 / hypot(1.0, x);
	t_1 = 0.5 + t_0;
	t_2 = sqrt(t_1);
	tmp = 0.0;
	if (x <= -0.0025)
		tmp = (0.5 + (-0.5 / hypot(1.0, x))) / (1.0 + t_2);
	elseif (x <= 0.00235)
		tmp = (x * x) * (((x * x) * -0.0859375) + 0.125);
	else
		tmp = (1.0 - (t_1 ^ 1.5)) / (t_0 + (t_2 + 1.5));
	end
	tmp_2 = 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[(0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[x, -0.0025], N[(N[(0.5 + N[(-0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00235], N[(N[(x * x), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * -0.0859375), $MachinePrecision] + 0.125), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Power[t$95$1, 1.5], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(t$95$2 + 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\begin{array}{l}
t_0 := \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\\
t_1 := 0.5 + t_0\\
t_2 := \sqrt{t_1}\\
\mathbf{if}\;x \leq -0.0025:\\
\;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + t_2}\\

\mathbf{elif}\;x \leq 0.00235:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - {t_1}^{1.5}}{t_0 + \left(t_2 + 1.5\right)}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

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

    1. Initial program 98.4%

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

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

      [Start]98.4

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

      distribute-lft-in [=>]98.4

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

      metadata-eval [=>]98.4

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

      associate-*r/ [=>]98.4

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

      metadata-eval [=>]98.4

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

      \[\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)}}}} \]
      Proof

      [Start]98.4

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

      sub-neg [=>]98.4

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

      flip-+ [=>]98.4

      \[ \color{blue}{\frac{1 \cdot 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 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}} \]

      metadata-eval [=>]98.4

      \[ \frac{\color{blue}{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 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      neg-sub0 [=>]98.4

      \[ \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 - \color{blue}{\left(0 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}} \]

      metadata-eval [<=]98.4

      \[ \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 - \left(\color{blue}{\log 1} - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      associate--r- [=>]98.4

      \[ \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)}{\color{blue}{\left(1 - \log 1\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]

      metadata-eval [=>]98.4

      \[ \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)}{\left(1 - \color{blue}{0}\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]

      metadata-eval [=>]98.4

      \[ \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)}{\color{blue}{1} + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
    4. Simplified99.9%

      \[\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]98.4

      \[ \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 [=>]98.4

      \[ \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 [=>]99.9

      \[ \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+ [=>]99.9

      \[ \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 [=>]99.9

      \[ \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)}}} \]

    if -0.00250000000000000005 < x < 0.00235000000000000009

    1. Initial program 53.9%

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

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

      [Start]53.9

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

      distribute-lft-in [=>]53.9

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

      metadata-eval [=>]53.9

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

      associate-*r/ [=>]53.9

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

      metadata-eval [=>]53.9

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

      \[\leadsto \color{blue}{0.125 \cdot {x}^{2} + -0.0859375 \cdot {x}^{4}} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.125, x \cdot x, -0.0859375 \cdot {x}^{4}\right)} \]
      Proof

      [Start]99.9

      \[ 0.125 \cdot {x}^{2} + -0.0859375 \cdot {x}^{4} \]

      fma-def [=>]99.9

      \[ \color{blue}{\mathsf{fma}\left(0.125, {x}^{2}, -0.0859375 \cdot {x}^{4}\right)} \]

      unpow2 [=>]99.9

      \[ \mathsf{fma}\left(0.125, \color{blue}{x \cdot x}, -0.0859375 \cdot {x}^{4}\right) \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(0.125 \cdot x\right) \cdot x + -0.0859375 \cdot {x}^{4}} \]
      Proof

      [Start]99.9

      \[ \mathsf{fma}\left(0.125, x \cdot x, -0.0859375 \cdot {x}^{4}\right) \]

      fma-udef [=>]99.9

      \[ \color{blue}{0.125 \cdot \left(x \cdot x\right) + -0.0859375 \cdot {x}^{4}} \]

      associate-*r* [=>]100.0

      \[ \color{blue}{\left(0.125 \cdot x\right) \cdot x} + -0.0859375 \cdot {x}^{4} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(-0.0859375 \cdot \left(x \cdot x\right) + 0.125\right)} \]
      Proof

      [Start]100.0

      \[ \left(0.125 \cdot x\right) \cdot x + -0.0859375 \cdot {x}^{4} \]

      +-commutative [=>]100.0

      \[ \color{blue}{-0.0859375 \cdot {x}^{4} + \left(0.125 \cdot x\right) \cdot x} \]

      *-commutative [=>]100.0

      \[ \color{blue}{{x}^{4} \cdot -0.0859375} + \left(0.125 \cdot x\right) \cdot x \]

      add-sqr-sqrt [=>]100.0

      \[ \color{blue}{\left(\sqrt{{x}^{4}} \cdot \sqrt{{x}^{4}}\right)} \cdot -0.0859375 + \left(0.125 \cdot x\right) \cdot x \]

      associate-*l* [=>]100.0

      \[ \color{blue}{\sqrt{{x}^{4}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right)} + \left(0.125 \cdot x\right) \cdot x \]

      sqrt-pow1 [=>]100.0

      \[ \color{blue}{{x}^{\left(\frac{4}{2}\right)}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x \]

      metadata-eval [=>]100.0

      \[ {x}^{\color{blue}{2}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x \]

      unpow2 [=>]100.0

      \[ \color{blue}{\left(x \cdot x\right)} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x \]

      associate-*l* [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \color{blue}{0.125 \cdot \left(x \cdot x\right)} \]

      *-commutative [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \color{blue}{\left(x \cdot x\right) \cdot 0.125} \]

      distribute-lft-out [=>]99.9

      \[ \color{blue}{\left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375 + 0.125\right)} \]

      sqrt-pow1 [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left(\color{blue}{{x}^{\left(\frac{4}{2}\right)}} \cdot -0.0859375 + 0.125\right) \]

      metadata-eval [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left({x}^{\color{blue}{2}} \cdot -0.0859375 + 0.125\right) \]

      unpow2 [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot -0.0859375 + 0.125\right) \]

      *-commutative [=>]99.9

      \[ \left(x \cdot x\right) \cdot \left(\color{blue}{-0.0859375 \cdot \left(x \cdot x\right)} + 0.125\right) \]

    if 0.00235000000000000009 < x

    1. Initial program 98.4%

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

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

      [Start]98.4

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

      distribute-lft-in [=>]98.4

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

      metadata-eval [=>]98.4

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

      associate-*r/ [=>]98.4

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

      metadata-eval [=>]98.4

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

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

      [Start]98.4

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

      flip3-- [=>]97.5

      \[ \color{blue}{\frac{{1}^{3} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}} \]

      div-inv [=>]97.5

      \[ \color{blue}{\left({1}^{3} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}\right) \cdot \frac{1}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}} \]

      metadata-eval [=>]97.5

      \[ \left(\color{blue}{1} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}\right) \cdot \frac{1}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      sqrt-pow2 [=>]98.4

      \[ \left(1 - \color{blue}{{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{\left(\frac{3}{2}\right)}}\right) \cdot \frac{1}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      metadata-eval [=>]98.4

      \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{\color{blue}{1.5}}\right) \cdot \frac{1}{1 \cdot 1 + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      metadata-eval [=>]98.4

      \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{\color{blue}{1} + \left(\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 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)} \]

      add-sqr-sqrt [<=]98.4

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

      *-un-lft-identity [<=]98.4

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

      associate-+r+ [=>]98.4

      \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{\color{blue}{\left(1 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \]
    4. Simplified99.9%

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

      [Start]98.4

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

      associate-*r/ [=>]99.9

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

      *-rgt-identity [=>]99.9

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

      associate-+r+ [=>]99.9

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

      +-commutative [=>]99.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0025:\\ \;\;\;\;\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)}}}\\ \mathbf{elif}\;x \leq 0.00235:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}}{\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1.5\right)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.8%
Cost26756
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\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 2
Accuracy99.9%
Cost21064
\[\begin{array}{l} t_0 := 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\\ t_1 := 1 + \sqrt{t_0}\\ \mathbf{if}\;x \leq -0.0025:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{t_1}\\ \mathbf{elif}\;x \leq 0.0021:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25 + \frac{-0.25}{1 + x \cdot x}}{t_0}}{t_1}\\ \end{array} \]
Alternative 3
Accuracy99.9%
Cost20552
\[\begin{array}{l} t_0 := \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.0025:\\ \;\;\;\;\frac{0.5 + t_0}{t_1}\\ \mathbf{elif}\;x \leq 0.00235:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(-0.5 + t_0\right)}{t_1}\\ \end{array} \]
Alternative 4
Accuracy99.0%
Cost20164
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\\ \end{array} \]
Alternative 5
Accuracy99.0%
Cost19908
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \end{array} \]
Alternative 6
Accuracy99.1%
Cost7496
\[\begin{array}{l} t_0 := 0.5 + \frac{-0.5}{x}\\ \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;1 - \sqrt{t_0}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{1 + \sqrt{0.5 - \frac{-0.5}{x}}}\\ \end{array} \]
Alternative 7
Accuracy98.7%
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1 \lor \neg \left(x \leq 1.1\right):\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \end{array} \]
Alternative 8
Accuracy98.7%
Cost6984
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{-0.5}{x}}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 9
Accuracy98.0%
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(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\ \end{array} \]
Alternative 10
Accuracy61.4%
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -1.45:\\ \;\;\;\;0.25\\ \mathbf{elif}\;x \leq 1.75:\\ \;\;\;\;\left(x \cdot x\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 - \frac{-0.5}{x}}{2}\\ \end{array} \]
Alternative 11
Accuracy61.4%
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -1.75:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{x}}{2}\\ \mathbf{elif}\;x \leq 1.75:\\ \;\;\;\;\left(x \cdot x\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 - \frac{-0.5}{x}}{2}\\ \end{array} \]
Alternative 12
Accuracy61.4%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.45:\\ \;\;\;\;0.25\\ \mathbf{elif}\;x \leq 1.4:\\ \;\;\;\;\left(x \cdot x\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;0.25\\ \end{array} \]
Alternative 13
Accuracy59.7%
Cost576
\[\frac{1}{5.5 + \frac{8}{x \cdot x}} \]
Alternative 14
Accuracy13.3%
Cost64
\[0.25 \]

Error

Reproduce?

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