1 /* ******************************************************
 2    *                                                    *
 3    *                                                    *
 4    * Copyright (c) 1972 by Massachusetts Institute of   *
 5    * Technology and Honeywell Information Systems, Inc. *
 6    *                                                    *
 7    *                                                    *
 8    ****************************************************** */
 9 
10 dcatan_: proc (number) returns (complex float bin (63));
11 
12 dcl (number, a, b, c) complex float bin (63);
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;
22 
23           if a = b
24                then do;
25 err:
26                call code_ (32);
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 dcatanh_: entry (number) returns (complex float bin (63));
35 
36           b = 1.0e0;
37           c = 0.5e0;
38 
39           goto atans;
40 
41      end dcatan_;