aboutsummaryrefslogtreecommitdiffstats
path: root/buch/papers/0f1/listings/potenzreihe.c
diff options
context:
space:
mode:
Diffstat (limited to 'buch/papers/0f1/listings/potenzreihe.c')
-rw-r--r--buch/papers/0f1/listings/potenzreihe.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/buch/papers/0f1/listings/potenzreihe.c b/buch/papers/0f1/listings/potenzreihe.c
index bfaa0e3..3eb9b86 100644
--- a/buch/papers/0f1/listings/potenzreihe.c
+++ b/buch/papers/0f1/listings/potenzreihe.c
@@ -1,5 +1,61 @@
#include <math.h>
+/**
+ * @brief Calculates pochhammer
+ * @param (a+n-1)!
+ * @return Result
+ */
+static double pochhammer(const double x, double n)
+{
+ double temp = x;
+
+ if (n > 0)
+ {
+ while (n > 1)
+ {
+ temp *= (x + n - 1);
+ --n;
+ }
+
+ return temp;
+ }
+ else
+ {
+ return 1;
+ }
+}
+
+/**
+ * @brief Calculates the Factorial
+ * @param n!
+ * @return Result
+ */
+static double fac(int n)
+{
+ double temp = n;
+
+ if (n > 0)
+ {
+ while (n > 1)
+ {
+ --n;
+ temp *= n;
+ }
+ return temp;
+ }
+ else
+ {
+ return 1;
+ }
+}
+
+/**
+ * @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 powerseries(const double b, const double z, unsigned int n)
{
double temp = 0.0;