1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/*
** -*- C -*-
**
** testTanh.c
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Fri Dec 8 15:05:44 2006 jofret
** Last update Wed Feb 14 17:17:37 2007 jofret
**
** Copyright INRIA 2006
*/
#include <stdio.h>
#define PI 3.1415826535
float stanhs(float);
double dtanhs(double);
void stanhsTest() {
printf(">> Float scalar\n");
printf("stanhs(0) = %f\n", stanhs((float) 0));
printf("stanhs(PI) = %f\n", stanhs(PI));
printf("stanhs(PI/2) = %f\n", stanhs(PI/2));
printf("stanhs(PI/3) = %f\n", stanhs(PI/3));
printf("stanhs(PI/4) = %f\n", stanhs(PI/4));
printf("stanhs(PI/6) = %f\n", stanhs(PI/6));
printf("stanhs(-PI) = %f\n", stanhs(-PI));
printf("stanhs(-PI/2) = %f\n", stanhs(-PI/2));
printf("stanhs(-PI/3) = %f\n", stanhs(-PI/3));
printf("stanhs(-PI/4) = %f\n", stanhs(-PI/4));
printf("stanhs(-PI/6) = %f\n", stanhs(-PI/6));
}
void dtanhsTest() {
printf(">> Double scalar\n");
printf("dtanhs(0) = %e\n", dtanhs((double) 0));
printf("dtanhs(PI) = %e\n", dtanhs(PI));
printf("dtanhs(PI/2) = %e\n", dtanhs(PI/2));
printf("dtanhs(PI/3) = %e\n", dtanhs(PI/3));
printf("dtanhs(PI/4) = %e\n", dtanhs(PI/4));
printf("dtanhs(PI/6) = %e\n", dtanhs(PI/6));
printf("dtanhs(-PI) = %e\n", dtanhs(-PI));
printf("dtanhs(-PI/2) = %e\n", dtanhs(-PI/2));
printf("dtanhs(-PI/3) = %e\n", dtanhs(-PI/3));
printf("dtanhs(-PI/4) = %e\n", dtanhs(-PI/4));
printf("dtanhs(-PI/6) = %e\n", dtanhs(-PI/6));
}
void ctanhsTest() {
printf(">> Float Complex scalar\n");
/* FIXME : Implement some test here ... */
}
void ztanhsTest() {
printf(">> Double Complex scalar\n");
/* FIXME : Implement some test here ... */
}
void stanhaTest() {
printf(">> Float array\n");
/* FIXME : Implement some test here ... */
}
void dtanhaTest() {
printf(">> Double array\n");
/* FIXME : Implement some test here ... */
}
void ctanhaTest() {
printf(">> Float Complex array\n");
/* FIXME : Implement some test here ... */
}
void ztanhaTest() {
printf(">> Double Complex array\n");
/* FIXME : Implement some test here ... */
}
int testTanh() {
printf("\n>>>> Hyperbolic Tangeant Tests\n");
stanhsTest();
dtanhsTest();
ctanhsTest();
ztanhsTest();
stanhaTest();
dtanhaTest();
ctanhaTest();
ztanhaTest();
return 0;
}
|