|
20 | 20 | it 'returns zero' do |
21 | 21 | f = SymEngine::sin(@pi) |
22 | 22 | expect(f).to eql(0) |
| 23 | + end |
| 24 | + end |
| 25 | + end |
| 26 | + |
| 27 | + describe '#cos' do |
| 28 | + context 'calculation of cos pi' do |
| 29 | + it 'returns minus one' do |
| 30 | + f = SymEngine::cos(@pi) |
| 31 | + expect(f).to eql(-1) |
| 32 | + end |
| 33 | + end |
| 34 | + end |
| 35 | + |
| 36 | + describe '#tan' do |
| 37 | + context 'calculation of tan pi' do |
| 38 | + it 'returns zero' do |
| 39 | + f = SymEngine::tan(@pi) |
| 40 | + expect(f).to eql(0) |
| 41 | + end |
| 42 | + end |
| 43 | + end |
| 44 | + |
| 45 | + describe '#csc' do |
| 46 | + context 'calculation of csc pi div 2' do |
| 47 | + it 'returns one' do |
| 48 | + f = SymEngine::csc(@pi/2) |
| 49 | + expect(f).to eql(1) |
| 50 | + end |
| 51 | + end |
| 52 | + end |
| 53 | + |
| 54 | + describe '#sec' do |
| 55 | + context 'calculation of sec pi' do |
| 56 | + it 'returns minus one' do |
| 57 | + f = SymEngine::sec(@pi) |
| 58 | + expect(f).to eql(-1) |
| 59 | + end |
| 60 | + end |
| 61 | + end |
| 62 | + |
| 63 | + describe '#cot' do |
| 64 | + context 'calculation of cot pi div 4' do |
| 65 | + it 'returns one' do |
| 66 | + f = SymEngine::cot(@pi/4) |
| 67 | + expect(f).to eql(1) |
| 68 | + end |
| 69 | + end |
| 70 | + end |
| 71 | + |
| 72 | + describe '#asin' do |
| 73 | + context 'calculation of asin 1' do |
| 74 | + it 'returns pi div 2' do |
| 75 | + f = SymEngine::asin(1) |
| 76 | + expect(f).to eql(@pi/2) |
| 77 | + end |
| 78 | + end |
| 79 | + end |
| 80 | + |
| 81 | + describe '#acos' do |
| 82 | + context 'calculation of acos 1' do |
| 83 | + it 'returns zer0' do |
| 84 | + f = SymEngine::acos(1) |
| 85 | + expect(f).to eql(0) |
| 86 | + end |
| 87 | + end |
| 88 | + end |
| 89 | + |
| 90 | + describe '#atan' do |
| 91 | + context 'calculation of atan 1' do |
| 92 | + it 'returns pi div 4' do |
| 93 | + f = SymEngine::atan(1) |
| 94 | + expect(f).to eql(@pi/4) |
| 95 | + end |
| 96 | + end |
| 97 | + end |
| 98 | + |
| 99 | + describe '#acsc' do |
| 100 | + context 'calculation of acsc 1' do |
| 101 | + it 'returns pi div 2' do |
| 102 | + f = SymEngine::acsc(1) |
| 103 | + expect(f).to eql(@pi/2) |
| 104 | + end |
| 105 | + end |
| 106 | + end |
| 107 | + |
| 108 | + describe '#asec' do |
| 109 | + context 'calculation of asec 1' do |
| 110 | + it 'returns zero' do |
| 111 | + f = SymEngine::asec(1) |
| 112 | + expect(f).to eql(0) |
| 113 | + end |
| 114 | + end |
| 115 | + end |
| 116 | + |
| 117 | + describe '#acot' do |
| 118 | + context 'calculation of acot 1' do |
| 119 | + it 'returns pi div 4' do |
| 120 | + f = SymEngine::acot(1) |
| 121 | + expect(f).to eql(@pi/4) |
| 122 | + end |
| 123 | + end |
| 124 | + end |
| 125 | + |
| 126 | + describe '#sinh' do |
| 127 | + context 'calculation of sinh zero' do |
| 128 | + it 'returns zero' do |
| 129 | + f = SymEngine::sinh(0) |
| 130 | + expect(f).to eql(0) |
| 131 | + end |
| 132 | + end |
| 133 | + end |
| 134 | + |
| 135 | + describe '#cosh' do |
| 136 | + context 'calculation of cosh zero' do |
| 137 | + it 'returns one' do |
| 138 | + f = SymEngine::cosh(0) |
| 139 | + expect(f).to eql(1) |
| 140 | + end |
| 141 | + end |
| 142 | + end |
| 143 | + |
| 144 | + describe '#tanh' do |
| 145 | + context 'calculation of tanh zero' do |
| 146 | + it 'returns zero' do |
| 147 | + f = SymEngine::tanh(0) |
| 148 | + expect(f).to eql(0) |
| 149 | + end |
| 150 | + end |
| 151 | + end |
| 152 | + |
| 153 | + describe '#csch' do |
| 154 | + context 'calculation of csch 1' do |
| 155 | + it 'returns csch(1)' do |
| 156 | + f = SymEngine::csch(1) |
| 157 | + expect(f.to_s).to eql('csch(1)') |
| 158 | + end |
| 159 | + end |
| 160 | + end |
| 161 | + |
| 162 | + describe '#sech' do |
| 163 | + context 'calculation of sech zero' do |
| 164 | + it 'returns one' do |
| 165 | + f = SymEngine::sech(0) |
| 166 | + expect(f).to eql(1) |
| 167 | + end |
| 168 | + end |
| 169 | + end |
| 170 | + |
| 171 | + describe '#coth' do |
| 172 | + context 'calculation of coth 1' do |
| 173 | + it 'returns coth(1)' do |
| 174 | + f = SymEngine::coth(1) |
| 175 | + expect(f.to_s).to eql('coth(1)') |
| 176 | + end |
| 177 | + end |
| 178 | + end |
| 179 | + |
| 180 | + describe '#asinh' do |
| 181 | + context 'calculation of asinh zero' do |
| 182 | + it 'returns 0' do |
| 183 | + f = SymEngine::asinh(0) |
| 184 | + expect(f).to eql(0) |
| 185 | + end |
| 186 | + end |
| 187 | + end |
| 188 | + |
| 189 | + describe '#acosh' do |
| 190 | + context 'calculation of acosh 1' do |
| 191 | + it 'returns zero' do |
| 192 | + f = SymEngine::acosh(1) |
| 193 | + expect(f).to eql(0) |
| 194 | + end |
| 195 | + end |
| 196 | + end |
| 197 | + |
| 198 | + describe '#atanh' do |
| 199 | + context 'calculation of atanh zero' do |
| 200 | + it 'returns zero' do |
| 201 | + f = SymEngine::atanh(0) |
| 202 | + expect(f).to eql(0) |
| 203 | + end |
| 204 | + end |
| 205 | + end |
| 206 | + |
| 207 | + describe '#acsch' do |
| 208 | + context 'calculation of acsch 1' do |
| 209 | + it 'returns log(1 + 2**(1/2))' do |
| 210 | + f = SymEngine::acsch(1) |
| 211 | + expect(f.to_s).to eql('log(1 + 2**(1/2))') |
| 212 | + end |
| 213 | + end |
| 214 | + end |
| 215 | + |
| 216 | + describe '#asech' do |
| 217 | + context 'calculation of asech 1' do |
| 218 | + it 'returns zero' do |
| 219 | + f = SymEngine::asech(1) |
| 220 | + expect(f).to eql(0) |
| 221 | + end |
| 222 | + end |
| 223 | + end |
| 224 | + |
| 225 | + describe '#acoth' do |
| 226 | + context 'calculation of acoth 1' do |
| 227 | + it 'returns acoth(1)' do |
| 228 | + f = SymEngine::acoth(1) |
| 229 | + expect(f.to_s).to eql('acoth(1)') |
| 230 | + end |
| 231 | + end |
| 232 | + end |
| 233 | + |
| 234 | + describe '#lambertw' do |
| 235 | + context 'calculation of lambertw -e**-1' do |
| 236 | + it 'returns -1' do |
| 237 | + f = SymEngine::lambertw(-@e**(-1)) |
| 238 | + expect(f).to eql(-1) |
| 239 | + end |
| 240 | + end |
| 241 | + end |
| 242 | + |
| 243 | + describe '#zeta' do |
| 244 | + context 'calculation of zeta zero' do |
| 245 | + it 'returns minus half' do |
| 246 | + f = SymEngine::zeta(0) |
| 247 | + r1 = SymEngine::Integer.new(-1) |
| 248 | + r2 = SymEngine::Integer.new(2) |
| 249 | + r = r1/r2 |
| 250 | + expect(f).to eql(r) |
| 251 | + end |
| 252 | + end |
| 253 | + end |
| 254 | + |
| 255 | + describe '#dirichlet_eta' do |
| 256 | + context 'calculation of dirichlet_eta 1' do |
| 257 | + it 'returns log(2)' do |
| 258 | + f = SymEngine::dirichlet_eta(1) |
| 259 | + expect(f.to_s).to eql('log(2)') |
| 260 | + end |
| 261 | + end |
| 262 | + end |
23 | 263 |
|
| 264 | + describe '#gamma' do |
| 265 | + context 'calculation of gamma 1' do |
| 266 | + it 'returns one' do |
| 267 | + f = SymEngine::gamma(1) |
| 268 | + expect(f.to_s).to eql('1') |
24 | 269 | end |
25 | 270 | end |
26 | 271 | end |
|
0 commit comments