aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/020-exponential/uebungsaufgaben/2.c
blob: c5a9644db6ebbf3d3cc9510d3b589632b6dd490f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * 2.c -- solution to problem 2
 *
 * (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
 */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_sf_lambert.h>

int	main(int argc, char *argv[]) {
	double	s = log(2);
	printf("s = %f\n", s);
	double	t = gsl_sf_lambert_W0(s);
	printf("t = %f\n", t);
	double	y = exp(t);
	printf("y = %f\n", y);
	double	x = atan(y);
	printf("x = %.18f\n", x);
	printf("2 = %f\n", pow(tan(x),tan(x)));
	return EXIT_SUCCESS;
}