ZOJ-3443-Bessel Function II


3443-Bessel Function II


Bessel function is one of the most important special functions in the field of physics. Many solutions of various physical phenomena have the form of this function. In mathematic notation, this function is deduced from the following differential equation:
这里写图片描述

There are two classes of solution of the above equation. One class of the solution (which is called the second kind of Bessel function) has the following image:

这里写图片描述
Because of its importance in the physics and it cannot be expressed by elementary functions, many formulas are deduced to numerically calculate it. The following integral is one of them.

Now you are asked to calculate Bessel function of the second kind using the above integral.

Input
The input consists multiple test cases. In each test case, there are two numbers in one line, indicating the v and z in the above integral. (0≤v≤20, 1≤z≤20.0)

Output
For each case, just format and print Yv(z) in “%.6le”. See sample for more details.

Sample Input
0 1.00
1 4.00
10 11.11
20 20.00

Sample Output
8.825696e-02
3.979257e-01
-1.797017e-01
-2.854895e-01

题目链接:ZOJ-3443

以下是代码:

#include <cmath>
#include <cstdio>

using namespace std;

int main()
{
    int n;
    double z;
    while(scanf("%d%lf",&n,&z) != EOF)
    {
        printf("%.6le\n",yn(n,z));
    }
    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值