From b2bd95848f389065dba2bb2ae1e0c58ed812b29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sun, 6 Jun 2021 21:40:29 +0200 Subject: add new problem --- buch/chapters/020-exponential/code/xxl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 buch/chapters/020-exponential/code/xxl.c (limited to 'buch/chapters/020-exponential/code') 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 +#include +#include +#include + +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; +} -- cgit v1.2.1