aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/math-lib/cosecant.c
blob: 207974b44a676e55ff4e81b158f9ee3c15dc8e4a (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
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
93
94
95
96
97
98
/*
 * Copyright (C) 2000, Imperial College
 *
 * This file is part of the Imperial College Exact Real Arithmetic Library.
 * See the copyright notice included in the distribution for conditions
 * of use.
 */

#include <stdio.h>
#include "real.h"

/*
 * These functions should probably be broken into separate files.
 */

/*
 * cosec x = 1 / (sin x)
 */
Real
cosec_R(Real x)
{
	return div_Int_R(1, sin_R(x));
}

Real
cosec_QInt(int a, int b)
{
	return div_Int_R(1, sin_QInt(a, b));
}

Real
cosec_QZ(mpz_t a, mpz_t b)
{
	return div_Int_R(1, sin_QZ(a, b));
}

/*
 * acosec x = asin (1/x)
 */
Real
acosec_R(Real x)
{
	return asin_R(div_Int_R(1, x));
}

Real
acosec_QInt(int a, int b)
{
	return asin_QInt(b, a);
}

Real
acosec_QZ(mpz_t a, mpz_t b)
{
	return asin_QZ(b, a);
}

/*
 * cosech x = 1 / (sinh x)
 */
Real
cosech_R(Real x)
{
	return div_Int_R(1, sinh_R(x));
}

Real
cosech_QInt(int a, int b)
{
	return div_Int_R(1, sinh_QInt(a, b));
}

Real
cosech_QZ(mpz_t a, mpz_t b)
{
	return div_Int_R(1, sinh_QZ(a, b));
}

/*
 * acosech x = asinh (1/x)
 */
Real
acosech_R(Real x)
{
	return asinh_R(div_Int_R(1, x));
}

Real
acosech_QInt(int a, int b)
{
	return asinh_QInt(b, a);
}

Real
acosech_QZ(mpz_t a, mpz_t b)
{
	return asinh_QZ(b, a);
}