?

Average Error: 15.8 → 0.2
Time: 29.4s
Precision: binary64
Cost: 101188

?

\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
\[\begin{array}{l} t_0 := \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\\ t_1 := 1 - t_0\\ t_2 := t_0 + -1\\ \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\ \;\;\;\;\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.34375 \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + 0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.26953125 \cdot {x}^{6}\right)}{\sqrt{2}}\right)\right) - 0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t_1}}{t_1 \cdot t_1} \cdot \left(t_1 \cdot \left(\left(t_1 \cdot t_2\right) \cdot t_2\right)\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 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x))))))
        (t_1 (- 1.0 t_0))
        (t_2 (+ t_0 -1.0)))
   (if (<= (hypot 1.0 x) 2.0)
     (-
      (+
       (* -0.5 (/ (* (sqrt 0.5) (* 0.34375 (pow x 4.0))) (sqrt 2.0)))
       (+
        (* 0.25 (/ (* (sqrt 0.5) (pow x 2.0)) (sqrt 2.0)))
        (* 0.5 (/ (* (sqrt 0.5) (* 0.26953125 (pow x 6.0))) (sqrt 2.0)))))
      0.0)
     (* (/ (/ 1.0 t_1) (* t_1 t_1)) (* t_1 (* (* t_1 t_2) 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 = sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
	double t_1 = 1.0 - t_0;
	double t_2 = t_0 + -1.0;
	double tmp;
	if (hypot(1.0, x) <= 2.0) {
		tmp = ((-0.5 * ((sqrt(0.5) * (0.34375 * pow(x, 4.0))) / sqrt(2.0))) + ((0.25 * ((sqrt(0.5) * pow(x, 2.0)) / sqrt(2.0))) + (0.5 * ((sqrt(0.5) * (0.26953125 * pow(x, 6.0))) / sqrt(2.0))))) - 0.0;
	} else {
		tmp = ((1.0 / t_1) / (t_1 * t_1)) * (t_1 * ((t_1 * t_2) * t_2));
	}
	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 = Math.sqrt((0.5 * (1.0 + (1.0 / Math.hypot(1.0, x)))));
	double t_1 = 1.0 - t_0;
	double t_2 = t_0 + -1.0;
	double tmp;
	if (Math.hypot(1.0, x) <= 2.0) {
		tmp = ((-0.5 * ((Math.sqrt(0.5) * (0.34375 * Math.pow(x, 4.0))) / Math.sqrt(2.0))) + ((0.25 * ((Math.sqrt(0.5) * Math.pow(x, 2.0)) / Math.sqrt(2.0))) + (0.5 * ((Math.sqrt(0.5) * (0.26953125 * Math.pow(x, 6.0))) / Math.sqrt(2.0))))) - 0.0;
	} else {
		tmp = ((1.0 / t_1) / (t_1 * t_1)) * (t_1 * ((t_1 * t_2) * t_2));
	}
	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 = math.sqrt((0.5 * (1.0 + (1.0 / math.hypot(1.0, x)))))
	t_1 = 1.0 - t_0
	t_2 = t_0 + -1.0
	tmp = 0
	if math.hypot(1.0, x) <= 2.0:
		tmp = ((-0.5 * ((math.sqrt(0.5) * (0.34375 * math.pow(x, 4.0))) / math.sqrt(2.0))) + ((0.25 * ((math.sqrt(0.5) * math.pow(x, 2.0)) / math.sqrt(2.0))) + (0.5 * ((math.sqrt(0.5) * (0.26953125 * math.pow(x, 6.0))) / math.sqrt(2.0))))) - 0.0
	else:
		tmp = ((1.0 / t_1) / (t_1 * t_1)) * (t_1 * ((t_1 * t_2) * 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 = sqrt(Float64(0.5 * Float64(1.0 + Float64(1.0 / hypot(1.0, x)))))
	t_1 = Float64(1.0 - t_0)
	t_2 = Float64(t_0 + -1.0)
	tmp = 0.0
	if (hypot(1.0, x) <= 2.0)
		tmp = Float64(Float64(Float64(-0.5 * Float64(Float64(sqrt(0.5) * Float64(0.34375 * (x ^ 4.0))) / sqrt(2.0))) + Float64(Float64(0.25 * Float64(Float64(sqrt(0.5) * (x ^ 2.0)) / sqrt(2.0))) + Float64(0.5 * Float64(Float64(sqrt(0.5) * Float64(0.26953125 * (x ^ 6.0))) / sqrt(2.0))))) - 0.0);
	else
		tmp = Float64(Float64(Float64(1.0 / t_1) / Float64(t_1 * t_1)) * Float64(t_1 * Float64(Float64(t_1 * t_2) * t_2)));
	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 = sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
	t_1 = 1.0 - t_0;
	t_2 = t_0 + -1.0;
	tmp = 0.0;
	if (hypot(1.0, x) <= 2.0)
		tmp = ((-0.5 * ((sqrt(0.5) * (0.34375 * (x ^ 4.0))) / sqrt(2.0))) + ((0.25 * ((sqrt(0.5) * (x ^ 2.0)) / sqrt(2.0))) + (0.5 * ((sqrt(0.5) * (0.26953125 * (x ^ 6.0))) / sqrt(2.0))))) - 0.0;
	else
		tmp = ((1.0 / t_1) / (t_1 * t_1)) * (t_1 * ((t_1 * t_2) * t_2));
	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[Sqrt[N[(0.5 * N[(1.0 + N[(1.0 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + -1.0), $MachinePrecision]}, If[LessEqual[N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision], 2.0], N[(N[(N[(-0.5 * N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(0.34375 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.25 * N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(0.26953125 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.0), $MachinePrecision], N[(N[(N[(1.0 / t$95$1), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$1 * t$95$2), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\begin{array}{l}
t_0 := \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\\
t_1 := 1 - t_0\\
t_2 := t_0 + -1\\
\mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\
\;\;\;\;\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.34375 \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + 0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.26953125 \cdot {x}^{6}\right)}{\sqrt{2}}\right)\right) - 0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t_1}}{t_1 \cdot t_1} \cdot \left(t_1 \cdot \left(\left(t_1 \cdot t_2\right) \cdot t_2\right)\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if (hypot.f64 1 x) < 2

    1. Initial program 30.4

      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
    2. Taylor expanded in x around 0 61.5

      \[\leadsto \color{blue}{\left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + \left(1 + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right)\right)\right) - \sqrt{2} \cdot \sqrt{0.5}} \]
    3. Simplified0.4

      \[\leadsto \color{blue}{\left(0.5 \cdot \frac{\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{2} + 0.3125\right) \cdot \left(\sqrt{0.5} \cdot {x}^{6}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + -0.5 \cdot \frac{\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot \left(\sqrt{0.5} \cdot {x}^{4}\right)}{\sqrt{2}}\right)\right) - 0} \]
      Proof

      [Start]61.5

      \[ \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + \left(1 + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right)\right)\right) - \sqrt{2} \cdot \sqrt{0.5} \]

      rational.json-simplify-41 [=>]61.5

      \[ \color{blue}{\left(1 + \left(\left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right) + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right)} - \sqrt{2} \cdot \sqrt{0.5} \]

      rational.json-simplify-17 [=>]61.5

      \[ \color{blue}{\left(\left(\left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right) + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right) - -1\right)} - \sqrt{2} \cdot \sqrt{0.5} \]

      exponential.json-simplify-20 [=>]30.7

      \[ \left(\left(\left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right) + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right) - -1\right) - \color{blue}{\sqrt{0.5 \cdot 2}} \]

      metadata-eval [=>]30.7

      \[ \left(\left(\left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right) + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right) - -1\right) - \sqrt{\color{blue}{1}} \]

      metadata-eval [=>]30.7

      \[ \left(\left(\left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.25 \cdot \frac{0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}}{{\left(\sqrt{2}\right)}^{2}} + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + -0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - {\left(\frac{-0.25}{\sqrt{2}}\right)}^{2}\right) \cdot {x}^{4}\right)}{\sqrt{2}}\right) + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right) - -1\right) - \color{blue}{1} \]
    4. Taylor expanded in x around 0 0.4

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right)} - 0 \]
    5. Simplified0.4

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.34375 \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + 0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.26953125 \cdot {x}^{6}\right)}{\sqrt{2}}\right)\right)} - 0 \]
      Proof

      [Start]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      rational.json-simplify-2 [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \color{blue}{\frac{1}{{\left(\sqrt{2}\right)}^{2}} \cdot 0.0625}\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      exponential.json-simplify-24 [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \frac{1}{\color{blue}{\sqrt{{2}^{2}}}} \cdot 0.0625\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      metadata-eval [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \frac{1}{\sqrt{\color{blue}{4}}} \cdot 0.0625\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      metadata-eval [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \frac{1}{\color{blue}{2}} \cdot 0.0625\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      metadata-eval [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \color{blue}{0.5} \cdot 0.0625\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      metadata-eval [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(0.375 - \color{blue}{0.03125}\right) \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

      metadata-eval [=>]0.4

      \[ \left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\color{blue}{0.34375} \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.5 \cdot \frac{\sqrt{0.5} \cdot \left(\left(-0.125 \cdot \left(0.375 - 0.0625 \cdot \frac{1}{{\left(\sqrt{2}\right)}^{2}}\right) + 0.3125\right) \cdot {x}^{6}\right)}{\sqrt{2}} + 0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\right)\right) - 0 \]

    if 2 < (hypot.f64 1 x)

    1. Initial program 1.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\ \;\;\;\;\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.34375 \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + 0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.26953125 \cdot {x}^{6}\right)}{\sqrt{2}}\right)\right) - 0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\left(1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)} \cdot \left(\left(1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(\left(\left(1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right) \cdot \left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} + -1\right)\right) \cdot \left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} + -1\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error0.4
Cost59912
\[\begin{array}{l} t_0 := {\left(1 - \sqrt{0.5}\right)}^{2}\\ t_1 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ t_2 := \frac{1}{t_1}\\ t_3 := t_1 \cdot t_1\\ t_4 := t_0 \cdot t_3\\ \mathbf{if}\;x \leq -1.2:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_0}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\left(-0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.34375 \cdot {x}^{4}\right)}{\sqrt{2}} + \left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + 0.5 \cdot \frac{\sqrt{0.5} \cdot \left(0.26953125 \cdot {x}^{6}\right)}{\sqrt{2}}\right)\right) - 0\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_3}\\ \end{array} \]
Alternative 2
Error0.4
Cost59656
\[\begin{array}{l} t_0 := {\left(1 - \sqrt{0.5}\right)}^{2}\\ t_1 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ t_2 := \frac{1}{t_1}\\ t_3 := t_1 \cdot t_1\\ t_4 := t_0 \cdot t_3\\ \mathbf{if}\;x \leq -1.2:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_0}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\left(0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + \left(-0.171875 \cdot \frac{\sqrt{0.5} \cdot {x}^{4}}{\sqrt{2}} + 0.134765625 \cdot \frac{\sqrt{0.5} \cdot {x}^{6}}{\sqrt{2}}\right)\right) - 0\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_3}\\ \end{array} \]
Alternative 3
Error0.5
Cost48648
\[\begin{array}{l} t_0 := {\left(1 - \sqrt{0.5}\right)}^{2}\\ t_1 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ t_2 := \frac{1}{t_1}\\ t_3 := t_1 \cdot t_1\\ t_4 := t_0 \cdot t_3\\ \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_0}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + -0.171875 \cdot \frac{\sqrt{0.5} \cdot {x}^{4}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \frac{t_2}{t_3}\\ \end{array} \]
Alternative 4
Error0.6
Cost47556
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ t_1 := {t_0}^{2}\\ t_2 := t_0 \cdot t_0\\ t_3 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;\left(t_1 \cdot \left(t_3 \cdot t_3\right)\right) \cdot \frac{\frac{1}{t_3}}{t_1}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + -0.171875 \cdot \frac{\sqrt{0.5} \cdot {x}^{4}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t_0}}{t_2} \cdot \left(t_2 \cdot t_2\right)\\ \end{array} \]
Alternative 5
Error0.8
Cost46920
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ t_1 := t_0 \cdot t_0\\ \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + -0.171875 \cdot \frac{\sqrt{0.5} \cdot {x}^{4}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t_0}}{t_1} \cdot \left(t_1 \cdot t_1\right)\\ \end{array} \]
Alternative 6
Error0.8
Cost39752
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ t_1 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.02:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}} + -0.171875 \cdot \frac{\sqrt{0.5} \cdot {x}^{4}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;{t_0}^{4} \cdot \frac{\frac{1}{t_1}}{t_1 \cdot t_0}\\ \end{array} \]
Alternative 7
Error0.8
Cost34184
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ t_1 := 1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{if}\;x \leq -0.000155:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;{t_0}^{4} \cdot \frac{\frac{1}{t_1}}{t_1 \cdot t_0}\\ \end{array} \]
Alternative 8
Error0.8
Cost26308
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1:\\ \;\;\;\;0.25 \cdot \frac{\sqrt{0.5} \cdot {x}^{2}}{\sqrt{2}}\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\\ \end{array} \]
Alternative 9
Error15.8
Cost13440
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
Alternative 10
Error16.4
Cost7240
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{x}\right)}\\ \end{array} \]
Alternative 11
Error16.5
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;1 - \sqrt{0.5 \cdot \left(1 + \frac{-1}{x}\right)}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-77}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5}\\ \end{array} \]
Alternative 12
Error16.6
Cost6856
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{-77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-77}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error46.6
Cost64
\[0 \]

Error

Reproduce?

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