\[-1.79 \cdot 10^{+308} \leq x \land x \leq 1.79 \cdot 10^{+308}\]
\[\sqrt{1 + x} - {2}^{x}
\]
↓
\[\begin{array}{l}
t_0 := \sqrt{1 + x} - {2}^{x}\\
\mathbf{if}\;t_0 \leq -0.02:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(0.5 - \log 2\right) + \left(0.0625 - 0.16666666666666666 \cdot {\log 2}^{3}\right) \cdot {x}^{3}\right) - \left(0.125 + 0.5 \cdot {\log 2}^{2}\right) \cdot {x}^{2}\\
\end{array}
\]
(FPCore (x) :precision binary64 (- (sqrt (+ 1.0 x)) (pow 2.0 x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (- (sqrt (+ 1.0 x)) (pow 2.0 x))))
(if (<= t_0 -0.02)
t_0
(-
(+
(* x (- 0.5 (log 2.0)))
(* (- 0.0625 (* 0.16666666666666666 (pow (log 2.0) 3.0))) (pow x 3.0)))
(* (+ 0.125 (* 0.5 (pow (log 2.0) 2.0))) (pow x 2.0))))))
double code(double x) {
return sqrt((1.0 + x)) - pow(2.0, x);
}
↓
double code(double x) {
double t_0 = sqrt((1.0 + x)) - pow(2.0, x);
double tmp;
if (t_0 <= -0.02) {
tmp = t_0;
} else {
tmp = ((x * (0.5 - log(2.0))) + ((0.0625 - (0.16666666666666666 * pow(log(2.0), 3.0))) * pow(x, 3.0))) - ((0.125 + (0.5 * pow(log(2.0), 2.0))) * pow(x, 2.0));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = sqrt((1.0d0 + x)) - (2.0d0 ** x)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 + x)) - (2.0d0 ** x)
if (t_0 <= (-0.02d0)) then
tmp = t_0
else
tmp = ((x * (0.5d0 - log(2.0d0))) + ((0.0625d0 - (0.16666666666666666d0 * (log(2.0d0) ** 3.0d0))) * (x ** 3.0d0))) - ((0.125d0 + (0.5d0 * (log(2.0d0) ** 2.0d0))) * (x ** 2.0d0))
end if
code = tmp
end function
public static double code(double x) {
return Math.sqrt((1.0 + x)) - Math.pow(2.0, x);
}
↓
public static double code(double x) {
double t_0 = Math.sqrt((1.0 + x)) - Math.pow(2.0, x);
double tmp;
if (t_0 <= -0.02) {
tmp = t_0;
} else {
tmp = ((x * (0.5 - Math.log(2.0))) + ((0.0625 - (0.16666666666666666 * Math.pow(Math.log(2.0), 3.0))) * Math.pow(x, 3.0))) - ((0.125 + (0.5 * Math.pow(Math.log(2.0), 2.0))) * Math.pow(x, 2.0));
}
return tmp;
}
def code(x):
return math.sqrt((1.0 + x)) - math.pow(2.0, x)
↓
def code(x):
t_0 = math.sqrt((1.0 + x)) - math.pow(2.0, x)
tmp = 0
if t_0 <= -0.02:
tmp = t_0
else:
tmp = ((x * (0.5 - math.log(2.0))) + ((0.0625 - (0.16666666666666666 * math.pow(math.log(2.0), 3.0))) * math.pow(x, 3.0))) - ((0.125 + (0.5 * math.pow(math.log(2.0), 2.0))) * math.pow(x, 2.0))
return tmp
function code(x)
return Float64(sqrt(Float64(1.0 + x)) - (2.0 ^ x))
end
↓
function code(x)
t_0 = Float64(sqrt(Float64(1.0 + x)) - (2.0 ^ x))
tmp = 0.0
if (t_0 <= -0.02)
tmp = t_0;
else
tmp = Float64(Float64(Float64(x * Float64(0.5 - log(2.0))) + Float64(Float64(0.0625 - Float64(0.16666666666666666 * (log(2.0) ^ 3.0))) * (x ^ 3.0))) - Float64(Float64(0.125 + Float64(0.5 * (log(2.0) ^ 2.0))) * (x ^ 2.0)));
end
return tmp
end
function tmp = code(x)
tmp = sqrt((1.0 + x)) - (2.0 ^ x);
end
↓
function tmp_2 = code(x)
t_0 = sqrt((1.0 + x)) - (2.0 ^ x);
tmp = 0.0;
if (t_0 <= -0.02)
tmp = t_0;
else
tmp = ((x * (0.5 - log(2.0))) + ((0.0625 - (0.16666666666666666 * (log(2.0) ^ 3.0))) * (x ^ 3.0))) - ((0.125 + (0.5 * (log(2.0) ^ 2.0))) * (x ^ 2.0));
end
tmp_2 = tmp;
end
code[x_] := N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Power[2.0, x], $MachinePrecision]), $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Power[2.0, x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.02], t$95$0, N[(N[(N[(x * N[(0.5 - N[Log[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0625 - N[(0.16666666666666666 * N[Power[N[Log[2.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(0.125 + N[(0.5 * N[Power[N[Log[2.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\sqrt{1 + x} - {2}^{x}
↓
\begin{array}{l}
t_0 := \sqrt{1 + x} - {2}^{x}\\
\mathbf{if}\;t_0 \leq -0.02:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(0.5 - \log 2\right) + \left(0.0625 - 0.16666666666666666 \cdot {\log 2}^{3}\right) \cdot {x}^{3}\right) - \left(0.125 + 0.5 \cdot {\log 2}^{2}\right) \cdot {x}^{2}\\
\end{array}