
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n): return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n) return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))) end
function tmp = code(x, n) tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n)); end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x n) :precision binary64 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n): return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n) return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))) end
function tmp = code(x, n) tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n)); end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (log (+ x 1.0))))
(if (<= (/ 1.0 n) -2e-114)
(/ (pow (exp (/ (log x) (- n))) -1.0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(-
(+ (* 0.5 (/ (pow t_0 2.0) (pow n 2.0))) (/ t_0 n))
(+ (* (/ (pow (log x) 2.0) (pow n 2.0)) 0.5) (/ (log x) n)))
(if (<= (/ 1.0 n) 5e-136)
(/
(+
(/ 0.3333333333333333 (pow x 3.0))
(- (/ 1.0 x) (/ 0.5 (pow x 2.0))))
n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(pow (sqrt (- (exp (/ (log1p x) n)) (pow x (/ 1.0 n)))) 2.0)))))))
double code(double x, double n) {
double t_0 = log((x + 1.0));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = pow(exp((log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = ((0.5 * (pow(t_0, 2.0) / pow(n, 2.0))) + (t_0 / n)) - (((pow(log(x), 2.0) / pow(n, 2.0)) * 0.5) + (log(x) / n));
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / pow(x, 3.0)) + ((1.0 / x) - (0.5 / pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else {
tmp = pow(sqrt((exp((log1p(x) / n)) - pow(x, (1.0 / n)))), 2.0);
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log((x + 1.0));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.pow(Math.exp((Math.log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = ((0.5 * (Math.pow(t_0, 2.0) / Math.pow(n, 2.0))) + (t_0 / n)) - (((Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0)) * 0.5) + (Math.log(x) / n));
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / Math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / Math.pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else {
tmp = Math.pow(Math.sqrt((Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n)))), 2.0);
}
return tmp;
}
def code(x, n): t_0 = math.log((x + 1.0)) tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.pow(math.exp((math.log(x) / -n)), -1.0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = ((0.5 * (math.pow(t_0, 2.0) / math.pow(n, 2.0))) + (t_0 / n)) - (((math.pow(math.log(x), 2.0) / math.pow(n, 2.0)) * 0.5) + (math.log(x) / n)) elif (1.0 / n) <= 5e-136: tmp = ((0.3333333333333333 / math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / math.pow(x, 2.0)))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) else: tmp = math.pow(math.sqrt((math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n)))), 2.0) return tmp
function code(x, n) t_0 = log(Float64(x + 1.0)) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64((exp(Float64(log(x) / Float64(-n))) ^ -1.0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(Float64(Float64(0.5 * Float64((t_0 ^ 2.0) / (n ^ 2.0))) + Float64(t_0 / n)) - Float64(Float64(Float64((log(x) ^ 2.0) / (n ^ 2.0)) * 0.5) + Float64(log(x) / n))); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(0.3333333333333333 / (x ^ 3.0)) + Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0)))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); else tmp = sqrt(Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n)))) ^ 2.0; end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Log[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Power[N[Exp[N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(N[(N[(0.5 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(x + 1\right)\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{{\left(e^{\frac{\log x}{-n}}\right)}^{-1}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\left(0.5 \cdot \frac{{t_0}^{2}}{{n}^{2}} + \frac{t_0}{n}\right) - \left(\frac{{\log x}^{2}}{{n}^{2}} \cdot 0.5 + \frac{\log x}{n}\right)\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{{x}^{3}} + \left(\frac{1}{x} - \frac{0.5}{{x}^{2}}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(if (<= x 3.9)
(*
(+
(/ (* -0.5 (- (log x) (log1p x))) n)
(-
(* -0.125 (/ (pow (log x) 2.0) (pow n 2.0)))
(* 0.020833333333333332 (/ (pow (log x) 3.0) (pow n 3.0)))))
(+ (pow (+ x 1.0) (/ 0.5 n)) (pow x (/ 0.5 n))))
(* (/ 1.0 n) (/ (pow x (/ 1.0 n)) x))))
double code(double x, double n) {
double tmp;
if (x <= 3.9) {
tmp = (((-0.5 * (log(x) - log1p(x))) / n) + ((-0.125 * (pow(log(x), 2.0) / pow(n, 2.0))) - (0.020833333333333332 * (pow(log(x), 3.0) / pow(n, 3.0))))) * (pow((x + 1.0), (0.5 / n)) + pow(x, (0.5 / n)));
} else {
tmp = (1.0 / n) * (pow(x, (1.0 / n)) / x);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if (x <= 3.9) {
tmp = (((-0.5 * (Math.log(x) - Math.log1p(x))) / n) + ((-0.125 * (Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0))) - (0.020833333333333332 * (Math.pow(Math.log(x), 3.0) / Math.pow(n, 3.0))))) * (Math.pow((x + 1.0), (0.5 / n)) + Math.pow(x, (0.5 / n)));
} else {
tmp = (1.0 / n) * (Math.pow(x, (1.0 / n)) / x);
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 3.9: tmp = (((-0.5 * (math.log(x) - math.log1p(x))) / n) + ((-0.125 * (math.pow(math.log(x), 2.0) / math.pow(n, 2.0))) - (0.020833333333333332 * (math.pow(math.log(x), 3.0) / math.pow(n, 3.0))))) * (math.pow((x + 1.0), (0.5 / n)) + math.pow(x, (0.5 / n))) else: tmp = (1.0 / n) * (math.pow(x, (1.0 / n)) / x) return tmp
function code(x, n) tmp = 0.0 if (x <= 3.9) tmp = Float64(Float64(Float64(Float64(-0.5 * Float64(log(x) - log1p(x))) / n) + Float64(Float64(-0.125 * Float64((log(x) ^ 2.0) / (n ^ 2.0))) - Float64(0.020833333333333332 * Float64((log(x) ^ 3.0) / (n ^ 3.0))))) * Float64((Float64(x + 1.0) ^ Float64(0.5 / n)) + (x ^ Float64(0.5 / n)))); else tmp = Float64(Float64(1.0 / n) * Float64((x ^ Float64(1.0 / n)) / x)); end return tmp end
code[x_, n_] := If[LessEqual[x, 3.9], N[(N[(N[(N[(-0.5 * N[(N[Log[x], $MachinePrecision] - N[Log[1 + x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(N[(-0.125 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.020833333333333332 * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / N[Power[n, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(0.5 / n), $MachinePrecision]], $MachinePrecision] + N[Power[x, N[(0.5 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] * N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.9:\\
\;\;\;\;\left(\frac{-0.5 \cdot \left(\log x - \mathsf{log1p}\left(x\right)\right)}{n} + \left(-0.125 \cdot \frac{{\log x}^{2}}{{n}^{2}} - 0.020833333333333332 \cdot \frac{{\log x}^{3}}{{n}^{3}}\right)\right) \cdot \left({\left(x + 1\right)}^{\left(\frac{0.5}{n}\right)} + {x}^{\left(\frac{0.5}{n}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(if (<= x 2.0)
(*
(+
(/ (* -0.5 (- (log x) (log1p x))) n)
(-
(* -0.125 (/ (pow (log x) 2.0) (pow n 2.0)))
(* 0.020833333333333332 (/ (pow (log x) 3.0) (pow n 3.0)))))
(+ 1.0 (pow x (/ 0.5 n))))
(* (/ 1.0 n) (/ (pow x (/ 1.0 n)) x))))
double code(double x, double n) {
double tmp;
if (x <= 2.0) {
tmp = (((-0.5 * (log(x) - log1p(x))) / n) + ((-0.125 * (pow(log(x), 2.0) / pow(n, 2.0))) - (0.020833333333333332 * (pow(log(x), 3.0) / pow(n, 3.0))))) * (1.0 + pow(x, (0.5 / n)));
} else {
tmp = (1.0 / n) * (pow(x, (1.0 / n)) / x);
}
return tmp;
}
public static double code(double x, double n) {
double tmp;
if (x <= 2.0) {
tmp = (((-0.5 * (Math.log(x) - Math.log1p(x))) / n) + ((-0.125 * (Math.pow(Math.log(x), 2.0) / Math.pow(n, 2.0))) - (0.020833333333333332 * (Math.pow(Math.log(x), 3.0) / Math.pow(n, 3.0))))) * (1.0 + Math.pow(x, (0.5 / n)));
} else {
tmp = (1.0 / n) * (Math.pow(x, (1.0 / n)) / x);
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 2.0: tmp = (((-0.5 * (math.log(x) - math.log1p(x))) / n) + ((-0.125 * (math.pow(math.log(x), 2.0) / math.pow(n, 2.0))) - (0.020833333333333332 * (math.pow(math.log(x), 3.0) / math.pow(n, 3.0))))) * (1.0 + math.pow(x, (0.5 / n))) else: tmp = (1.0 / n) * (math.pow(x, (1.0 / n)) / x) return tmp
function code(x, n) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(Float64(Float64(-0.5 * Float64(log(x) - log1p(x))) / n) + Float64(Float64(-0.125 * Float64((log(x) ^ 2.0) / (n ^ 2.0))) - Float64(0.020833333333333332 * Float64((log(x) ^ 3.0) / (n ^ 3.0))))) * Float64(1.0 + (x ^ Float64(0.5 / n)))); else tmp = Float64(Float64(1.0 / n) * Float64((x ^ Float64(1.0 / n)) / x)); end return tmp end
code[x_, n_] := If[LessEqual[x, 2.0], N[(N[(N[(N[(-0.5 * N[(N[Log[x], $MachinePrecision] - N[Log[1 + x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] + N[(N[(-0.125 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.020833333333333332 * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / N[Power[n, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[Power[x, N[(0.5 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] * N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\left(\frac{-0.5 \cdot \left(\log x - \mathsf{log1p}\left(x\right)\right)}{n} + \left(-0.125 \cdot \frac{{\log x}^{2}}{{n}^{2}} - 0.020833333333333332 \cdot \frac{{\log x}^{3}}{{n}^{3}}\right)\right) \cdot \left(1 + {x}^{\left(\frac{0.5}{n}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log1p x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (pow (exp (/ (log x) (- n))) -1.0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- t_0 (/ (log x) n))
(if (<= (/ 1.0 n) 5e-136)
(/
(+
(/ 0.3333333333333333 (pow x 3.0))
(- (/ 1.0 x) (/ 0.5 (pow x 2.0))))
n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(pow (sqrt (- (exp t_0) (pow x (/ 1.0 n)))) 2.0)))))))
double code(double x, double n) {
double t_0 = log1p(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = pow(exp((log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - (log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / pow(x, 3.0)) + ((1.0 / x) - (0.5 / pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else {
tmp = pow(sqrt((exp(t_0) - pow(x, (1.0 / n)))), 2.0);
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log1p(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.pow(Math.exp((Math.log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - (Math.log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / Math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / Math.pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else {
tmp = Math.pow(Math.sqrt((Math.exp(t_0) - Math.pow(x, (1.0 / n)))), 2.0);
}
return tmp;
}
def code(x, n): t_0 = math.log1p(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.pow(math.exp((math.log(x) / -n)), -1.0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = t_0 - (math.log(x) / n) elif (1.0 / n) <= 5e-136: tmp = ((0.3333333333333333 / math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / math.pow(x, 2.0)))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) else: tmp = math.pow(math.sqrt((math.exp(t_0) - math.pow(x, (1.0 / n)))), 2.0) return tmp
function code(x, n) t_0 = Float64(log1p(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64((exp(Float64(log(x) / Float64(-n))) ^ -1.0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(t_0 - Float64(log(x) / n)); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(0.3333333333333333 / (x ^ 3.0)) + Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0)))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); else tmp = sqrt(Float64(exp(t_0) - (x ^ Float64(1.0 / n)))) ^ 2.0; end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Power[N[Exp[N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(t$95$0 - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[N[(N[Exp[t$95$0], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{{\left(e^{\frac{\log x}{-n}}\right)}^{-1}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;t_0 - \frac{\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{{x}^{3}} + \left(\frac{1}{x} - \frac{0.5}{{x}^{2}}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{e^{t_0} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log1p x) n)) (t_1 (/ (log x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (exp t_1) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- t_0 t_1)
(if (<= (/ 1.0 n) 5e-136)
(/
(+
(/ 0.3333333333333333 (pow x 3.0))
(- (/ 1.0 x) (/ 0.5 (pow x 2.0))))
n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(- (exp t_0) (pow x (/ 1.0 n)))))))))
double code(double x, double n) {
double t_0 = log1p(x) / n;
double t_1 = log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = exp(t_1) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - t_1;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / pow(x, 3.0)) + ((1.0 / x) - (0.5 / pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else {
tmp = exp(t_0) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log1p(x) / n;
double t_1 = Math.log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.exp(t_1) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - t_1;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / Math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / Math.pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else {
tmp = Math.exp(t_0) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): t_0 = math.log1p(x) / n t_1 = math.log(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.exp(t_1) / (x * n) elif (1.0 / n) <= 5e-166: tmp = t_0 - t_1 elif (1.0 / n) <= 5e-136: tmp = ((0.3333333333333333 / math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / math.pow(x, 2.0)))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) else: tmp = math.exp(t_0) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) t_0 = Float64(log1p(x) / n) t_1 = Float64(log(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(exp(t_1) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(t_0 - t_1); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(0.3333333333333333 / (x ^ 3.0)) + Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0)))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); else tmp = Float64(exp(t_0) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Exp[t$95$1], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(t$95$0 - t$95$1), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], N[(N[Exp[t$95$0], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
t_1 := \frac{\log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{e^{t_1}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;t_0 - t_1\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{{x}^{3}} + \left(\frac{1}{x} - \frac{0.5}{{x}^{2}}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{t_0} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log1p x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (pow (exp (/ (log x) (- n))) -1.0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- t_0 (/ (log x) n))
(if (<= (/ 1.0 n) 5e-136)
(/
(+
(/ 0.3333333333333333 (pow x 3.0))
(- (/ 1.0 x) (/ 0.5 (pow x 2.0))))
n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(- (exp t_0) (pow x (/ 1.0 n)))))))))
double code(double x, double n) {
double t_0 = log1p(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = pow(exp((log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - (log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / pow(x, 3.0)) + ((1.0 / x) - (0.5 / pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else {
tmp = exp(t_0) - pow(x, (1.0 / n));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log1p(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.pow(Math.exp((Math.log(x) / -n)), -1.0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 - (Math.log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / Math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / Math.pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else {
tmp = Math.exp(t_0) - Math.pow(x, (1.0 / n));
}
return tmp;
}
def code(x, n): t_0 = math.log1p(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.pow(math.exp((math.log(x) / -n)), -1.0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = t_0 - (math.log(x) / n) elif (1.0 / n) <= 5e-136: tmp = ((0.3333333333333333 / math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / math.pow(x, 2.0)))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) else: tmp = math.exp(t_0) - math.pow(x, (1.0 / n)) return tmp
function code(x, n) t_0 = Float64(log1p(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64((exp(Float64(log(x) / Float64(-n))) ^ -1.0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(t_0 - Float64(log(x) / n)); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(0.3333333333333333 / (x ^ 3.0)) + Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0)))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); else tmp = Float64(exp(t_0) - (x ^ Float64(1.0 / n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Power[N[Exp[N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(t$95$0 - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], N[(N[Exp[t$95$0], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{{\left(e^{\frac{\log x}{-n}}\right)}^{-1}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;t_0 - \frac{\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{{x}^{3}} + \left(\frac{1}{x} - \frac{0.5}{{x}^{2}}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{t_0} - {x}^{\left(\frac{1}{n}\right)}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (exp t_0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- (/ (log1p x) n) t_0)
(if (<= (/ 1.0 n) 5e-136)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(if (<= (/ 1.0 n) 5e+183)
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n)))
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 5e+183) {
tmp = pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (Math.log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 5e+183) {
tmp = Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.exp(t_0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = (math.log1p(x) / n) - t_0 elif (1.0 / n) <= 5e-136: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) elif (1.0 / n) <= 5e+183: tmp = math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n)) else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = Float64(log(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(exp(t_0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(Float64(log1p(x) / n) - t_0); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); elseif (Float64(1.0 / n) <= 5e+183) tmp = Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Exp[t$95$0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+183], N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{e^{t_0}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right)}{n} - t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (exp t_0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- (/ (log1p x) n) t_0)
(if (<= (/ 1.0 n) 5e-136)
(/
(+
(/ 0.3333333333333333 (pow x 3.0))
(- (/ 1.0 x) (/ 0.5 (pow x 2.0))))
n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(if (<= (/ 1.0 n) 5e+183)
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n)))
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / pow(x, 3.0)) + ((1.0 / x) - (0.5 / pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 5e+183) {
tmp = pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (Math.log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((0.3333333333333333 / Math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / Math.pow(x, 2.0)))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 5e+183) {
tmp = Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.exp(t_0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = (math.log1p(x) / n) - t_0 elif (1.0 / n) <= 5e-136: tmp = ((0.3333333333333333 / math.pow(x, 3.0)) + ((1.0 / x) - (0.5 / math.pow(x, 2.0)))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) elif (1.0 / n) <= 5e+183: tmp = math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n)) else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = Float64(log(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(exp(t_0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(Float64(log1p(x) / n) - t_0); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(0.3333333333333333 / (x ^ 3.0)) + Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0)))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); elseif (Float64(1.0 / n) <= 5e+183) tmp = Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n))); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Exp[t$95$0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(0.3333333333333333 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+183], N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{e^{t_0}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right)}{n} - t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.3333333333333333}{{x}^{3}} + \left(\frac{1}{x} - \frac{0.5}{{x}^{2}}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (- (log1p x) (log x))) (t_1 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-114)
(/ t_1 (* x n))
(if (<= (/ 1.0 n) 5e-166)
(/ t_0 n)
(if (<= (/ 1.0 n) 5e-136)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
(* t_0 (/ 1.0 n))
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) t_1)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = log1p(x) - log(x);
double t_1 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_1 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 / n;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = t_0 * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_1;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log1p(x) - Math.log(x);
double t_1 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_1 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_0 / n;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = t_0 * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_1;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.log1p(x) - math.log(x) t_1 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-114: tmp = t_1 / (x * n) elif (1.0 / n) <= 5e-166: tmp = t_0 / n elif (1.0 / n) <= 5e-136: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = t_0 * (1.0 / n) elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - t_1 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = Float64(log1p(x) - log(x)) t_1 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(t_1 / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(t_0 / n); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(t_0 * Float64(1.0 / n)); elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_1); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(t$95$1 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(t$95$0 / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(t$95$0 * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{log1p}\left(x\right) - \log x\\
t_1 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{t_1}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\frac{t_0}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;t_0 \cdot \frac{1}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-114)
(/ t_0 (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- (/ (log1p x) n) (/ (log x) n))
(if (<= (/ 1.0 n) 5e-136)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (log1p(x) / n) - (log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (Math.log1p(x) / n) - (Math.log(x) / n);
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-114: tmp = t_0 / (x * n) elif (1.0 / n) <= 5e-166: tmp = (math.log1p(x) / n) - (math.log(x) / n) elif (1.0 / n) <= 5e-136: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(t_0 / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(Float64(log1p(x) / n) - Float64(log(x) / n)); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{t_0}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right)}{n} - \frac{\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (log x) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ (exp t_0) (* x n))
(if (<= (/ 1.0 n) 5e-166)
(- (/ (log1p x) n) t_0)
(if (<= (/ 1.0 n) 5e-136)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
(* (- (log1p x) (log x)) (/ 1.0 n))
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) (pow x (/ 1.0 n)))
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (log1p(x) - log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - pow(x, (1.0 / n));
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.log(x) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = Math.exp(t_0) / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = (Math.log1p(x) / n) - t_0;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (Math.log1p(x) - Math.log(x)) * (1.0 / n);
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - Math.pow(x, (1.0 / n));
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.log(x) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = math.exp(t_0) / (x * n) elif (1.0 / n) <= 5e-166: tmp = (math.log1p(x) / n) - t_0 elif (1.0 / n) <= 5e-136: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = (math.log1p(x) - math.log(x)) * (1.0 / n) elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - math.pow(x, (1.0 / n)) else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = Float64(log(x) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(exp(t_0) / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = Float64(Float64(log1p(x) / n) - t_0); elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(log1p(x) - log(x)) * Float64(1.0 / n)); elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - (x ^ Float64(1.0 / n))); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(N[Exp[t$95$0], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], N[(N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{e^{t_0}}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right)}{n} - t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ (- (log1p x) (log x)) n)))
(if (<= (/ 1.0 n) -2e-114)
(/ t_0 (* x n))
(if (<= (/ 1.0 n) 5e-166)
t_1
(if (<= (/ 1.0 n) 5e-136)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
t_1
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double t_1 = (log1p(x) - log(x)) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_1;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double t_1 = (Math.log1p(x) - Math.log(x)) / n;
double tmp;
if ((1.0 / n) <= -2e-114) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 5e-166) {
tmp = t_1;
} else if ((1.0 / n) <= 5e-136) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = t_1;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) t_1 = (math.log1p(x) - math.log(x)) / n tmp = 0 if (1.0 / n) <= -2e-114: tmp = t_0 / (x * n) elif (1.0 / n) <= 5e-166: tmp = t_1 elif (1.0 / n) <= 5e-136: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = t_1 elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) t_1 = Float64(Float64(log1p(x) - log(x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-114) tmp = Float64(t_0 / Float64(x * n)); elseif (Float64(1.0 / n) <= 5e-166) tmp = t_1; elseif (Float64(1.0 / n) <= 5e-136) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = t_1; elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -2e-114], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-166], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-136], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\frac{t_0}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-205)
(* (/ 1.0 n) (/ t_0 x))
(if (<= (/ 1.0 n) 1e-242)
(/ (- (log x)) n)
(if (<= (/ 1.0 n) 4e-121)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 5e-20)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-205)) then
tmp = (1.0d0 / n) * (t_0 / x)
else if ((1.0d0 / n) <= 1d-242) then
tmp = -log(x) / n
else if ((1.0d0 / n) <= 4d-121) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 5d-20) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 1d+199) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = sqrt(((1.0d0 / (x * n)) / (x * n)))
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -Math.log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-205: tmp = (1.0 / n) * (t_0 / x) elif (1.0 / n) <= 1e-242: tmp = -math.log(x) / n elif (1.0 / n) <= 4e-121: tmp = (1.0 / x) / n elif (1.0 / n) <= 5e-20: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-205) tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x)); elseif (Float64(1.0 / n) <= 1e-242) tmp = Float64(Float64(-log(x)) / n); elseif (Float64(1.0 / n) <= 4e-121) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-205) tmp = (1.0 / n) * (t_0 / x); elseif ((1.0 / n) <= 1e-242) tmp = -log(x) / n; elseif ((1.0 / n) <= 4e-121) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 5e-20) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 1e+199) tmp = (1.0 + (x / n)) - t_0; else tmp = sqrt(((1.0 / (x * n)) / (x * n))); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-205], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-242], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-121], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{1}{n} \cdot \frac{t_0}{x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-242}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-205)
(* (/ 1.0 n) (/ t_0 x))
(if (<= (/ 1.0 n) 1e-242)
(/ (- (log x)) n)
(if (<= (/ 1.0 n) 4e-121)
(/ (- (/ 1.0 x) (/ 0.5 (pow x 2.0))) n)
(if (<= (/ 1.0 n) 5e-20)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 1e+199)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = ((1.0 / x) - (0.5 / pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-205)) then
tmp = (1.0d0 / n) * (t_0 / x)
else if ((1.0d0 / n) <= 1d-242) then
tmp = -log(x) / n
else if ((1.0d0 / n) <= 4d-121) then
tmp = ((1.0d0 / x) - (0.5d0 / (x ** 2.0d0))) / n
else if ((1.0d0 / n) <= 5d-20) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 1d+199) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = sqrt(((1.0d0 / (x * n)) / (x * n)))
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -Math.log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = ((1.0 / x) - (0.5 / Math.pow(x, 2.0))) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 1e+199) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-205: tmp = (1.0 / n) * (t_0 / x) elif (1.0 / n) <= 1e-242: tmp = -math.log(x) / n elif (1.0 / n) <= 4e-121: tmp = ((1.0 / x) - (0.5 / math.pow(x, 2.0))) / n elif (1.0 / n) <= 5e-20: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 1e+199: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-205) tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x)); elseif (Float64(1.0 / n) <= 1e-242) tmp = Float64(Float64(-log(x)) / n); elseif (Float64(1.0 / n) <= 4e-121) tmp = Float64(Float64(Float64(1.0 / x) - Float64(0.5 / (x ^ 2.0))) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 1e+199) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-205) tmp = (1.0 / n) * (t_0 / x); elseif ((1.0 / n) <= 1e-242) tmp = -log(x) / n; elseif ((1.0 / n) <= 4e-121) tmp = ((1.0 / x) - (0.5 / (x ^ 2.0))) / n; elseif ((1.0 / n) <= 5e-20) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 1e+199) tmp = (1.0 + (x / n)) - t_0; else tmp = sqrt(((1.0 / (x * n)) / (x * n))); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-205], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-242], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-121], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+199], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{1}{n} \cdot \frac{t_0}{x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-242}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{1}{x} - \frac{0.5}{{x}^{2}}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{+199}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-205)
(/ t_0 (* x n))
(if (<= (/ 1.0 n) 1e-242)
(/ (- (log x)) n)
(if (<= (/ 1.0 n) 4e-121)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 5e-20)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 5e+183)
(- 1.0 t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 1e-242) {
tmp = -log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-205)) then
tmp = t_0 / (x * n)
else if ((1.0d0 / n) <= 1d-242) then
tmp = -log(x) / n
else if ((1.0d0 / n) <= 4d-121) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 5d-20) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 5d+183) then
tmp = 1.0d0 - t_0
else
tmp = sqrt(((1.0d0 / (x * n)) / (x * n)))
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 1e-242) {
tmp = -Math.log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-205: tmp = t_0 / (x * n) elif (1.0 / n) <= 1e-242: tmp = -math.log(x) / n elif (1.0 / n) <= 4e-121: tmp = (1.0 / x) / n elif (1.0 / n) <= 5e-20: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 5e+183: tmp = 1.0 - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-205) tmp = Float64(t_0 / Float64(x * n)); elseif (Float64(1.0 / n) <= 1e-242) tmp = Float64(Float64(-log(x)) / n); elseif (Float64(1.0 / n) <= 4e-121) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 5e+183) tmp = Float64(1.0 - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-205) tmp = t_0 / (x * n); elseif ((1.0 / n) <= 1e-242) tmp = -log(x) / n; elseif ((1.0 / n) <= 4e-121) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 5e-20) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 5e+183) tmp = 1.0 - t_0; else tmp = sqrt(((1.0 / (x * n)) / (x * n))); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-205], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-242], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-121], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+183], N[(1.0 - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{t_0}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-242}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-205)
(* (/ 1.0 n) (/ t_0 x))
(if (<= (/ 1.0 n) 1e-242)
(/ (- (log x)) n)
(if (<= (/ 1.0 n) 4e-121)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 5e-20)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 5e+183)
(- 1.0 t_0)
(sqrt (/ (/ 1.0 (* x n)) (* x n))))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-205)) then
tmp = (1.0d0 / n) * (t_0 / x)
else if ((1.0d0 / n) <= 1d-242) then
tmp = -log(x) / n
else if ((1.0d0 / n) <= 4d-121) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 5d-20) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 5d+183) then
tmp = 1.0d0 - t_0
else
tmp = sqrt(((1.0d0 / (x * n)) / (x * n)))
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = (1.0 / n) * (t_0 / x);
} else if ((1.0 / n) <= 1e-242) {
tmp = -Math.log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = Math.sqrt(((1.0 / (x * n)) / (x * n)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-205: tmp = (1.0 / n) * (t_0 / x) elif (1.0 / n) <= 1e-242: tmp = -math.log(x) / n elif (1.0 / n) <= 4e-121: tmp = (1.0 / x) / n elif (1.0 / n) <= 5e-20: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 5e+183: tmp = 1.0 - t_0 else: tmp = math.sqrt(((1.0 / (x * n)) / (x * n))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-205) tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x)); elseif (Float64(1.0 / n) <= 1e-242) tmp = Float64(Float64(-log(x)) / n); elseif (Float64(1.0 / n) <= 4e-121) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 5e+183) tmp = Float64(1.0 - t_0); else tmp = sqrt(Float64(Float64(1.0 / Float64(x * n)) / Float64(x * n))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-205) tmp = (1.0 / n) * (t_0 / x); elseif ((1.0 / n) <= 1e-242) tmp = -log(x) / n; elseif ((1.0 / n) <= 4e-121) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 5e-20) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 5e+183) tmp = 1.0 - t_0; else tmp = sqrt(((1.0 / (x * n)) / (x * n))); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-205], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-242], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-121], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+183], N[(1.0 - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{1}{n} \cdot \frac{t_0}{x}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-242}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{x \cdot n}}{x \cdot n}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -4e-205)
(/ t_0 (* x n))
(if (<= (/ 1.0 n) 1e-242)
(/ (- (log x)) n)
(if (<= (/ 1.0 n) 4e-121)
(/ (/ 1.0 x) n)
(if (<= (/ 1.0 n) 5e-20)
(/ (- x (log x)) n)
(if (<= (/ 1.0 n) 5e+183) (- 1.0 t_0) (/ 1.0 (* x n)))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 1e-242) {
tmp = -log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = 1.0 / (x * n);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = x ** (1.0d0 / n)
if ((1.0d0 / n) <= (-4d-205)) then
tmp = t_0 / (x * n)
else if ((1.0d0 / n) <= 1d-242) then
tmp = -log(x) / n
else if ((1.0d0 / n) <= 4d-121) then
tmp = (1.0d0 / x) / n
else if ((1.0d0 / n) <= 5d-20) then
tmp = (x - log(x)) / n
else if ((1.0d0 / n) <= 5d+183) then
tmp = 1.0d0 - t_0
else
tmp = 1.0d0 / (x * n)
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -4e-205) {
tmp = t_0 / (x * n);
} else if ((1.0 / n) <= 1e-242) {
tmp = -Math.log(x) / n;
} else if ((1.0 / n) <= 4e-121) {
tmp = (1.0 / x) / n;
} else if ((1.0 / n) <= 5e-20) {
tmp = (x - Math.log(x)) / n;
} else if ((1.0 / n) <= 5e+183) {
tmp = 1.0 - t_0;
} else {
tmp = 1.0 / (x * n);
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -4e-205: tmp = t_0 / (x * n) elif (1.0 / n) <= 1e-242: tmp = -math.log(x) / n elif (1.0 / n) <= 4e-121: tmp = (1.0 / x) / n elif (1.0 / n) <= 5e-20: tmp = (x - math.log(x)) / n elif (1.0 / n) <= 5e+183: tmp = 1.0 - t_0 else: tmp = 1.0 / (x * n) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-205) tmp = Float64(t_0 / Float64(x * n)); elseif (Float64(1.0 / n) <= 1e-242) tmp = Float64(Float64(-log(x)) / n); elseif (Float64(1.0 / n) <= 4e-121) tmp = Float64(Float64(1.0 / x) / n); elseif (Float64(1.0 / n) <= 5e-20) tmp = Float64(Float64(x - log(x)) / n); elseif (Float64(1.0 / n) <= 5e+183) tmp = Float64(1.0 - t_0); else tmp = Float64(1.0 / Float64(x * n)); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -4e-205) tmp = t_0 / (x * n); elseif ((1.0 / n) <= 1e-242) tmp = -log(x) / n; elseif ((1.0 / n) <= 4e-121) tmp = (1.0 / x) / n; elseif ((1.0 / n) <= 5e-20) tmp = (x - log(x)) / n; elseif ((1.0 / n) <= 5e+183) tmp = 1.0 - t_0; else tmp = 1.0 / (x * n); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-205], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-242], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-121], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-20], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+183], N[(1.0 - t$95$0), $MachinePrecision], N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{t_0}{x \cdot n}\\
\mathbf{elif}\;\frac{1}{n} \leq 10^{-242}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+183}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot n}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(if (<= x 7e-213)
(/ (- (log x)) n)
(if (<= x 2.3e-115)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 1.0) (/ (- x (log x)) n) (/ (/ 1.0 x) n)))))
double code(double x, double n) {
double tmp;
if (x <= 7e-213) {
tmp = -log(x) / n;
} else if (x <= 2.3e-115) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 1.0) {
tmp = (x - log(x)) / n;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 7d-213) then
tmp = -log(x) / n
else if (x <= 2.3d-115) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 1.0d0) then
tmp = (x - log(x)) / n
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 7e-213) {
tmp = -Math.log(x) / n;
} else if (x <= 2.3e-115) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 1.0) {
tmp = (x - Math.log(x)) / n;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 7e-213: tmp = -math.log(x) / n elif x <= 2.3e-115: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 1.0: tmp = (x - math.log(x)) / n else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 7e-213) tmp = Float64(Float64(-log(x)) / n); elseif (x <= 2.3e-115) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 1.0) tmp = Float64(Float64(x - log(x)) / n); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 7e-213) tmp = -log(x) / n; elseif (x <= 2.3e-115) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 1.0) tmp = (x - log(x)) / n; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 7e-213], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 2.3e-115], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{-213}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-115}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (/ (- (log x)) n)))
(if (<= x 2.35e-213)
t_0
(if (<= x 1.75e-115)
(- 1.0 (pow x (/ 1.0 n)))
(if (<= x 0.56) t_0 (/ (/ 1.0 x) n))))))
double code(double x, double n) {
double t_0 = -log(x) / n;
double tmp;
if (x <= 2.35e-213) {
tmp = t_0;
} else if (x <= 1.75e-115) {
tmp = 1.0 - pow(x, (1.0 / n));
} else if (x <= 0.56) {
tmp = t_0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: tmp
t_0 = -log(x) / n
if (x <= 2.35d-213) then
tmp = t_0
else if (x <= 1.75d-115) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else if (x <= 0.56d0) then
tmp = t_0
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = -Math.log(x) / n;
double tmp;
if (x <= 2.35e-213) {
tmp = t_0;
} else if (x <= 1.75e-115) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else if (x <= 0.56) {
tmp = t_0;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): t_0 = -math.log(x) / n tmp = 0 if x <= 2.35e-213: tmp = t_0 elif x <= 1.75e-115: tmp = 1.0 - math.pow(x, (1.0 / n)) elif x <= 0.56: tmp = t_0 else: tmp = (1.0 / x) / n return tmp
function code(x, n) t_0 = Float64(Float64(-log(x)) / n) tmp = 0.0 if (x <= 2.35e-213) tmp = t_0; elseif (x <= 1.75e-115) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); elseif (x <= 0.56) tmp = t_0; else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) t_0 = -log(x) / n; tmp = 0.0; if (x <= 2.35e-213) tmp = t_0; elseif (x <= 1.75e-115) tmp = 1.0 - (x ^ (1.0 / n)); elseif (x <= 0.56) tmp = t_0; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 2.35e-213], t$95$0, If[LessEqual[x, 1.75e-115], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.56], t$95$0, N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-\log x}{n}\\
\mathbf{if}\;x \leq 2.35 \cdot 10^{-213}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-115}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{elif}\;x \leq 0.56:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
(FPCore (x n) :precision binary64 (if (<= x 0.56) (/ (- (log x)) n) (/ (/ 1.0 x) n)))
double code(double x, double n) {
double tmp;
if (x <= 0.56) {
tmp = -log(x) / n;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 0.56d0) then
tmp = -log(x) / n
else
tmp = (1.0d0 / x) / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.56) {
tmp = -Math.log(x) / n;
} else {
tmp = (1.0 / x) / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.56: tmp = -math.log(x) / n else: tmp = (1.0 / x) / n return tmp
function code(x, n) tmp = 0.0 if (x <= 0.56) tmp = Float64(Float64(-log(x)) / n); else tmp = Float64(Float64(1.0 / x) / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.56) tmp = -log(x) / n; else tmp = (1.0 / x) / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.56], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.56:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{n}\\
\end{array}
\end{array}
(FPCore (x n) :precision binary64 (/ 1.0 (* x n)))
double code(double x, double n) {
return 1.0 / (x * n);
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = 1.0d0 / (x * n)
end function
public static double code(double x, double n) {
return 1.0 / (x * n);
}
def code(x, n): return 1.0 / (x * n)
function code(x, n) return Float64(1.0 / Float64(x * n)) end
function tmp = code(x, n) tmp = 1.0 / (x * n); end
code[x_, n_] := N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot n}
\end{array}
(FPCore (x n) :precision binary64 (/ (/ 1.0 n) x))
double code(double x, double n) {
return (1.0 / n) / x;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = (1.0d0 / n) / x
end function
public static double code(double x, double n) {
return (1.0 / n) / x;
}
def code(x, n): return (1.0 / n) / x
function code(x, n) return Float64(Float64(1.0 / n) / x) end
function tmp = code(x, n) tmp = (1.0 / n) / x; end
code[x_, n_] := N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{n}}{x}
\end{array}
(FPCore (x n) :precision binary64 (/ (/ 1.0 x) n))
double code(double x, double n) {
return (1.0 / x) / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = (1.0d0 / x) / n
end function
public static double code(double x, double n) {
return (1.0 / x) / n;
}
def code(x, n): return (1.0 / x) / n
function code(x, n) return Float64(Float64(1.0 / x) / n) end
function tmp = code(x, n) tmp = (1.0 / x) / n; end
code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{n}
\end{array}
herbie shell --seed 2024006
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))