1
2
3
4
5
6
7
8
9
10 catan_: proc (number) returns (complex float bin (27));
11
12 dcl (number, a, b, c) complex float bin (27);
13 dcl (imag, log, real) builtin;
14
15 dcl code_ ext entry (fixed bin (17));
16
17 b = 1.0e0i;
18 c = 0.5e0i;
19
20 atans:
21 a = number + 0.0e0;
22
23 if a = b
24 then do;
25 err:
26 call code_ (59);
27 return ((real (a)+imag (a))*170141182.0e30);
28 end;
29
30 if a = -b then goto err;
31
32 return (log ((b+a)/ (b-a))*c);
33
34 catanh_: entry (number) returns (complex float bin (27));
35
36 b = 1.0e0;
37 c = 0.5e0;
38
39 goto atans;
40
41 end catan_;