ノイマン関数の次数。非負でなければならない。
The order of the Neuman function ,
which must be non-negative.
z
ノイマン関数の引数の値。
が実数の場合、の範囲を推奨する。
複素数値については適切な値の範囲をチェックできていない。
The value of the argument for the Neuman function .
For real , a range is recommended.
An appropriate range for complex has not been examined.
◆戻り値(Return value)
引数で指定したとの組に対するの値。
The value of for and specified by the arguments.
◆使用例(Example)
double complex N=cneuman(1,0.5);
◆計算方法(Computation method)
●概要
(Outline)
に対しては級数表示
を用いる。に対しては漸化式
を用いる。
For 0 and 1, a series expansion formula given as
Eqs. ()-() is used.
For , a recursive formula () is used.
●計算式の簡単化
(Simplified formula)
()式を用いるのはに対してだけであるので
具体的に書き下すとより簡単になる。に対する式は
に対する式は
である。
Because Eq. () is used only for 0 and 1,
explicit formulas for these values are simpler than the original ones.
The formulas for 0 and 1 are given by
Eqs. () and (), respectively.
●無限級数の扱い
(Treatment of the infinite series)
()()式には無限級数が登場する。
これに対するプログラム内部の扱いとしては、
新たに加わる項の大きさがそれまでの項の和の倍を下回ったら
ループを抜けるという処理にしている。
An infinite series appears
in Eqs. () and ().
In the program, the summation is taken
until the newly added term becomes smaller than
times the summation.
●オーバーフローの回避
(Avoiding an over flow)
()()式に登場する
やなどを別々に計算すると
オーバーフローが起きる危険が増すので、
このプログラムではに掛かる係数全体をfactorという名前の変数で表現している。
この変数の初期値を1とし、
が1増えるごとにこの変数にを掛けるようにすれば
オーバーフローを回避しながらfactorを計算することが容易になる。
Individual computations of and
in Eqs. () and ()
involve a high risk of overflow.
To avoid this, the program uses a variable named “factor”,
which represents the entire factor that is multiplied with .
This value is initialized at 1
and multiplied by for each in the loop.
In this way, the variable “factor” can easily be computed
without a overflow.
◆使用上の注意(Note)
と比較してが小さいときにはの大きくなるスピードは緩やかで、
大きなになるほどは相対的に急激に成長するようになる。
その結果、()()式に登場する
無限級数の項の大きさはあるまでは増加の一途を辿り、
がある程度以上大きくなると減少に転じる。
無限級数の各項にはが掛かっているので
大きな項も打ち消し合って最終的には小さな値に落ち着く。
但し、計算の途中であまりにも大きな項が登場すると打ち消し合う際に桁落ちが生じ、
計算の精度が悪くなる。
double型変数の有効桁数が15桁程度であるので、
最終的な和の値に比べて15桁以上大きな項同士が打ち消し合う状況が発生すると
計算は事実上不可能になる。
の値が大きいほどこのようなことは起こりやすい。
として正の実数値を用いた数値計算の結果では
によらずおおよそでこの問題が起きた。
このことからこの関数ではの場合に警告を出す仕様にしている。
しかしながら、が複素数の場合にどのようなにおいて
問題が起きるのかは未検証である。
Compared to ,
relatively slowly increases for a small
but the growing speed of rapidly increases for a large .
As a result, a term in the infinite series
in Eqs. () and ()
increases until a certain , after which the term decreases.
Since appears in each term,
large terms cancels out, resulting in a small final summation value.
However, if a term appearing in the summation is too large,
the summation results in a cancellation of significant digits,
which worsens the accuracy of the computation result.
Because a double-type variable has an accuracy of approximately 15 digits,
if terms which are by 15 orders larger than the final summation value
cancel out, the final result is completely a numerical noise.
This situation more likely occurs for larger .
According to a numerical simulation using a positive real ,
this problem occurred at regardless of the value.
Therefore this function warns if .
However, no test have been conducted for a complex value.