Skip to content

Commit 43a13ff

Browse files
committed
Tests for hyperbolic functions
1 parent a650c22 commit 43a13ff

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed

spec/functions_spec.rb

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,113 @@
123123
end
124124
end
125125

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+
126234
end
127235
end

0 commit comments

Comments
 (0)