aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/020-exponential/code
diff options
context:
space:
mode:
authorAndreas Müller <andreas.mueller@ost.ch>2021-06-06 21:40:29 +0200
committerAndreas Müller <andreas.mueller@ost.ch>2021-06-06 21:40:29 +0200
commitb2bd95848f389065dba2bb2ae1e0c58ed812b29a (patch)
tree5c5dd25bb18ea1b025e13c987efe6fee023f1eee /buch/chapters/020-exponential/code
parentTests (diff)
downloadSeminarSpezielleFunktionen-b2bd95848f389065dba2bb2ae1e0c58ed812b29a.tar.gz
SeminarSpezielleFunktionen-b2bd95848f389065dba2bb2ae1e0c58ed812b29a.zip
add new problem
Diffstat (limited to 'buch/chapters/020-exponential/code')
-rw-r--r--buch/chapters/020-exponential/code/xxl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/buch/chapters/020-exponential/code/xxl.c b/buch/chapters/020-exponential/code/xxl.c
new file mode 100644
index 0000000..2c38ffe
--- /dev/null
+++ b/buch/chapters/020-exponential/code/xxl.c
@@ -0,0 +1,19 @@
+/*
+ * xxl.c -- find solution of x^x = 27
+ *
+ * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschue
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <gsl/gsl_sf_lambert.h>
+
+int main(int argc, char *argv[]) {
+ double b = 27;
+ double w = gsl_sf_lambert_W0(log(b));
+ printf("W_0(log(27)) = %f\n", w);
+ double x = exp(w);
+ printf("x = %f\n", x);
+
+ return EXIT_SUCCESS;
+}