This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
update Changes; integrate cfgperl contents into mainline
[perl5.git] / t / lib / complex.t
CommitLineData
89d0527d
RM
1#!./perl
2
fb73857a 3# $RCSfile: complex.t,v $
89d0527d 4#
5aabfad6 5# Regression tests for the Math::Complex pacakge
b42d0ec9
JH
6# -- Raphael Manfredi since Sep 1996
7# -- Jarkko Hietaniemi since Mar 1997
8# -- Daniel S. Lewart since Sep 1997
5aabfad6 9
89d0527d
RM
10BEGIN {
11 chdir 't' if -d 't';
93430cb4 12 unshift @INC, '../lib';
89d0527d 13}
5aabfad6 14
89d0527d
RM
15use Math::Complex;
16
2820d885 17my $VERSION = sprintf("%s", q$Id: complex.t,v 1.9 1998/11/01 00:00:00 dsl Exp $ =~ /(\d+\.d+)/);
b42d0ec9 18
fb73857a
PP
19my ($args, $op, $target, $test, $test_set, $try, $val, $zvalue, @set, @val);
20
89d0527d
RM
21$test = 0;
22$| = 1;
fb73857a
PP
23my @script = (
24 'my ($res, $s0,$s1,$s2,$s3,$s4,$s5,$s6,$s7,$s8,$s9,$s10, $z0,$z1,$z2);' .
25 "\n\n"
26);
b42d0ec9 27my $eps = 1e-13;
89d0527d 28
d09ae4e6
JH
29if ($^O eq 'unicos') { # For some reason root() produces very inaccurate
30 $eps = 1e-11; # results in Cray UNICOS, and occasionally also
31} # cos(), sin(), cosh(), sinh(). The division
32 # of doubles is the current suspect.
33
89d0527d 34while (<DATA>) {
0c721ce2
JH
35 s/^\s+//;
36 next if $_ eq '' || /^\#/;
37 chomp;
38 $test_set = 0; # Assume not a test over a set of values
0e505df1 39 if (/^&(.+)/) {
89d0527d
RM
40 $op = $1;
41 next;
42 }
0e505df1 43 elsif (/^\{(.+)\}/) {
89d0527d
RM
44 set($1, \@set, \@val);
45 next;
46 }
47 elsif (s/^\|//) {
0c721ce2 48 $test_set = 1; # Requests we loop over the set...
89d0527d
RM
49 }
50 my @args = split(/:/);
0c721ce2 51 if ($test_set == 1) {
89d0527d
RM
52 my $i;
53 for ($i = 0; $i < @set; $i++) {
0c721ce2
JH
54 # complex number
55 $target = $set[$i];
56 # textual value as found in set definition
57 $zvalue = $val[$i];
89d0527d
RM
58 test($zvalue, $target, @args);
59 }
60 } else {
61 test($op, undef, @args);
62 }
63}
64
b42d0ec9
JH
65#
66
67sub test_mutators {
68 my $op;
69
70 $test++;
71push(@script, <<'EOT');
72{
73 my $z = cplx( 1, 1);
74 $z->Re(2);
75 $z->Im(3);
16357284 76 print "# $test Re(z) = ",$z->Re(), " Im(z) = ", $z->Im(), " z = $z\n";
b42d0ec9
JH
77 print 'not ' unless Re($z) == 2 and Im($z) == 3;
78EOT
79 push(@script, qq(print "ok $test\\n"}\n));
80
81 $test++;
82push(@script, <<'EOT');
83{
84 my $z = cplx( 1, 1);
85 $z->abs(3 * sqrt(2));
16357284 86 print "# $test Re(z) = ",$z->Re(), " Im(z) = ", $z->Im(), " z = $z\n";
b42d0ec9
JH
87 print 'not ' unless (abs($z) - 3 * sqrt(2)) < $eps and
88 (arg($z) - pi / 4 ) < $eps and
89 (Re($z) - 3 ) < $eps and
90 (Im($z) - 3 ) < $eps;
91EOT
92 push(@script, qq(print "ok $test\\n"}\n));
93
94 $test++;
95push(@script, <<'EOT');
96{
97 my $z = cplx( 1, 1);
98 $z->arg(-3 / 4 * pi);
16357284 99 print "# $test Re(z) = ",$z->Re(), " Im(z) = ", $z->Im(), " z = $z\n";
b42d0ec9
JH
100 print 'not ' unless (arg($z) + 3 / 4 * pi) < $eps and
101 (abs($z) - sqrt(2) ) < $eps and
102 (Re($z) + 1 ) < $eps and
103 (Im($z) + 1 ) < $eps;
104EOT
105 push(@script, qq(print "ok $test\\n"}\n));
106}
107
108test_mutators();
109
110my $constants = '
111my $i = cplx(0, 1);
112my $pi = cplx(pi, 0);
113my $pii = cplx(0, pi);
114my $pip2 = cplx(pi/2, 0);
115my $zero = cplx(0, 0);
116';
117
118push(@script, $constants);
119
120
5cd24f17
PP
121# test the divbyzeros
122
0e505df1
JH
123sub test_dbz {
124 for my $op (@_) {
125 $test++;
b42d0ec9 126 push(@script, <<EOT);
16357284
JH
127 eval '$op';
128 (\$bad) = (\$@ =~ /(.+)/);
129 print "# $test op = $op divbyzero? \$bad...\n";
130 print 'not ' unless (\$@ =~ /Division by zero/);
b42d0ec9
JH
131EOT
132 push(@script, qq(print "ok $test\\n";\n));
0e505df1
JH
133 }
134}
135
8c03c583
JH
136# test the logofzeros
137
138sub test_loz {
139 for my $op (@_) {
140 $test++;
b42d0ec9 141 push(@script, <<EOT);
16357284
JH
142 eval '$op';
143 (\$bad) = (\$@ =~ /(.+)/);
144 print "# $test op = $op logofzero? \$bad...\n";
145 print 'not ' unless (\$@ =~ /Logarithm of zero/);
b42d0ec9
JH
146EOT
147 push(@script, qq(print "ok $test\\n";\n));
8c03c583
JH
148 }
149}
150
5cd24f17
PP
151test_dbz(
152 'i/0',
b42d0ec9
JH
153 'acot(0)',
154 'acot(+$i)',
155# 'acoth(-1)', # Log of zero.
156 'acoth(0)',
157 'acoth(+1)',
5cd24f17 158 'acsc(0)',
5cd24f17 159 'acsch(0)',
b42d0ec9
JH
160 'asec(0)',
161 'asech(0)',
162 'atan(-$i)',
163 'atan($i)',
164# 'atanh(-1)', # Log of zero.
165 'atanh(+1)',
166 'cot(0)',
167 'coth(0)',
168 'csc(0)',
169 'tan($pip2)',
170 'csch(0)',
171 'tan($pip2)',
8c03c583
JH
172 );
173
174test_loz(
fb73857a 175 'log($zero)',
b42d0ec9 176 'acot(-$i)',
8c03c583
JH
177 'atanh(-1)',
178 'acoth(-1)',
5cd24f17
PP
179 );
180
0e505df1
JH
181# test the bad roots
182
183sub test_broot {
5cd24f17
PP
184 for my $op (@_) {
185 $test++;
b42d0ec9 186 push(@script, <<EOT);
16357284
JH
187 eval 'root(2, $op)';
188 (\$bad) = (\$@ =~ /(.+)/);
189 print "# $test op = $op badroot? \$bad...\n";
190 print 'not ' unless (\$@ =~ /root must be/);
b42d0ec9
JH
191EOT
192 push(@script, qq(print "ok $test\\n";\n));
5cd24f17
PP
193 }
194}
195
0e505df1
JH
196test_broot(qw(-3 -2.1 0 0.99));
197
16357284
JH
198sub test_display_format {
199 push @script, <<EOS;
200 my \$j = (root(1,3))[1];
201
202 \$j->display_format('polar');
203EOS
204
205 $test++;
206 push @script, <<EOS;
207 print "# display_format polar?\n";
208 print "not " unless \$j->display_format eq 'polar';
209 print "ok $test\n";
210EOS
211
212 $test++;
213 push @script, <<EOS;
214 print "# j = \$j\n";
215 print "not " unless "\$j" eq "[1,2pi/3]";
216 print "ok $test\n";
217
218 my %display_format;
219
220 %display_format = \$j->display_format;
221EOS
222
223 $test++;
224 push @script, <<EOS;
225 print "# display_format{style} polar?\n";
226 print "not " unless \$display_format{style} eq 'polar';
227 print "ok $test\n";
228EOS
229
230 $test++;
231 push @script, <<EOS;
232 print "# keys %display_format == 2?\n";
233 print "not " unless keys %display_format == 2;
234 print "ok $test\n";
235
236 \$j->display_format('style' => 'cartesian', 'format' => '%.5f');
237EOS
238
239 $test++;
240 push @script, <<EOS;
241 print "# j = \$j\n";
242 print "not " unless "\$j" eq "-0.50000+0.86603i";
243 print "ok $test\n";
244
245 %display_format = \$j->display_format;
246EOS
247
248 $test++;
249 push @script, <<EOS;
250 print "# display_format{format} %.5f?\n";
251 print "not " unless \$display_format{format} eq '%.5f';
252 print "ok $test\n";
253EOS
254
255 $test++;
256 push @script, <<EOS;
257 print "# keys %display_format == 3?\n";
258 print "not " unless keys %display_format == 3;
259 print "ok $test\n";
260
261 \$j->display_format('format' => undef);
262EOS
263
264 $test++;
265 push @script, <<EOS;
266 print "# j = \$j\n";
36d4c99b 267 print "not " unless "\$j" =~ /^\Q-0.5+0.86602540\E\d+i$/;
16357284
JH
268 print "ok $test\n";
269
270 \$j->display_format('style' => 'polar', 'polar_pretty_print' => 0);
271EOS
272
273 $test++;
274 push @script, <<EOS;
275 print "# j = \$j\n";
36d4c99b 276 print "not " unless "\$j" =~ /^\Q[1,2.09439510\E\d+]$/;
16357284
JH
277 print "ok $test\n";
278
279 \$j->display_format('style' => 'cartesian', 'format' => '(%.5g)');
280EOS
281 $test++;
282 push @script, <<EOS;
283 print "# j = \$j\n";
284 print "not " unless "\$j" eq "(-0.5)+(0.86603)i";
285 print "ok $test\n";
286EOS
287}
288
289test_display_format();
290
89d0527d 291print "1..$test\n";
fe82cf6e 292eval join '', @script;
89d0527d
RM
293die $@ if $@;
294
0e505df1
JH
295sub abop {
296 my ($op) = @_;
297
298 push(@script, qq(print "# $op=\n";));
299}
300
89d0527d
RM
301sub test {
302 my ($op, $z, @args) = @_;
0e505df1 303 my ($baop) = 0;
89d0527d
RM
304 $test++;
305 my $i;
0e505df1 306 $baop = 1 if ($op =~ s/;=$//);
89d0527d
RM
307 for ($i = 0; $i < @args; $i++) {
308 $val = value($args[$i]);
fe82cf6e 309 push @script, "\$z$i = $val;\n";
89d0527d
RM
310 }
311 if (defined $z) {
312 $args = "'$op'"; # Really the value
0c721ce2 313 $try = "abs(\$z0 - \$z1) <= $eps ? \$z1 : \$z0";
fe82cf6e
CS
314 push @script, "\$res = $try; ";
315 push @script, "check($test, $args[0], \$res, \$z$#args, $args);\n";
89d0527d
RM
316 } else {
317 my ($try, $args);
318 if (@args == 2) {
319 $try = "$op \$z0";
320 $args = "'$args[0]'";
321 } else {
322 $try = ($op =~ /^\w/) ? "$op(\$z0, \$z1)" : "\$z0 $op \$z1";
323 $args = "'$args[0]', '$args[1]'";
324 }
fe82cf6e
CS
325 push @script, "\$res = $try; ";
326 push @script, "check($test, '$try', \$res, \$z$#args, $args);\n";
0e505df1
JH
327 if (@args > 2 and $baop) { # binary assignment ops
328 $test++;
329 # check the op= works
330 push @script, <<EOB;
331{
fb73857a 332 my \$za = cplx(ref \$z0 ? \@{\$z0->cartesian} : (\$z0, 0));
0e505df1
JH
333
334 my (\$z1r, \$z1i) = ref \$z1 ? \@{\$z1->cartesian} : (\$z1, 0);
335
fb73857a 336 my \$zb = cplx(\$z1r, \$z1i);
0e505df1
JH
337
338 \$za $op= \$zb;
339 my (\$zbr, \$zbi) = \@{\$zb->cartesian};
340
341 check($test, '\$z0 $op= \$z1', \$za, \$z$#args, $args);
342EOB
343 $test++;
344 # check that the rhs has not changed
345 push @script, qq(print "not " unless (\$zbr == \$z1r and \$zbi == \$z1i););
b42d0ec9 346 push @script, qq(print "ok $test\\n";\n);
0e505df1
JH
347 push @script, "}\n";
348 }
89d0527d
RM
349 }
350}
351
352sub set {
353 my ($set, $setref, $valref) = @_;
354 @{$setref} = ();
355 @{$valref} = ();
356 my @set = split(/;\s*/, $set);
357 my @res;
358 my $i;
359 for ($i = 0; $i < @set; $i++) {
360 push(@{$valref}, $set[$i]);
361 my $val = value($set[$i]);
fe82cf6e
CS
362 push @script, "\$s$i = $val;\n";
363 push @{$setref}, "\$s$i";
89d0527d
RM
364 }
365}
366
367sub value {
368 local ($_) = @_;
369 if (/^\s*\((.*),(.*)\)/) {
370 return "cplx($1,$2)";
371 }
b42d0ec9
JH
372 elsif (/^\s*([\-\+]?(?:\d+(\.\d+)?|\.\d+)(?:[e[\-\+]\d+])?)/) {
373 return "cplx($1,0)";
374 }
89d0527d
RM
375 elsif (/^\s*\[(.*),(.*)\]/) {
376 return "cplxe($1,$2)";
377 }
378 elsif (/^\s*'(.*)'/) {
379 my $ex = $1;
380 $ex =~ s/\bz\b/$target/g;
381 $ex =~ s/\br\b/abs($target)/g;
382 $ex =~ s/\bt\b/arg($target)/g;
383 $ex =~ s/\ba\b/Re($target)/g;
384 $ex =~ s/\bb\b/Im($target)/g;
385 return $ex;
386 }
387 elsif (/^\s*"(.*)"/) {
388 return "\"$1\"";
389 }
390 return $_;
391}
392
393sub check {
394 my ($test, $try, $got, $expected, @z) = @_;
0c721ce2 395
16357284 396 print "# @_\n";
0c721ce2
JH
397
398 if ("$got" eq "$expected"
399 ||
400 ($expected =~ /^-?\d/ && $got == $expected)
401 ||
402 (abs($got - $expected) < $eps)
403 ) {
89d0527d
RM
404 print "ok $test\n";
405 } else {
406 print "not ok $test\n";
407 my $args = (@z == 1) ? "z = $z[0]" : "z0 = $z[0], z1 = $z[1]";
408 print "# '$try' expected: '$expected' got: '$got' for $args\n";
409 }
410}
fb73857a
PP
411
412sub addsq {
413 my ($z1, $z2) = @_;
414 return ($z1 + i*$z2) * ($z1 - i*$z2);
415}
416
417sub subsq {
418 my ($z1, $z2) = @_;
419 return ($z1 + $z2) * ($z1 - $z2);
420}
421
89d0527d 422__END__
0e505df1 423&+;=
89d0527d
RM
424(3,4):(3,4):(6,8)
425(-3,4):(3,-4):(0,0)
426(3,4):-3:(0,4)
4271:(4,2):(5,2)
428[2,0]:[2,pi]:(0,0)
429
430&++
431(2,1):(3,1)
432
0e505df1 433&-;=
89d0527d
RM
434(2,3):(-2,-3)
435[2,pi/2]:[2,-(pi)/2]
4362:[2,0]:(0,0)
437[3,0]:2:(1,0)
4383:(4,5):(-1,-5)
439(4,5):3:(1,5)
0e505df1 440(2,1):(3,5):(-1,-4)
89d0527d
RM
441
442&--
443(1,2):(0,2)
444[2,pi]:[3,pi]
445
0e505df1 446&*;=
89d0527d
RM
447(0,1):(0,1):(-1,0)
448(4,5):(1,0):(4,5)
449[2,2*pi/3]:(1,0):[2,2*pi/3]
4502:(0,1):(0,2)
451(0,1):3:(0,3)
452(0,1):(4,1):(-1,4)
453(2,1):(4,-1):(9,2)
454
0e505df1 455&/;=
89d0527d
RM
456(3,4):(3,4):(1,0)
457(4,-5):1:(4,-5)
4581:(0,1):(0,-1)
459(0,6):(0,2):(3,0)
460(9,2):(4,-1):(2,1)
461[4,pi]:[2,pi/2]:[2,pi/2]
462[2,pi/2]:[4,pi]:[0.5,-(pi)/2]
463
0e505df1
JH
464&**;=
465(2,0):(3,0):(8,0)
466(3,0):(2,0):(9,0)
467(2,3):(4,0):(-119,-120)
ace5de91
GS
468(0,0):(1,0):(0,0)
469(0,0):(2,3):(0,0)
470(1,0):(0,0):(1,0)
471(1,0):(1,0):(1,0)
472(1,0):(2,3):(1,0)
473(2,3):(0,0):(1,0)
474(2,3):(1,0):(2,3)
2820d885 475(0,0):(0,0):(1,0)
0e505df1 476
0c721ce2
JH
477&Re
478(3,4):3
479(-3,4):-3
480[1,pi/2]:0
481
482&Im
483(3,4):4
484(3,-4):-4
485[1,pi/2]:1
486
89d0527d
RM
487&abs
488(3,4):5
489(-3,4):5
490
0c721ce2
JH
491&arg
492[2,0]:0
493[-2,0]:pi
494
89d0527d
RM
495&~
496(4,5):(4,-5)
497(-3,4):(-3,-4)
498[2,pi/2]:[2,-(pi)/2]
499
500&<
501(3,4):(1,2):0
502(3,4):(3,2):0
503(3,4):(3,8):1
504(4,4):(5,129):1
505
506&==
507(3,4):(4,5):0
508(3,4):(3,5):0
509(3,4):(2,4):0
510(3,4):(3,4):1
511
512&sqrt
0c721ce2 513-9:(0,3)
89d0527d
RM
514(-100,0):(0,10)
515(16,-30):(5,-3)
516
517&stringify_cartesian
518(-100,0):"-100"
519(0,1):"i"
520(4,-3):"4-3i"
521(4,0):"4"
522(-4,0):"-4"
523(-2,4):"-2+4i"
524(-2,-1):"-2-i"
525
526&stringify_polar
527[-1, 0]:"[1,pi]"
528[1, pi/3]:"[1,pi/3]"
529[6, -2*pi/3]:"[6,-2pi/3]"
530[0.5, -9*pi/11]:"[0.5,-9pi/11]"
531
532{ (4,3); [3,2]; (-3,4); (0,2); [2,1] }
533
534|'z + ~z':'2*Re(z)'
535|'z - ~z':'2*i*Im(z)'
536|'z * ~z':'abs(z) * abs(z)'
537
8c03c583 538{ (0.5, 0); (-0.5, 0); (2,3); [3,2]; (-3,2); (0,2); 3; 1.2; (-3, 0); (-2, -1); [2,1] }
89d0527d 539
0c721ce2
JH
540|'(root(z, 4))[1] ** 4':'z'
541|'(root(z, 5))[3] ** 5':'z'
542|'(root(z, 8))[7] ** 8':'z'
89d0527d 543|'abs(z)':'r'
0c721ce2
JH
544|'acot(z)':'acotan(z)'
545|'acsc(z)':'acosec(z)'
fb73857a
PP
546|'acsc(z)':'asin(1 / z)'
547|'asec(z)':'acos(1 / z)'
89d0527d 548|'cbrt(z)':'cbrt(r) * exp(i * t/3)'
89d0527d 549|'cos(acos(z))':'z'
fb73857a 550|'addsq(cos(z), sin(z))':1
89d0527d 551|'cos(z)':'cosh(i*z)'
fb73857a 552|'subsq(cosh(z), sinh(z))':1
0c721ce2
JH
553|'cot(acot(z))':'z'
554|'cot(z)':'1 / tan(z)'
555|'cot(z)':'cotan(z)'
556|'csc(acsc(z))':'z'
557|'csc(z)':'1 / sin(z)'
558|'csc(z)':'cosec(z)'
89d0527d 559|'exp(log(z))':'z'
0c721ce2
JH
560|'exp(z)':'exp(a) * exp(i * b)'
561|'ln(z)':'log(z)'
562|'log(exp(z))':'z'
563|'log(z)':'log(r) + i*t'
89d0527d 564|'log10(z)':'log(z) / log(10)'
89d0527d 565|'logn(z, 2)':'log(z) / log(2)'
0c721ce2
JH
566|'logn(z, 3)':'log(z) / log(3)'
567|'sec(asec(z))':'z'
568|'sec(z)':'1 / cos(z)'
569|'sin(asin(z))':'z'
570|'sin(i * z)':'i * sinh(z)'
571|'sqrt(z) * sqrt(z)':'z'
572|'sqrt(z)':'sqrt(r) * exp(i * t/2)'
573|'tan(atan(z))':'z'
574|'z**z':'exp(z * log(z))'
89d0527d 575
0c721ce2 576{ (1,1); [1,0.5]; (-2, -1); 2; -3; (-1,0.5); (0,0.5); 0.5; (2, 0); (-1, -2) }
89d0527d 577
89d0527d 578|'cosh(acosh(z))':'z'
0c721ce2
JH
579|'coth(acoth(z))':'z'
580|'coth(z)':'1 / tanh(z)'
581|'coth(z)':'cotanh(z)'
582|'csch(acsch(z))':'z'
583|'csch(z)':'1 / sinh(z)'
584|'csch(z)':'cosech(z)'
585|'sech(asech(z))':'z'
586|'sech(z)':'1 / cosh(z)'
587|'sinh(asinh(z))':'z'
89d0527d 588|'tanh(atanh(z))':'z'
89d0527d 589
0c721ce2 590{ (0.2,-0.4); [1,0.5]; -1.2; (-1,0.5); 0.5; (1.1, 0) }
89d0527d 591
89d0527d 592|'acos(cos(z)) ** 2':'z * z'
89d0527d 593|'acosh(cosh(z)) ** 2':'z * z'
0c721ce2
JH
594|'acoth(z)':'acotanh(z)'
595|'acoth(z)':'atanh(1 / z)'
596|'acsch(z)':'acosech(z)'
597|'acsch(z)':'asinh(1 / z)'
598|'asech(z)':'acosh(1 / z)'
599|'asin(sin(z))':'z'
600|'asinh(sinh(z))':'z'
601|'atan(tan(z))':'z'
89d0527d
RM
602|'atanh(tanh(z))':'z'
603
fb73857a
PP
604&log
605(-2.0,0):( 0.69314718055995, 3.14159265358979)
606(-1.0,0):( 0 , 3.14159265358979)
607(-0.5,0):( -0.69314718055995, 3.14159265358979)
608( 0.5,0):( -0.69314718055995, 0 )
609( 1.0,0):( 0 , 0 )
610( 2.0,0):( 0.69314718055995, 0 )
611
612&log
613( 2, 3):( 1.28247467873077, 0.98279372324733)
614(-2, 3):( 1.28247467873077, 2.15879893034246)
615(-2,-3):( 1.28247467873077, -2.15879893034246)
616( 2,-3):( 1.28247467873077, -0.98279372324733)
617
0c721ce2 618&sin
8c03c583
JH
619(-2.0,0):( -0.90929742682568, 0 )
620(-1.0,0):( -0.84147098480790, 0 )
621(-0.5,0):( -0.47942553860420, 0 )
622( 0.0,0):( 0 , 0 )
623( 0.5,0):( 0.47942553860420, 0 )
624( 1.0,0):( 0.84147098480790, 0 )
625( 2.0,0):( 0.90929742682568, 0 )
626
627&sin
0c721ce2
JH
628( 2, 3):( 9.15449914691143, -4.16890695996656)
629(-2, 3):( -9.15449914691143, -4.16890695996656)
630(-2,-3):( -9.15449914691143, 4.16890695996656)
631( 2,-3):( 9.15449914691143, 4.16890695996656)
632
633&cos
8c03c583
JH
634(-2.0,0):( -0.41614683654714, 0 )
635(-1.0,0):( 0.54030230586814, 0 )
636(-0.5,0):( 0.87758256189037, 0 )
637( 0.0,0):( 1 , 0 )
638( 0.5,0):( 0.87758256189037, 0 )
639( 1.0,0):( 0.54030230586814, 0 )
640( 2.0,0):( -0.41614683654714, 0 )
641
642&cos
0c721ce2
JH
643( 2, 3):( -4.18962569096881, -9.10922789375534)
644(-2, 3):( -4.18962569096881, 9.10922789375534)
645(-2,-3):( -4.18962569096881, -9.10922789375534)
646( 2,-3):( -4.18962569096881, 9.10922789375534)
647
648&tan
8c03c583
JH
649(-2.0,0):( 2.18503986326152, 0 )
650(-1.0,0):( -1.55740772465490, 0 )
651(-0.5,0):( -0.54630248984379, 0 )
652( 0.0,0):( 0 , 0 )
653( 0.5,0):( 0.54630248984379, 0 )
654( 1.0,0):( 1.55740772465490, 0 )
655( 2.0,0):( -2.18503986326152, 0 )
656
657&tan
0c721ce2
JH
658( 2, 3):( -0.00376402564150, 1.00323862735361)
659(-2, 3):( 0.00376402564150, 1.00323862735361)
660(-2,-3):( 0.00376402564150, -1.00323862735361)
661( 2,-3):( -0.00376402564150, -1.00323862735361)
662
663&sec
8c03c583
JH
664(-2.0,0):( -2.40299796172238, 0 )
665(-1.0,0):( 1.85081571768093, 0 )
666(-0.5,0):( 1.13949392732455, 0 )
667( 0.0,0):( 1 , 0 )
668( 0.5,0):( 1.13949392732455, 0 )
669( 1.0,0):( 1.85081571768093, 0 )
670( 2.0,0):( -2.40299796172238, 0 )
671
672&sec
0c721ce2
JH
673( 2, 3):( -0.04167496441114, 0.09061113719624)
674(-2, 3):( -0.04167496441114, -0.09061113719624)
675(-2,-3):( -0.04167496441114, 0.09061113719624)
676( 2,-3):( -0.04167496441114, -0.09061113719624)
677
678&csc
8c03c583
JH
679(-2.0,0):( -1.09975017029462, 0 )
680(-1.0,0):( -1.18839510577812, 0 )
681(-0.5,0):( -2.08582964293349, 0 )
682( 0.5,0):( 2.08582964293349, 0 )
683( 1.0,0):( 1.18839510577812, 0 )
684( 2.0,0):( 1.09975017029462, 0 )
685
686&csc
0c721ce2
JH
687( 2, 3):( 0.09047320975321, 0.04120098628857)
688(-2, 3):( -0.09047320975321, 0.04120098628857)
689(-2,-3):( -0.09047320975321, -0.04120098628857)
690( 2,-3):( 0.09047320975321, -0.04120098628857)
691
692&cot
8c03c583
JH
693(-2.0,0):( 0.45765755436029, 0 )
694(-1.0,0):( -0.64209261593433, 0 )
695(-0.5,0):( -1.83048772171245, 0 )
696( 0.5,0):( 1.83048772171245, 0 )
697( 1.0,0):( 0.64209261593433, 0 )
698( 2.0,0):( -0.45765755436029, 0 )
699
700&cot
0c721ce2
JH
701( 2, 3):( -0.00373971037634, -0.99675779656936)
702(-2, 3):( 0.00373971037634, -0.99675779656936)
703(-2,-3):( 0.00373971037634, 0.99675779656936)
704( 2,-3):( -0.00373971037634, 0.99675779656936)
705
706&asin
8c03c583
JH
707(-2.0,0):( -1.57079632679490, 1.31695789692482)
708(-1.0,0):( -1.57079632679490, 0 )
709(-0.5,0):( -0.52359877559830, 0 )
710( 0.0,0):( 0 , 0 )
711( 0.5,0):( 0.52359877559830, 0 )
712( 1.0,0):( 1.57079632679490, 0 )
713( 2.0,0):( 1.57079632679490, -1.31695789692482)
714
715&asin
0c721ce2
JH
716( 2, 3):( 0.57065278432110, 1.98338702991654)
717(-2, 3):( -0.57065278432110, 1.98338702991654)
718(-2,-3):( -0.57065278432110, -1.98338702991654)
719( 2,-3):( 0.57065278432110, -1.98338702991654)
720
721&acos
8c03c583
JH
722(-2.0,0):( 3.14159265358979, -1.31695789692482)
723(-1.0,0):( 3.14159265358979, 0 )
724(-0.5,0):( 2.09439510239320, 0 )
725( 0.0,0):( 1.57079632679490, 0 )
726( 0.5,0):( 1.04719755119660, 0 )
727( 1.0,0):( 0 , 0 )
728( 2.0,0):( 0 , 1.31695789692482)
729
730&acos
0c721ce2
JH
731( 2, 3):( 1.00014354247380, -1.98338702991654)
732(-2, 3):( 2.14144911111600, -1.98338702991654)
733(-2,-3):( 2.14144911111600, 1.98338702991654)
734( 2,-3):( 1.00014354247380, 1.98338702991654)
735
736&atan
8c03c583
JH
737(-2.0,0):( -1.10714871779409, 0 )
738(-1.0,0):( -0.78539816339745, 0 )
739(-0.5,0):( -0.46364760900081, 0 )
740( 0.0,0):( 0 , 0 )
741( 0.5,0):( 0.46364760900081, 0 )
742( 1.0,0):( 0.78539816339745, 0 )
743( 2.0,0):( 1.10714871779409, 0 )
744
745&atan
0c721ce2
JH
746( 2, 3):( 1.40992104959658, 0.22907268296854)
747(-2, 3):( -1.40992104959658, 0.22907268296854)
748(-2,-3):( -1.40992104959658, -0.22907268296854)
749( 2,-3):( 1.40992104959658, -0.22907268296854)
750
751&asec
8c03c583
JH
752(-2.0,0):( 2.09439510239320, 0 )
753(-1.0,0):( 3.14159265358979, 0 )
754(-0.5,0):( 3.14159265358979, -1.31695789692482)
755( 0.5,0):( 0 , 1.31695789692482)
756( 1.0,0):( 0 , 0 )
757( 2.0,0):( 1.04719755119660, 0 )
758
759&asec
0c721ce2
JH
760( 2, 3):( 1.42041072246703, 0.23133469857397)
761(-2, 3):( 1.72118193112276, 0.23133469857397)
762(-2,-3):( 1.72118193112276, -0.23133469857397)
763( 2,-3):( 1.42041072246703, -0.23133469857397)
764
765&acsc
8c03c583
JH
766(-2.0,0):( -0.52359877559830, 0 )
767(-1.0,0):( -1.57079632679490, 0 )
768(-0.5,0):( -1.57079632679490, 1.31695789692482)
769( 0.5,0):( 1.57079632679490, -1.31695789692482)
770( 1.0,0):( 1.57079632679490, 0 )
771( 2.0,0):( 0.52359877559830, 0 )
772
773&acsc
0c721ce2
JH
774( 2, 3):( 0.15038560432786, -0.23133469857397)
775(-2, 3):( -0.15038560432786, -0.23133469857397)
776(-2,-3):( -0.15038560432786, 0.23133469857397)
777( 2,-3):( 0.15038560432786, 0.23133469857397)
778
779&acot
8c03c583
JH
780(-2.0,0):( -0.46364760900081, 0 )
781(-1.0,0):( -0.78539816339745, 0 )
782(-0.5,0):( -1.10714871779409, 0 )
783( 0.5,0):( 1.10714871779409, 0 )
784( 1.0,0):( 0.78539816339745, 0 )
785( 2.0,0):( 0.46364760900081, 0 )
786
787&acot
0c721ce2
JH
788( 2, 3):( 0.16087527719832, -0.22907268296854)
789(-2, 3):( -0.16087527719832, -0.22907268296854)
790(-2,-3):( -0.16087527719832, 0.22907268296854)
791( 2,-3):( 0.16087527719832, 0.22907268296854)
792
793&sinh
8c03c583
JH
794(-2.0,0):( -3.62686040784702, 0 )
795(-1.0,0):( -1.17520119364380, 0 )
796(-0.5,0):( -0.52109530549375, 0 )
797( 0.0,0):( 0 , 0 )
798( 0.5,0):( 0.52109530549375, 0 )
799( 1.0,0):( 1.17520119364380, 0 )
800( 2.0,0):( 3.62686040784702, 0 )
801
802&sinh
0c721ce2
JH
803( 2, 3):( -3.59056458998578, 0.53092108624852)
804(-2, 3):( 3.59056458998578, 0.53092108624852)
805(-2,-3):( 3.59056458998578, -0.53092108624852)
806( 2,-3):( -3.59056458998578, -0.53092108624852)
807
808&cosh
8c03c583
JH
809(-2.0,0):( 3.76219569108363, 0 )
810(-1.0,0):( 1.54308063481524, 0 )
811(-0.5,0):( 1.12762596520638, 0 )
812( 0.0,0):( 1 , 0 )
813( 0.5,0):( 1.12762596520638, 0 )
814( 1.0,0):( 1.54308063481524, 0 )
815( 2.0,0):( 3.76219569108363, 0 )
816
817&cosh
0c721ce2
JH
818( 2, 3):( -3.72454550491532, 0.51182256998738)
819(-2, 3):( -3.72454550491532, -0.51182256998738)
820(-2,-3):( -3.72454550491532, 0.51182256998738)
821( 2,-3):( -3.72454550491532, -0.51182256998738)
822
823&tanh
8c03c583
JH
824(-2.0,0):( -0.96402758007582, 0 )
825(-1.0,0):( -0.76159415595576, 0 )
826(-0.5,0):( -0.46211715726001, 0 )
827( 0.0,0):( 0 , 0 )
828( 0.5,0):( 0.46211715726001, 0 )
829( 1.0,0):( 0.76159415595576, 0 )
830( 2.0,0):( 0.96402758007582, 0 )
831
832&tanh
0c721ce2
JH
833( 2, 3):( 0.96538587902213, -0.00988437503832)
834(-2, 3):( -0.96538587902213, -0.00988437503832)
835(-2,-3):( -0.96538587902213, 0.00988437503832)
836( 2,-3):( 0.96538587902213, 0.00988437503832)
837
838&sech
8c03c583
JH
839(-2.0,0):( 0.26580222883408, 0 )
840(-1.0,0):( 0.64805427366389, 0 )
841(-0.5,0):( 0.88681888397007, 0 )
842( 0.0,0):( 1 , 0 )
843( 0.5,0):( 0.88681888397007, 0 )
844( 1.0,0):( 0.64805427366389, 0 )
845( 2.0,0):( 0.26580222883408, 0 )
846
847&sech
0c721ce2
JH
848( 2, 3):( -0.26351297515839, -0.03621163655877)
849(-2, 3):( -0.26351297515839, 0.03621163655877)
850(-2,-3):( -0.26351297515839, -0.03621163655877)
851( 2,-3):( -0.26351297515839, 0.03621163655877)
852
853&csch
8c03c583
JH
854(-2.0,0):( -0.27572056477178, 0 )
855(-1.0,0):( -0.85091812823932, 0 )
856(-0.5,0):( -1.91903475133494, 0 )
857( 0.5,0):( 1.91903475133494, 0 )
858( 1.0,0):( 0.85091812823932, 0 )
859( 2.0,0):( 0.27572056477178, 0 )
860
861&csch
0c721ce2
JH
862( 2, 3):( -0.27254866146294, -0.04030057885689)
863(-2, 3):( 0.27254866146294, -0.04030057885689)
864(-2,-3):( 0.27254866146294, 0.04030057885689)
865( 2,-3):( -0.27254866146294, 0.04030057885689)
866
867&coth
8c03c583
JH
868(-2.0,0):( -1.03731472072755, 0 )
869(-1.0,0):( -1.31303528549933, 0 )
870(-0.5,0):( -2.16395341373865, 0 )
871( 0.5,0):( 2.16395341373865, 0 )
872( 1.0,0):( 1.31303528549933, 0 )
873( 2.0,0):( 1.03731472072755, 0 )
874
875&coth
0c721ce2
JH
876( 2, 3):( 1.03574663776500, 0.01060478347034)
877(-2, 3):( -1.03574663776500, 0.01060478347034)
878(-2,-3):( -1.03574663776500, -0.01060478347034)
879( 2,-3):( 1.03574663776500, -0.01060478347034)
880
881&asinh
8c03c583
JH
882(-2.0,0):( -1.44363547517881, 0 )
883(-1.0,0):( -0.88137358701954, 0 )
884(-0.5,0):( -0.48121182505960, 0 )
885( 0.0,0):( 0 , 0 )
886( 0.5,0):( 0.48121182505960, 0 )
887( 1.0,0):( 0.88137358701954, 0 )
888( 2.0,0):( 1.44363547517881, 0 )
889
890&asinh
0c721ce2
JH
891( 2, 3):( 1.96863792579310, 0.96465850440760)
892(-2, 3):( -1.96863792579310, 0.96465850440761)
893(-2,-3):( -1.96863792579310, -0.96465850440761)
894( 2,-3):( 1.96863792579310, -0.96465850440760)
895
896&acosh
8c03c583
JH
897(-2.0,0):( -1.31695789692482, 3.14159265358979)
898(-1.0,0):( 0, 3.14159265358979)
899(-0.5,0):( 0, 2.09439510239320)
900( 0.0,0):( 0, 1.57079632679490)
901( 0.5,0):( 0, 1.04719755119660)
902( 1.0,0):( 0 , 0 )
903( 2.0,0):( 1.31695789692482, 0 )
904
905&acosh
0c721ce2
JH
906( 2, 3):( 1.98338702991654, 1.00014354247380)
907(-2, 3):( -1.98338702991653, -2.14144911111600)
908(-2,-3):( -1.98338702991653, 2.14144911111600)
909( 2,-3):( 1.98338702991654, -1.00014354247380)
910
911&atanh
8c03c583
JH
912(-2.0,0):( -0.54930614433405, 1.57079632679490)
913(-0.5,0):( -0.54930614433405, 0 )
914( 0.0,0):( 0 , 0 )
915( 0.5,0):( 0.54930614433405, 0 )
916( 2.0,0):( 0.54930614433405, 1.57079632679490)
917
918&atanh
0c721ce2
JH
919( 2, 3):( 0.14694666622553, 1.33897252229449)
920(-2, 3):( -0.14694666622553, 1.33897252229449)
921(-2,-3):( -0.14694666622553, -1.33897252229449)
922( 2,-3):( 0.14694666622553, -1.33897252229449)
923
924&asech
8c03c583
JH
925(-2.0,0):( 0 , 2.09439510239320)
926(-1.0,0):( 0 , 3.14159265358979)
927(-0.5,0):( -1.31695789692482, 3.14159265358979)
928( 0.5,0):( 1.31695789692482, 0 )
929( 1.0,0):( 0 , 0 )
930( 2.0,0):( 0 , 1.04719755119660)
931
932&asech
0c721ce2
JH
933( 2, 3):( 0.23133469857397, -1.42041072246703)
934(-2, 3):( -0.23133469857397, 1.72118193112276)
935(-2,-3):( -0.23133469857397, -1.72118193112276)
936( 2,-3):( 0.23133469857397, 1.42041072246703)
937
938&acsch
8c03c583
JH
939(-2.0,0):( -0.48121182505960, 0 )
940(-1.0,0):( -0.88137358701954, 0 )
941(-0.5,0):( -1.44363547517881, 0 )
942( 0.5,0):( 1.44363547517881, 0 )
943( 1.0,0):( 0.88137358701954, 0 )
944( 2.0,0):( 0.48121182505960, 0 )
945
946&acsch
0c721ce2
JH
947( 2, 3):( 0.15735549884499, -0.22996290237721)
948(-2, 3):( -0.15735549884499, -0.22996290237721)
949(-2,-3):( -0.15735549884499, 0.22996290237721)
950( 2,-3):( 0.15735549884499, 0.22996290237721)
951
952&acoth
8c03c583
JH
953(-2.0,0):( -0.54930614433405, 0 )
954(-0.5,0):( -0.54930614433405, 1.57079632679490)
955( 0.5,0):( 0.54930614433405, 1.57079632679490)
956( 2.0,0):( 0.54930614433405, 0 )
957
958&acoth
0c721ce2
JH
959( 2, 3):( 0.14694666622553, -0.23182380450040)
960(-2, 3):( -0.14694666622553, -0.23182380450040)
961(-2,-3):( -0.14694666622553, 0.23182380450040)
962( 2,-3):( 0.14694666622553, 0.23182380450040)
963
964# eof