Average Error: 15.5 → 0.1
Time: 13.9s
Precision: binary64
Cost: 33668
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
\[\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.026370478954838624:\\ \;\;\;\;\frac{0.5}{t_1} + \frac{\frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{t_1}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t_0}{t_1}\\ \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 (/ 0.5 (hypot 1.0 x)))) (t_1 (+ 1.0 (sqrt t_0))))
   (if (<= x -0.026370478954838624)
     (+ (/ 0.5 t_1) (/ (/ -0.5 (hypot 1.0 x)) t_1))
     (if (<= x 0.00033959049661280835)
       (+
        (* -0.0859375 (pow x 4.0))
        (fma (* x x) 0.125 (* 0.0673828125 (pow x 6.0))))
       (/ (- 1.0 t_0) t_1)))))
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 + (0.5 / hypot(1.0, x));
	double t_1 = 1.0 + sqrt(t_0);
	double tmp;
	if (x <= -0.026370478954838624) {
		tmp = (0.5 / t_1) + ((-0.5 / hypot(1.0, x)) / t_1);
	} else if (x <= 0.00033959049661280835) {
		tmp = (-0.0859375 * pow(x, 4.0)) + fma((x * x), 0.125, (0.0673828125 * pow(x, 6.0)));
	} else {
		tmp = (1.0 - t_0) / t_1;
	}
	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 + Float64(0.5 / hypot(1.0, x)))
	t_1 = Float64(1.0 + sqrt(t_0))
	tmp = 0.0
	if (x <= -0.026370478954838624)
		tmp = Float64(Float64(0.5 / t_1) + Float64(Float64(-0.5 / hypot(1.0, x)) / t_1));
	elseif (x <= 0.00033959049661280835)
		tmp = Float64(Float64(-0.0859375 * (x ^ 4.0)) + fma(Float64(x * x), 0.125, Float64(0.0673828125 * (x ^ 6.0))));
	else
		tmp = Float64(Float64(1.0 - t_0) / t_1);
	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[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.026370478954838624], N[(N[(0.5 / t$95$1), $MachinePrecision] + N[(N[(-0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00033959049661280835], N[(N[(-0.0859375 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * 0.125 + N[(0.0673828125 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\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.026370478954838624:\\
\;\;\;\;\frac{0.5}{t_1} + \frac{\frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{t_1}\\

\mathbf{elif}\;x \leq 0.00033959049661280835:\\
\;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - t_0}{t_1}\\


\end{array}

Error

Derivation

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

    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
      (-.f64 1 (sqrt.f64 (+.f64 1/2 (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (/.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 (hypot.f64 1 x)) 1/2))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 1/2 (+.f64 1 (/.f64 1 (hypot.f64 1 x))))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr0.0

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

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

    if -0.0263704789548386241 < x < 3.3959049661280835e-4

    1. Initial program 30.6

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

      \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof
      (-.f64 1 (sqrt.f64 (+.f64 1/2 (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (/.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 (hypot.f64 1 x)) 1/2))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 1/2 (+.f64 1 (/.f64 1 (hypot.f64 1 x))))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr30.6

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}} \]
    4. Taylor expanded in x around 0 33.6

      \[\leadsto \color{blue}{-0.6875 \cdot \left(e^{\log 0.125 + 2 \cdot \log x} \cdot {x}^{2}\right) + \left(0.5390625 \cdot \left(e^{\log 0.125 + 2 \cdot \log x} \cdot {x}^{4}\right) + e^{\log 0.125 + 2 \cdot \log x}\right)} \]
    5. Simplified0.0

      \[\leadsto \color{blue}{-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)} \]
      Proof
      (+.f64 (*.f64 -11/128 (pow.f64 x 4)) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (Rewrite<= metadata-eval (*.f64 -11/16 1/8)) (pow.f64 x 4)) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (*.f64 -11/16 (Rewrite<= rem-exp-log_binary64 (exp.f64 (log.f64 1/8)))) (pow.f64 x 4)) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -11/16 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x 4)))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x (Rewrite<= metadata-eval (*.f64 2 2))))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= pow-sqr_binary64 (*.f64 (pow.f64 x 2) (pow.f64 x 2))))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x 2)) (pow.f64 x 2)))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 x) 2)))) (pow.f64 x 2))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 84 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (exp.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 (log.f64 x))))) (pow.f64 x 2))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (Rewrite=> prod-exp_binary64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x))))) (pow.f64 x 2))) (fma.f64 (*.f64 x x) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) 1/8 (*.f64 69/1024 (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (Rewrite<= rem-exp-log_binary64 (exp.f64 (log.f64 1/8))) (*.f64 69/1024 (pow.f64 x 6)))): 26 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 (Rewrite<= metadata-eval (*.f64 69/128 1/8)) (pow.f64 x 6)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 (*.f64 69/128 (Rewrite<= rem-exp-log_binary64 (exp.f64 (log.f64 1/8)))) (pow.f64 x 6)))): 8 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (Rewrite<= associate-*r*_binary64 (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x 6)))))): 1 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x (Rewrite<= metadata-eval (*.f64 2 3))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= pow-sqr_binary64 (*.f64 (pow.f64 x 3) (pow.f64 x 3))))))): 0 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= cube-prod_binary64 (pow.f64 (*.f64 x x) 3)))))): 0 points increase in error, 2 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) 3))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= cube-unmult_binary64 (*.f64 (pow.f64 x 2) (*.f64 (pow.f64 x 2) (pow.f64 x 2)))))))): 0 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (*.f64 (pow.f64 x 2) (Rewrite=> pow-sqr_binary64 (pow.f64 x (*.f64 2 2)))))))): 3 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (exp.f64 (log.f64 1/8)) (*.f64 (pow.f64 x 2) (pow.f64 x (Rewrite=> metadata-eval 4))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (pow.f64 x 2)) (pow.f64 x 4)))))): 2 points increase in error, 1 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 x) 2)))) (pow.f64 x 4))))): 4 points increase in error, 4 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (*.f64 (exp.f64 (log.f64 1/8)) (exp.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 (log.f64 x))))) (pow.f64 x 4))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (fma.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8)) (*.f64 69/128 (*.f64 (Rewrite=> prod-exp_binary64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x))))) (pow.f64 x 4))))): 1 points increase in error, 6 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (pow.f64 x 2) (exp.f64 (log.f64 1/8))) (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (+.f64 (*.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 x) 2))) (exp.f64 (log.f64 1/8))) (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4))))): 26 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (+.f64 (*.f64 (exp.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 (log.f64 x)))) (exp.f64 (log.f64 1/8))) (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (+.f64 (Rewrite<= exp-sum_binary64 (exp.f64 (+.f64 (*.f64 2 (log.f64 x)) (log.f64 1/8)))) (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4))))): 16 points increase in error, 11 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (+.f64 (exp.f64 (Rewrite<= +-commutative_binary64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x))))) (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -11/16 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 2))) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 69/128 (*.f64 (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x)))) (pow.f64 x 4))) (exp.f64 (+.f64 (log.f64 1/8) (*.f64 2 (log.f64 x))))))): 0 points increase in error, 0 points decrease in error

    if 3.3959049661280835e-4 < x

    1. Initial program 1.1

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

      \[\leadsto \color{blue}{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \]
      Proof
      (-.f64 1 (sqrt.f64 (+.f64 1/2 (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (/.f64 1/2 (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (/.f64 (Rewrite<= metadata-eval (*.f64 1 1/2)) (hypot.f64 1 x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (+.f64 (*.f64 1 1/2) (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 (hypot.f64 1 x)) 1/2))))): 0 points increase in error, 0 points decrease in error
      (-.f64 1 (sqrt.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 1/2 (+.f64 1 (/.f64 1 (hypot.f64 1 x))))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr1.1

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

      \[\leadsto \color{blue}{\frac{1 - \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)}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.026370478954838624:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} + \frac{\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.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \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)}}}\\ \end{array} \]

Alternatives

Alternative 1
Error0.0
Cost27396
\[\begin{array}{l} t_0 := 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\\ \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0002:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25 + \frac{-0.25}{1 + x \cdot x}}{t_0}}{1 + \sqrt{t_0}}\\ \end{array} \]
Alternative 2
Error0.0
Cost26756
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 1.0002:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\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 3
Error0.0
Cost20552
\[\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.026370478954838624:\\ \;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{t_1}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t_0}{t_1}\\ \end{array} \]
Alternative 4
Error0.1
Cost20552
\[\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.026370478954838624:\\ \;\;\;\;\frac{1}{\frac{t_1}{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t_0}{t_1}\\ \end{array} \]
Alternative 5
Error1.0
Cost20296
\[\begin{array}{l} \mathbf{if}\;x \leq -464108242255813.94:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{1 + \sqrt{0.5 + \frac{-0.5}{x}}}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + \mathsf{fma}\left(x \cdot x, 0.125, 0.0673828125 \cdot {x}^{6}\right)\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \end{array} \]
Alternative 6
Error0.8
Cost13636
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + x \cdot \left(x \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 7
Error1.1
Cost13576
\[\begin{array}{l} \mathbf{if}\;x \leq -464108242255813.94:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{1 + \sqrt{0.5 + \frac{-0.5}{x}}}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + x \cdot \left(x \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\\ \end{array} \]
Alternative 8
Error1.0
Cost13316
\[\begin{array}{l} \mathbf{if}\;\mathsf{hypot}\left(1, x\right) \leq 2:\\ \;\;\;\;x \cdot \left(x \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 9
Error1.3
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq -464108242255813.94:\\ \;\;\;\;\frac{0.5 + \frac{0.5}{x}}{1 + \sqrt{0.5 + \frac{-0.5}{x}}}\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;-0.0859375 \cdot {x}^{4} + x \cdot \left(x \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
Alternative 10
Error1.8
Cost6856
\[\begin{array}{l} t_0 := 1 - \sqrt{0.5}\\ \mathbf{if}\;x \leq -464108242255813.94:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.00033959049661280835:\\ \;\;\;\;x \cdot \left(x \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error31.8
Cost320
\[x \cdot \left(x \cdot 0.125\right) \]
Alternative 12
Error46.8
Cost64
\[0 \]

Error

Reproduce

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