Define a function F
as follows:
F[α_, x_] =
N[Exp[x/2] Abs[Gamma[α/2 + I x /(2 Pi)]]^2, 10];
It is a product of two terms. As $x\to\infty$, the first term exponentially increases while the second term exponentially decreases. Their product moderately increases by a power-law.
If I evaluate F[6, 10000]
, the answer is 6.4163*10^16
, which seems reasonable. However, if I evaluate F[6, 10000.1]
, the answer is 0.
This is not expected since F
is a continuous function.
I think the issue is on the precision, so I modified the definition F
by removing N
.
F[α_, x_] =
Exp[x/2] Abs[Gamma[α/2 + I x /(2 Pi)]]^2;
Then, even Gfintemp[6, 10000] // N
gives the wrong answer 0.
.
How can I fix the problem, so that F
gives a reasonable output for moderate values of $x$, written in exact number or numeric?
F[6, 10000.1`20]
$\endgroup$F[]
if you want to handle machine-precision inpuit. For instance,F[\[Alpha]_, x_] := With[{\[Alpha]0 = SetPrecision[\[Alpha], Infinity], x0 = SetPrecision[x, Infinity]}, N[Exp[x0/2] Abs[Gamma[\[Alpha]0/2 + I x0/(2 Pi)]]^2, 10] ];
-- Insteaed ofSetPrecision
could also useRationalize
which tends to change the value of the input slightly but also produce smaller denominators. $\endgroup$F
does not work;F[6, 10000.1]
gives unwanted0.
$\endgroup$:=
in mine vs.=
inF[]
above is significant. $\endgroup$