|
22 | 22 | expect(f).to eql(0) |
23 | 23 | end |
24 | 24 | end |
| 25 | + context 'sin(2x)' do |
| 26 | + it 'is an instance of sin' do |
| 27 | + f = SymEngine::sin(2*@x) |
| 28 | + expect(f).to be_an_instance_of SymEngine::Sin |
| 29 | + expect(f.to_s).to eql("sin(2*x)") |
| 30 | + end |
| 31 | + end |
25 | 32 | end |
26 | 33 |
|
27 | 34 | describe '#cos' do |
|
31 | 38 | expect(f).to eql(-1) |
32 | 39 | end |
33 | 40 | end |
| 41 | + context 'cos(2x)' do |
| 42 | + it 'is an instance of cos' do |
| 43 | + f = SymEngine::cos(2*@x) |
| 44 | + expect(f).to be_an_instance_of SymEngine::Cos |
| 45 | + expect(f.to_s).to eql("cos(2*x)") |
| 46 | + end |
| 47 | + end |
34 | 48 | end |
35 | 49 |
|
36 | 50 | describe '#tan' do |
|
40 | 54 | expect(f).to eql(0) |
41 | 55 | end |
42 | 56 | end |
| 57 | + context 'tan(2x)' do |
| 58 | + it 'is an instance of tan' do |
| 59 | + f = SymEngine::tan(2*@x) |
| 60 | + expect(f).to be_an_instance_of SymEngine::Tan |
| 61 | + expect(f.to_s).to eql("tan(2*x)") |
| 62 | + end |
| 63 | + end |
43 | 64 | end |
44 | 65 |
|
45 | 66 | describe '#csc' do |
|
49 | 70 | expect(f).to eql(1) |
50 | 71 | end |
51 | 72 | end |
| 73 | + context 'csc(2x)' do |
| 74 | + it 'is an instance of csc' do |
| 75 | + f = SymEngine::csc(2*@x) |
| 76 | + expect(f).to be_an_instance_of SymEngine::Csc |
| 77 | + expect(f.to_s).to eql("csc(2*x)") |
| 78 | + end |
| 79 | + end |
52 | 80 | end |
53 | 81 |
|
54 | 82 | describe '#sec' do |
|
58 | 86 | expect(f).to eql(-1) |
59 | 87 | end |
60 | 88 | end |
| 89 | + context 'sec(2x)' do |
| 90 | + it 'is an instance of sec' do |
| 91 | + f = SymEngine::sec(2*@x) |
| 92 | + expect(f).to be_an_instance_of SymEngine::Sec |
| 93 | + expect(f.to_s).to eql("sec(2*x)") |
| 94 | + end |
| 95 | + end |
61 | 96 | end |
62 | 97 |
|
63 | 98 | describe '#cot' do |
|
67 | 102 | expect(f).to eql(1) |
68 | 103 | end |
69 | 104 | end |
| 105 | + context 'cot(2x)' do |
| 106 | + it 'is an instance of cot' do |
| 107 | + f = SymEngine::cot(2*@x) |
| 108 | + expect(f).to be_an_instance_of SymEngine::Cot |
| 109 | + expect(f.to_s).to eql("cot(2*x)") |
| 110 | + end |
| 111 | + end |
70 | 112 | end |
71 | 113 |
|
72 | 114 | describe '#asin' do |
|
76 | 118 | expect(f).to eql(@pi/2) |
77 | 119 | end |
78 | 120 | end |
| 121 | + context 'asin(2x)' do |
| 122 | + it 'is an instance of asin' do |
| 123 | + f = SymEngine::asin(2*@x) |
| 124 | + expect(f).to be_an_instance_of SymEngine::ASin |
| 125 | + expect(f.to_s).to eql("asin(2*x)") |
| 126 | + end |
| 127 | + end |
79 | 128 | end |
80 | 129 |
|
81 | 130 | describe '#acos' do |
|
85 | 134 | expect(f).to eql(0) |
86 | 135 | end |
87 | 136 | end |
| 137 | + context 'acos(2x)' do |
| 138 | + it 'is an instance of acos' do |
| 139 | + f = SymEngine::acos(2*@x) |
| 140 | + expect(f).to be_an_instance_of SymEngine::ACos |
| 141 | + expect(f.to_s).to eql("acos(2*x)") |
| 142 | + end |
| 143 | + end |
88 | 144 | end |
89 | 145 |
|
90 | 146 | describe '#atan' do |
|
94 | 150 | expect(f).to eql(@pi/4) |
95 | 151 | end |
96 | 152 | end |
| 153 | + context 'atan(2x)' do |
| 154 | + it 'is an instance of atan' do |
| 155 | + f = SymEngine::atan(2*@x) |
| 156 | + expect(f).to be_an_instance_of SymEngine::ATan |
| 157 | + expect(f.to_s).to eql("atan(2*x)") |
| 158 | + end |
| 159 | + end |
97 | 160 | end |
98 | 161 |
|
99 | 162 | describe '#acsc' do |
|
103 | 166 | expect(f).to eql(@pi/2) |
104 | 167 | end |
105 | 168 | end |
| 169 | + context 'acsc(2x)' do |
| 170 | + it 'is an instance of acsc' do |
| 171 | + f = SymEngine::acsc(2*@x) |
| 172 | + expect(f).to be_an_instance_of SymEngine::ACsc |
| 173 | + expect(f.to_s).to eql("acsc(2*x)") |
| 174 | + end |
| 175 | + end |
106 | 176 | end |
107 | 177 |
|
108 | 178 | describe '#asec' do |
|
112 | 182 | expect(f).to eql(0) |
113 | 183 | end |
114 | 184 | end |
| 185 | + context 'asec(2x)' do |
| 186 | + it 'is an instance of asec' do |
| 187 | + f = SymEngine::asec(2*@x) |
| 188 | + expect(f).to be_an_instance_of SymEngine::ASec |
| 189 | + expect(f.to_s).to eql("asec(2*x)") |
| 190 | + end |
| 191 | + end |
115 | 192 | end |
116 | 193 |
|
117 | 194 | describe '#acot' do |
|
121 | 198 | expect(f).to eql(@pi/4) |
122 | 199 | end |
123 | 200 | end |
| 201 | + context 'acot(2x)' do |
| 202 | + it 'is an instance of acot' do |
| 203 | + f = SymEngine::acot(2*@x) |
| 204 | + expect(f).to be_an_instance_of SymEngine::ACot |
| 205 | + expect(f.to_s).to eql("acot(2*x)") |
| 206 | + end |
| 207 | + end |
124 | 208 | end |
125 | 209 |
|
126 | 210 | describe '#sinh' do |
|
130 | 214 | expect(f).to eql(0) |
131 | 215 | end |
132 | 216 | end |
| 217 | + context 'sinh(2x)' do |
| 218 | + it 'is an instance of sinh' do |
| 219 | + f = SymEngine::sinh(2*@x) |
| 220 | + expect(f).to be_an_instance_of SymEngine::Sinh |
| 221 | + expect(f.to_s).to eql("sinh(2*x)") |
| 222 | + end |
| 223 | + end |
133 | 224 | end |
134 | 225 |
|
135 | 226 | describe '#cosh' do |
|
139 | 230 | expect(f).to eql(1) |
140 | 231 | end |
141 | 232 | end |
| 233 | + context 'cosh(2x)' do |
| 234 | + it 'is an instance of cosh' do |
| 235 | + f = SymEngine::cosh(2*@x) |
| 236 | + expect(f).to be_an_instance_of SymEngine::Cosh |
| 237 | + expect(f.to_s).to eql("cosh(2*x)") |
| 238 | + end |
| 239 | + end |
142 | 240 | end |
143 | 241 |
|
144 | 242 | describe '#tanh' do |
|
148 | 246 | expect(f).to eql(0) |
149 | 247 | end |
150 | 248 | end |
| 249 | + context 'tanh(2x)' do |
| 250 | + it 'is an instance of tanh' do |
| 251 | + f = SymEngine::tanh(2*@x) |
| 252 | + expect(f).to be_an_instance_of SymEngine::Tanh |
| 253 | + expect(f.to_s).to eql("tanh(2*x)") |
| 254 | + end |
| 255 | + end |
151 | 256 | end |
152 | 257 |
|
153 | 258 | describe '#csch' do |
|
157 | 262 | expect(f.to_s).to eql('csch(1)') |
158 | 263 | end |
159 | 264 | end |
| 265 | + context 'csch(2x)' do |
| 266 | + it 'is an instance of csch' do |
| 267 | + f = SymEngine::csch(2*@x) |
| 268 | + expect(f).to be_an_instance_of SymEngine::Csch |
| 269 | + expect(f.to_s).to eql("csch(2*x)") |
| 270 | + end |
| 271 | + end |
160 | 272 | end |
161 | 273 |
|
162 | 274 | describe '#sech' do |
|
166 | 278 | expect(f).to eql(1) |
167 | 279 | end |
168 | 280 | end |
| 281 | + context 'sech(2x)' do |
| 282 | + it 'is an instance of sech' do |
| 283 | + f = SymEngine::sech(2*@x) |
| 284 | + expect(f).to be_an_instance_of SymEngine::Sech |
| 285 | + expect(f.to_s).to eql("sech(2*x)") |
| 286 | + end |
| 287 | + end |
169 | 288 | end |
170 | 289 |
|
171 | 290 | describe '#coth' do |
|
175 | 294 | expect(f.to_s).to eql('coth(1)') |
176 | 295 | end |
177 | 296 | end |
| 297 | + context 'coth(2x)' do |
| 298 | + it 'is an instance of coth' do |
| 299 | + f = SymEngine::coth(2*@x) |
| 300 | + expect(f).to be_an_instance_of SymEngine::Coth |
| 301 | + expect(f.to_s).to eql("coth(2*x)") |
| 302 | + end |
| 303 | + end |
178 | 304 | end |
179 | 305 |
|
180 | 306 | describe '#asinh' do |
|
184 | 310 | expect(f).to eql(0) |
185 | 311 | end |
186 | 312 | end |
| 313 | + context 'asinh(2x)' do |
| 314 | + it 'is an instance of asinh' do |
| 315 | + f = SymEngine::asinh(2*@x) |
| 316 | + expect(f).to be_an_instance_of SymEngine::ASinh |
| 317 | + expect(f.to_s).to eql("asinh(2*x)") |
| 318 | + end |
| 319 | + end |
187 | 320 | end |
188 | 321 |
|
189 | 322 | describe '#acosh' do |
|
193 | 326 | expect(f).to eql(0) |
194 | 327 | end |
195 | 328 | end |
| 329 | + context 'acosh(2x)' do |
| 330 | + it 'is an instance of acosh' do |
| 331 | + f = SymEngine::acosh(2*@x) |
| 332 | + expect(f).to be_an_instance_of SymEngine::ACosh |
| 333 | + expect(f.to_s).to eql("acosh(2*x)") |
| 334 | + end |
| 335 | + end |
196 | 336 | end |
197 | 337 |
|
198 | 338 | describe '#atanh' do |
|
202 | 342 | expect(f).to eql(0) |
203 | 343 | end |
204 | 344 | end |
| 345 | + context 'atanh(2x)' do |
| 346 | + it 'is an instance of atanh' do |
| 347 | + f = SymEngine::atanh(2*@x) |
| 348 | + expect(f).to be_an_instance_of SymEngine::ATanh |
| 349 | + expect(f.to_s).to eql("atanh(2*x)") |
| 350 | + end |
| 351 | + end |
205 | 352 | end |
206 | 353 |
|
207 | 354 | describe '#acsch' do |
|
211 | 358 | expect(f.to_s).to eql('log(1 + 2**(1/2))') |
212 | 359 | end |
213 | 360 | end |
| 361 | + context 'acsch(2x)' do |
| 362 | + it 'is an instance of acsch' do |
| 363 | + f = SymEngine::acsch(2*@x) |
| 364 | + expect(f).to be_an_instance_of SymEngine::ACsch |
| 365 | + expect(f.to_s).to eql("acsch(2*x)") |
| 366 | + end |
| 367 | + end |
214 | 368 | end |
215 | 369 |
|
216 | 370 | describe '#asech' do |
|
220 | 374 | expect(f).to eql(0) |
221 | 375 | end |
222 | 376 | end |
| 377 | + context 'asech(2x)' do |
| 378 | + it 'is an instance of asech' do |
| 379 | + f = SymEngine::asech(2*@x) |
| 380 | + expect(f).to be_an_instance_of SymEngine::ASech |
| 381 | + expect(f.to_s).to eql("asech(2*x)") |
| 382 | + end |
| 383 | + end |
223 | 384 | end |
224 | 385 |
|
225 | 386 | describe '#acoth' do |
|
229 | 390 | expect(f.to_s).to eql('acoth(1)') |
230 | 391 | end |
231 | 392 | end |
| 393 | + context 'acoth(2x)' do |
| 394 | + it 'is an instance of acoth' do |
| 395 | + f = SymEngine::acoth(2*@x) |
| 396 | + expect(f).to be_an_instance_of SymEngine::ACoth |
| 397 | + expect(f.to_s).to eql("acoth(2*x)") |
| 398 | + end |
| 399 | + end |
232 | 400 | end |
233 | 401 |
|
234 | 402 | describe '#lambertw' do |
|
238 | 406 | expect(f).to eql(-1) |
239 | 407 | end |
240 | 408 | end |
| 409 | + context 'lambertw(2x)' do |
| 410 | + it 'is an instance of lambertw' do |
| 411 | + f = SymEngine::lambertw(2*@x) |
| 412 | + expect(f).to be_an_instance_of SymEngine::LambertW |
| 413 | + expect(f.to_s).to eql("lambertw(2*x)") |
| 414 | + end |
| 415 | + end |
241 | 416 | end |
242 | 417 |
|
243 | 418 | describe '#zeta' do |
244 | 419 | context 'calculation of zeta zero' do |
245 | 420 | it 'returns minus half' do |
246 | 421 | f = SymEngine::zeta(0) |
247 | | - r1 = SymEngine::Integer.new(-1) |
248 | | - r2 = SymEngine::Integer.new(2) |
249 | | - r = r1/r2 |
| 422 | + r = -1.quo(2) |
250 | 423 | expect(f).to eql(r) |
251 | 424 | end |
252 | 425 | end |
| 426 | + context 'zeta(2x)' do |
| 427 | + it 'is an instance of zeta' do |
| 428 | + f = SymEngine::zeta(2*@x) |
| 429 | + expect(f).to be_an_instance_of SymEngine::Zeta |
| 430 | + expect(f.to_s).to eql("zeta(2*x, 1)") |
| 431 | + end |
| 432 | + end |
253 | 433 | end |
254 | 434 |
|
255 | 435 | describe '#dirichlet_eta' do |
|
259 | 439 | expect(f.to_s).to eql('log(2)') |
260 | 440 | end |
261 | 441 | end |
| 442 | + context 'dirichlet_eta(2x)' do |
| 443 | + it 'is an instance of dirichlet_eta' do |
| 444 | + f = SymEngine::dirichlet_eta(2*@x) |
| 445 | + expect(f).to be_an_instance_of SymEngine::Dirichlet_eta |
| 446 | + expect(f.to_s).to eql("dirichlet_eta(2*x)") |
| 447 | + end |
| 448 | + end |
262 | 449 | end |
263 | 450 |
|
264 | 451 | describe '#gamma' do |
|
268 | 455 | expect(f.to_s).to eql('1') |
269 | 456 | end |
270 | 457 | end |
| 458 | + context 'gamma(2x)' do |
| 459 | + it 'is an instance of gamma' do |
| 460 | + f = SymEngine::gamma(2*@x) |
| 461 | + expect(f).to be_an_instance_of SymEngine::Gamma |
| 462 | + expect(f.to_s).to eql("gamma(2*x)") |
| 463 | + end |
| 464 | + end |
271 | 465 | end |
272 | 466 |
|
273 | 467 | end |
|
0 commit comments