
(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 14 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 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-18)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(- (exp (/ x n)) t_0)))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else {
tmp = exp((x / n)) - t_0;
}
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) <= (-2d-18)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else
tmp = exp((x / n)) - t_0
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) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else {
tmp = Math.exp((x / n)) - t_0;
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-18: tmp = t_0 / (n * x) elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n else: tmp = math.exp((x / n)) - t_0 return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-18) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); else tmp = Float64(exp(Float64(x / n)) - t_0); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-18) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; else tmp = exp((x / n)) - t_0; 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], -2e-18], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{-18}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t_0\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))) (t_1 (/ (log (/ (+ 1.0 x) x)) n)))
(if (<= (/ 1.0 n) -1e+251)
t_1
(if (<= (/ 1.0 n) -4.0)
t_0
(if (<= (/ 1.0 n) 5000.0)
t_1
(if (<= (/ 1.0 n) 5e+195) t_0 (/ 1.0 (* n x))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double t_1 = log(((1.0 + x) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+251) {
tmp = t_1;
} else if ((1.0 / n) <= -4.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 5e+195) {
tmp = t_0;
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x ** (1.0d0 / n))
t_1 = log(((1.0d0 + x) / x)) / n
if ((1.0d0 / n) <= (-1d+251)) then
tmp = t_1
else if ((1.0d0 / n) <= (-4.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = t_1
else if ((1.0d0 / n) <= 5d+195) then
tmp = t_0
else
tmp = 1.0d0 / (n * x)
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double t_1 = Math.log(((1.0 + x) / x)) / n;
double tmp;
if ((1.0 / n) <= -1e+251) {
tmp = t_1;
} else if ((1.0 / n) <= -4.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5000.0) {
tmp = t_1;
} else if ((1.0 / n) <= 5e+195) {
tmp = t_0;
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) t_1 = math.log(((1.0 + x) / x)) / n tmp = 0 if (1.0 / n) <= -1e+251: tmp = t_1 elif (1.0 / n) <= -4.0: tmp = t_0 elif (1.0 / n) <= 5000.0: tmp = t_1 elif (1.0 / n) <= 5e+195: tmp = t_0 else: tmp = 1.0 / (n * x) return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) t_1 = Float64(log(Float64(Float64(1.0 + x) / x)) / n) tmp = 0.0 if (Float64(1.0 / n) <= -1e+251) tmp = t_1; elseif (Float64(1.0 / n) <= -4.0) tmp = t_0; elseif (Float64(1.0 / n) <= 5000.0) tmp = t_1; elseif (Float64(1.0 / n) <= 5e+195) tmp = t_0; else tmp = Float64(1.0 / Float64(n * x)); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); t_1 = log(((1.0 + x) / x)) / n; tmp = 0.0; if ((1.0 / n) <= -1e+251) tmp = t_1; elseif ((1.0 / n) <= -4.0) tmp = t_0; elseif ((1.0 / n) <= 5000.0) tmp = t_1; elseif ((1.0 / n) <= 5e+195) tmp = t_0; else tmp = 1.0 / (n * x); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+251], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], t$95$0, N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
t_1 := \frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq -4:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
(if (<= (/ 1.0 n) -1e+251)
(/ (log (/ (+ 1.0 x) x)) n)
(if (<= (/ 1.0 n) -4.0)
t_0
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(if (<= (/ 1.0 n) 5e+195) t_0 (/ 1.0 (* n x))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -1e+251) {
tmp = log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= -4.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = t_0;
} else {
tmp = 1.0 / (n * x);
}
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 = 1.0d0 - (x ** (1.0d0 / n))
if ((1.0d0 / n) <= (-1d+251)) then
tmp = log(((1.0d0 + x) / x)) / n
else if ((1.0d0 / n) <= (-4.0d0)) then
tmp = t_0
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else if ((1.0d0 / n) <= 5d+195) then
tmp = t_0
else
tmp = 1.0d0 / (n * x)
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -1e+251) {
tmp = Math.log(((1.0 + x) / x)) / n;
} else if ((1.0 / n) <= -4.0) {
tmp = t_0;
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = t_0;
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -1e+251: tmp = math.log(((1.0 + x) / x)) / n elif (1.0 / n) <= -4.0: tmp = t_0 elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n elif (1.0 / n) <= 5e+195: tmp = t_0 else: tmp = 1.0 / (n * x) return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) tmp = 0.0 if (Float64(1.0 / n) <= -1e+251) tmp = Float64(log(Float64(Float64(1.0 + x) / x)) / n); elseif (Float64(1.0 / n) <= -4.0) tmp = t_0; elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); elseif (Float64(1.0 / n) <= 5e+195) tmp = t_0; else tmp = Float64(1.0 / Float64(n * x)); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); tmp = 0.0; if ((1.0 / n) <= -1e+251) tmp = log(((1.0 + x) / x)) / n; elseif ((1.0 / n) <= -4.0) tmp = t_0; elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; elseif ((1.0 / n) <= 5e+195) tmp = t_0; else tmp = 1.0 / (n * x); end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+251], N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -4.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], t$95$0, N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+251}:\\
\;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq -4:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-18)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(if (<= (/ 1.0 n) 5e+195)
(- (+ 1.0 (/ x n)) t_0)
(sqrt (/ (/ (/ 1.0 n) x) (* n x))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = sqrt((((1.0 / n) / x) / (n * x)));
}
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) <= (-2d-18)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else if ((1.0d0 / n) <= 5d+195) then
tmp = (1.0d0 + (x / n)) - t_0
else
tmp = sqrt((((1.0d0 / n) / x) / (n * x)))
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) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = (1.0 + (x / n)) - t_0;
} else {
tmp = Math.sqrt((((1.0 / n) / x) / (n * x)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-18: tmp = t_0 / (n * x) elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n elif (1.0 / n) <= 5e+195: tmp = (1.0 + (x / n)) - t_0 else: tmp = math.sqrt((((1.0 / n) / x) / (n * x))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-18) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); elseif (Float64(1.0 / n) <= 5e+195) tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0); else tmp = sqrt(Float64(Float64(Float64(1.0 / n) / x) / Float64(n * x))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-18) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; elseif ((1.0 / n) <= 5e+195) tmp = (1.0 + (x / n)) - t_0; else tmp = sqrt((((1.0 / n) / x) / (n * x))); 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], -2e-18], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision] / N[(n * x), $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^{-18}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;\left(1 + \frac{x}{n}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{\frac{1}{n}}{x}}{n \cdot x}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-18)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(if (<= (/ 1.0 n) 5e+195)
(- 1.0 t_0)
(sqrt (/ (/ (/ 1.0 n) x) (* n x))))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - t_0;
} else {
tmp = sqrt((((1.0 / n) / x) / (n * x)));
}
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) <= (-2d-18)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else if ((1.0d0 / n) <= 5d+195) then
tmp = 1.0d0 - t_0
else
tmp = sqrt((((1.0d0 / n) / x) / (n * x)))
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) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - t_0;
} else {
tmp = Math.sqrt((((1.0 / n) / x) / (n * x)));
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-18: tmp = t_0 / (n * x) elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n elif (1.0 / n) <= 5e+195: tmp = 1.0 - t_0 else: tmp = math.sqrt((((1.0 / n) / x) / (n * x))) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-18) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); elseif (Float64(1.0 / n) <= 5e+195) tmp = Float64(1.0 - t_0); else tmp = sqrt(Float64(Float64(Float64(1.0 / n) / x) / Float64(n * x))); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-18) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; elseif ((1.0 / n) <= 5e+195) tmp = 1.0 - t_0; else tmp = sqrt((((1.0 / n) / x) / (n * x))); 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], -2e-18], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], N[(1.0 - t$95$0), $MachinePrecision], N[Sqrt[N[(N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision] / N[(n * x), $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^{-18}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{\frac{1}{n}}{x}}{n \cdot x}}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(if (<= (/ 1.0 n) -4e-32)
(/ (pow x (+ (/ 1.0 n) -1.0)) n)
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(if (<= (/ 1.0 n) 5e+195) (- 1.0 (pow x (/ 1.0 n))) (/ 1.0 (* n x))))))
double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -4e-32) {
tmp = pow(x, ((1.0 / n) + -1.0)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - pow(x, (1.0 / n));
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if ((1.0d0 / n) <= (-4d-32)) then
tmp = (x ** ((1.0d0 / n) + (-1.0d0))) / n
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else if ((1.0d0 / n) <= 5d+195) then
tmp = 1.0d0 - (x ** (1.0d0 / n))
else
tmp = 1.0d0 / (n * x)
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if ((1.0 / n) <= -4e-32) {
tmp = Math.pow(x, ((1.0 / n) + -1.0)) / n;
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - Math.pow(x, (1.0 / n));
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
def code(x, n): tmp = 0 if (1.0 / n) <= -4e-32: tmp = math.pow(x, ((1.0 / n) + -1.0)) / n elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n elif (1.0 / n) <= 5e+195: tmp = 1.0 - math.pow(x, (1.0 / n)) else: tmp = 1.0 / (n * x) return tmp
function code(x, n) tmp = 0.0 if (Float64(1.0 / n) <= -4e-32) tmp = Float64((x ^ Float64(Float64(1.0 / n) + -1.0)) / n); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); elseif (Float64(1.0 / n) <= 5e+195) tmp = Float64(1.0 - (x ^ Float64(1.0 / n))); else tmp = Float64(1.0 / Float64(n * x)); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if ((1.0 / n) <= -4e-32) tmp = (x ^ ((1.0 / n) + -1.0)) / n; elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; elseif ((1.0 / n) <= 5e+195) tmp = 1.0 - (x ^ (1.0 / n)); else tmp = 1.0 / (n * x); end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-32], N[(N[Power[x, N[(N[(1.0 / n), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-32}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n} + -1\right)}}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (pow x (/ 1.0 n))))
(if (<= (/ 1.0 n) -2e-18)
(/ t_0 (* n x))
(if (<= (/ 1.0 n) 5000.0)
(/ (- (log (/ x (+ 1.0 x)))) n)
(if (<= (/ 1.0 n) 5e+195) (- 1.0 t_0) (/ 1.0 (* n x)))))))
double code(double x, double n) {
double t_0 = pow(x, (1.0 / n));
double tmp;
if ((1.0 / n) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - t_0;
} else {
tmp = 1.0 / (n * x);
}
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) <= (-2d-18)) then
tmp = t_0 / (n * x)
else if ((1.0d0 / n) <= 5000.0d0) then
tmp = -log((x / (1.0d0 + x))) / n
else if ((1.0d0 / n) <= 5d+195) then
tmp = 1.0d0 - t_0
else
tmp = 1.0d0 / (n * x)
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) <= -2e-18) {
tmp = t_0 / (n * x);
} else if ((1.0 / n) <= 5000.0) {
tmp = -Math.log((x / (1.0 + x))) / n;
} else if ((1.0 / n) <= 5e+195) {
tmp = 1.0 - t_0;
} else {
tmp = 1.0 / (n * x);
}
return tmp;
}
def code(x, n): t_0 = math.pow(x, (1.0 / n)) tmp = 0 if (1.0 / n) <= -2e-18: tmp = t_0 / (n * x) elif (1.0 / n) <= 5000.0: tmp = -math.log((x / (1.0 + x))) / n elif (1.0 / n) <= 5e+195: tmp = 1.0 - t_0 else: tmp = 1.0 / (n * x) return tmp
function code(x, n) t_0 = x ^ Float64(1.0 / n) tmp = 0.0 if (Float64(1.0 / n) <= -2e-18) tmp = Float64(t_0 / Float64(n * x)); elseif (Float64(1.0 / n) <= 5000.0) tmp = Float64(Float64(-log(Float64(x / Float64(1.0 + x)))) / n); elseif (Float64(1.0 / n) <= 5e+195) tmp = Float64(1.0 - t_0); else tmp = Float64(1.0 / Float64(n * x)); end return tmp end
function tmp_2 = code(x, n) t_0 = x ^ (1.0 / n); tmp = 0.0; if ((1.0 / n) <= -2e-18) tmp = t_0 / (n * x); elseif ((1.0 / n) <= 5000.0) tmp = -log((x / (1.0 + x))) / n; elseif ((1.0 / n) <= 5e+195) tmp = 1.0 - t_0; else tmp = 1.0 / (n * x); 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], -2e-18], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5000.0], N[((-N[Log[N[(x / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+195], N[(1.0 - t$95$0), $MachinePrecision], N[(1.0 / N[(n * x), $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^{-18}:\\
\;\;\;\;\frac{t_0}{n \cdot x}\\
\mathbf{elif}\;\frac{1}{n} \leq 5000:\\
\;\;\;\;\frac{-\log \left(\frac{x}{1 + x}\right)}{n}\\
\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+195}:\\
\;\;\;\;1 - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{n \cdot x}\\
\end{array}
\end{array}
(FPCore (x n)
:precision binary64
(let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
(if (<= x 7.5e-227)
t_0
(if (<= x 2.6e-208)
(* (log x) (/ -1.0 n))
(if (<= x 5.5e-173)
t_0
(if (<= x 2.8e-38)
(/ (- (log x)) n)
(if (<= x 2.3e-25)
t_0
(if (<= x 1.0)
(/ (- x (log x)) n)
(if (<= x 2.6e+128) (/ (/ 1.0 n) x) (/ 0.0 n))))))))))
double code(double x, double n) {
double t_0 = 1.0 - pow(x, (1.0 / n));
double tmp;
if (x <= 7.5e-227) {
tmp = t_0;
} else if (x <= 2.6e-208) {
tmp = log(x) * (-1.0 / n);
} else if (x <= 5.5e-173) {
tmp = t_0;
} else if (x <= 2.8e-38) {
tmp = -log(x) / n;
} else if (x <= 2.3e-25) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = (x - log(x)) / n;
} else if (x <= 2.6e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / 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 = 1.0d0 - (x ** (1.0d0 / n))
if (x <= 7.5d-227) then
tmp = t_0
else if (x <= 2.6d-208) then
tmp = log(x) * ((-1.0d0) / n)
else if (x <= 5.5d-173) then
tmp = t_0
else if (x <= 2.8d-38) then
tmp = -log(x) / n
else if (x <= 2.3d-25) then
tmp = t_0
else if (x <= 1.0d0) then
tmp = (x - log(x)) / n
else if (x <= 2.6d+128) then
tmp = (1.0d0 / n) / x
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double t_0 = 1.0 - Math.pow(x, (1.0 / n));
double tmp;
if (x <= 7.5e-227) {
tmp = t_0;
} else if (x <= 2.6e-208) {
tmp = Math.log(x) * (-1.0 / n);
} else if (x <= 5.5e-173) {
tmp = t_0;
} else if (x <= 2.8e-38) {
tmp = -Math.log(x) / n;
} else if (x <= 2.3e-25) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 2.6e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): t_0 = 1.0 - math.pow(x, (1.0 / n)) tmp = 0 if x <= 7.5e-227: tmp = t_0 elif x <= 2.6e-208: tmp = math.log(x) * (-1.0 / n) elif x <= 5.5e-173: tmp = t_0 elif x <= 2.8e-38: tmp = -math.log(x) / n elif x <= 2.3e-25: tmp = t_0 elif x <= 1.0: tmp = (x - math.log(x)) / n elif x <= 2.6e+128: tmp = (1.0 / n) / x else: tmp = 0.0 / n return tmp
function code(x, n) t_0 = Float64(1.0 - (x ^ Float64(1.0 / n))) tmp = 0.0 if (x <= 7.5e-227) tmp = t_0; elseif (x <= 2.6e-208) tmp = Float64(log(x) * Float64(-1.0 / n)); elseif (x <= 5.5e-173) tmp = t_0; elseif (x <= 2.8e-38) tmp = Float64(Float64(-log(x)) / n); elseif (x <= 2.3e-25) tmp = t_0; elseif (x <= 1.0) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 2.6e+128) tmp = Float64(Float64(1.0 / n) / x); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) t_0 = 1.0 - (x ^ (1.0 / n)); tmp = 0.0; if (x <= 7.5e-227) tmp = t_0; elseif (x <= 2.6e-208) tmp = log(x) * (-1.0 / n); elseif (x <= 5.5e-173) tmp = t_0; elseif (x <= 2.8e-38) tmp = -log(x) / n; elseif (x <= 2.3e-25) tmp = t_0; elseif (x <= 1.0) tmp = (x - log(x)) / n; elseif (x <= 2.6e+128) tmp = (1.0 / n) / x; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7.5e-227], t$95$0, If[LessEqual[x, 2.6e-208], N[(N[Log[x], $MachinePrecision] * N[(-1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-173], t$95$0, If[LessEqual[x, 2.8e-38], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 2.3e-25], t$95$0, If[LessEqual[x, 1.0], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 2.6e+128], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;x \leq 7.5 \cdot 10^{-227}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-208}:\\
\;\;\;\;\log x \cdot \frac{-1}{n}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-173}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-25}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
(FPCore (x n) :precision binary64 (if (<= x 1.0) (/ (- x (log x)) n) (if (<= x 3.8e+128) (/ (/ 1.0 n) x) (/ 0.0 n))))
double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (x - log(x)) / n;
} else if (x <= 3.8e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (x - log(x)) / n
else if (x <= 3.8d+128) then
tmp = (1.0d0 / n) / x
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 1.0) {
tmp = (x - Math.log(x)) / n;
} else if (x <= 3.8e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 1.0: tmp = (x - math.log(x)) / n elif x <= 3.8e+128: tmp = (1.0 / n) / x else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(x - log(x)) / n); elseif (x <= 3.8e+128) tmp = Float64(Float64(1.0 / n) / x); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 1.0) tmp = (x - log(x)) / n; elseif (x <= 3.8e+128) tmp = (1.0 / n) / x; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 1.0], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 3.8e+128], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{x - \log x}{n}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
(FPCore (x n) :precision binary64 (if (<= x 0.55) (/ (- (log x)) n) (if (<= x 3.1e+128) (/ (/ 1.0 n) x) (/ 0.0 n))))
double code(double x, double n) {
double tmp;
if (x <= 0.55) {
tmp = -log(x) / n;
} else if (x <= 3.1e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / 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.55d0) then
tmp = -log(x) / n
else if (x <= 3.1d+128) then
tmp = (1.0d0 / n) / x
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 0.55) {
tmp = -Math.log(x) / n;
} else if (x <= 3.1e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 0.55: tmp = -math.log(x) / n elif x <= 3.1e+128: tmp = (1.0 / n) / x else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 0.55) tmp = Float64(Float64(-log(x)) / n); elseif (x <= 3.1e+128) tmp = Float64(Float64(1.0 / n) / x); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 0.55) tmp = -log(x) / n; elseif (x <= 3.1e+128) tmp = (1.0 / n) / x; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 0.55], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 3.1e+128], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.55:\\
\;\;\;\;\frac{-\log x}{n}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\end{array}
(FPCore (x n) :precision binary64 (if (<= x 2.8e+128) (/ (/ 1.0 n) x) (/ 0.0 n)))
double code(double x, double n) {
double tmp;
if (x <= 2.8e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
real(8) :: tmp
if (x <= 2.8d+128) then
tmp = (1.0d0 / n) / x
else
tmp = 0.0d0 / n
end if
code = tmp
end function
public static double code(double x, double n) {
double tmp;
if (x <= 2.8e+128) {
tmp = (1.0 / n) / x;
} else {
tmp = 0.0 / n;
}
return tmp;
}
def code(x, n): tmp = 0 if x <= 2.8e+128: tmp = (1.0 / n) / x else: tmp = 0.0 / n return tmp
function code(x, n) tmp = 0.0 if (x <= 2.8e+128) tmp = Float64(Float64(1.0 / n) / x); else tmp = Float64(0.0 / n); end return tmp end
function tmp_2 = code(x, n) tmp = 0.0; if (x <= 2.8e+128) tmp = (1.0 / n) / x; else tmp = 0.0 / n; end tmp_2 = tmp; end
code[x_, n_] := If[LessEqual[x, 2.8e+128], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision], N[(0.0 / n), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{1}{n}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{n}\\
\end{array}
\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(1.0 / Float64(n * x)) end
function tmp = code(x, n) tmp = 1.0 / (n * x); end
code[x_, n_] := N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{n \cdot x}
\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 (/ x n))
double code(double x, double n) {
return x / n;
}
real(8) function code(x, n)
real(8), intent (in) :: x
real(8), intent (in) :: n
code = x / n
end function
public static double code(double x, double n) {
return x / n;
}
def code(x, n): return x / n
function code(x, n) return Float64(x / n) end
function tmp = code(x, n) tmp = x / n; end
code[x_, n_] := N[(x / n), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{n}
\end{array}
herbie shell --seed 2024010
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))