summaryrefslogtreecommitdiff
path: root/src/test/testSinh.c
blob: 22ac851c691c83aa1b1a871353dd9c53780f7a7f (plain)
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
/*
**  -*- C -*-
**
** testSinh.c
** Made by  Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on  Fri Dec  8 15:06:16 2006 jofret
** Last update Mon Jan 29 16:16:59 2007 jofret
**
** Copyright INRIA 2006
*/

#include <stdio.h>

#define PI 3.1415826535

float ssinhs(float);
double dsinhs(double);

void ssinhsTest() {
  printf(">> Float scalar\n");
  printf("ssinhs(0) = %f\n", ssinhs((float) 0));
  printf("ssinhs(PI) = %f\n", ssinhs(PI));
  printf("ssinhs(PI/2) = %f\n", ssinhs(PI/2));
  printf("ssinhs(PI/3) = %f\n", ssinhs(PI/3));
  printf("ssinhs(PI/4) = %f\n", ssinhs(PI/4));
  printf("ssinhs(PI/6) = %f\n", ssinhs(PI/6));
  printf("ssinhs(-PI) = %f\n", ssinhs(-PI));
  printf("ssinhs(-PI/2) = %f\n", ssinhs(-PI/2));
  printf("ssinhs(-PI/3) = %f\n", ssinhs(-PI/3));
  printf("ssinhs(-PI/4) = %f\n", ssinhs(-PI/4));
  printf("ssinhs(-PI/6) = %f\n", ssinhs(-PI/6));
}

void dsinhsTest() {
  printf(">> Double scalar\n");
  printf("dsinhs(0) = %e\n", dsinhs((double) 0));
  printf("dsinhs(PI) = %e\n", dsinhs(PI));
  printf("dsinhs(PI/2) = %e\n", dsinhs(PI/2));
  printf("dsinhs(PI/3) = %e\n", dsinhs(PI/3));
  printf("dsinhs(PI/4) = %e\n", dsinhs(PI/4));
  printf("dsinhs(PI/6) = %e\n", dsinhs(PI/6));
  printf("dsinhs(-PI) = %e\n", dsinhs(-PI));
  printf("dsinhs(-PI/2) = %e\n", dsinhs(-PI/2));
  printf("dsinhs(-PI/3) = %e\n", dsinhs(-PI/3));
  printf("dsinhs(-PI/4) = %e\n", dsinhs(-PI/4));
  printf("dsinhs(-PI/6) = %e\n", dsinhs(-PI/6));
}

int testSinh() {
  printf(">>>> Hyperbolic Sine Tests\n");
  ssinhsTest();
  dsinhsTest();
  return 0;
}