diff options
author | Joshua Baer <joshua.baer@ost.ch> | 2022-07-28 11:06:51 +0200 |
---|---|---|
committer | Joshua Baer <joshua.baer@ost.ch> | 2022-07-28 11:06:51 +0200 |
commit | 6daf7cad8900822d63ac5539058e71fbf5da3b20 (patch) | |
tree | 7ebcbfc3948cb8525f47ede288dab384bffc5373 /buch/papers/0f1/listings/kettenbruchIterativ.c | |
parent | Reorganized Kapitel (diff) | |
parent | Merge pull request #33 from f1bi1n/master (diff) | |
download | SeminarSpezielleFunktionen-6daf7cad8900822d63ac5539058e71fbf5da3b20.tar.gz SeminarSpezielleFunktionen-6daf7cad8900822d63ac5539058e71fbf5da3b20.zip |
Merge branch 'master' of github.com:JODBaer/SeminarSpezielleFunktionen
Diffstat (limited to 'buch/papers/0f1/listings/kettenbruchIterativ.c')
-rw-r--r-- | buch/papers/0f1/listings/kettenbruchIterativ.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/buch/papers/0f1/listings/kettenbruchIterativ.c b/buch/papers/0f1/listings/kettenbruchIterativ.c index befea8e..d897b8f 100644 --- a/buch/papers/0f1/listings/kettenbruchIterativ.c +++ b/buch/papers/0f1/listings/kettenbruchIterativ.c @@ -1,5 +1,13 @@ -static double fractionRekursion0f1(const double c, const double x, unsigned int n)
+/**
+ * @brief Calculates the Hypergeometric Function 0F1(;b;z)
+ * @param b0 in 0F1(;b0;z)
+ * @param z in 0F1(;b0;z)
+ * @param n number of itertions (precision)
+ * @return Result
+ */
+static double fractionRekursion0f1(const double c, const double z, unsigned int n)
{
+ //declaration
double a = 0.0;
double b = 0.0;
double Ak = 0.0;
@@ -21,15 +29,15 @@ static double fractionRekursion0f1(const double c, const double x, unsigned int else if (k == 1)
{
a = 1.0; //a1
- b = x/c; //b1
+ b = z/c; //b1
//recursion fomula for A1, B1
Ak = a * Ak_1 + b * 1.0;
Bk = a * Bk_1;
}
else
{
- a = 1 + (x / (k * ((k - 1) + c)));//ak
- b = -(x / (k * ((k - 1) + c))); //bk
+ a = 1 + (z / (k * ((k - 1) + c)));//ak
+ b = -(z / (k * ((k - 1) + c))); //bk
//recursion fomula for Ak, Bk
Ak = a * Ak_1 + b * Ak_2;
Bk = a * Bk_1 + b * Bk_2;
|