add Berkeley specific copyright
[unix-history] / usr / src / lib / libm / common_source / acosh.c
index e4b008e..fd16ffb 100644 (file)
@@ -1,19 +1,23 @@
-/* 
+/*
  * Copyright (c) 1985 Regents of the University of California.
  * Copyright (c) 1985 Regents of the University of California.
- * 
- * Use and reproduction of this software are granted  in  accordance  with
- * the terms and conditions specified in  the  Berkeley  Software  License
- * Agreement (in particular, this entails acknowledgement of the programs'
- * source, and inclusion of this notice) with the additional understanding
- * that  all  recipients  should regard themselves as participants  in  an
- * ongoing  research  project and hence should  feel  obligated  to report
- * their  experiences (good or bad) with these elementary function  codes,
- * using "sendbug 4bsd-bugs@BERKELEY", to the authors.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ *
+ * All recipients should regard themselves as participants in an ongoing
+ * research project and hence should feel obligated to report their
+ * experiences (good or bad) with these elementary function codes, using
+ * the sendbug(8) program, to the authors.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)acosh.c    1.1 (ELEFUNT) %G%";
-#endif not lint
+static char sccsid[] = "@(#)acosh.c    5.2 (Berkeley) %G%";
+#endif /* not lint */
 
 /* ACOSH(X)
  * RETURN THE INVERSE HYPERBOLIC COSINE OF X
 
 /* ACOSH(X)
  * RETURN THE INVERSE HYPERBOLIC COSINE OF X
@@ -52,28 +56,33 @@ static char sccsid[] = "@(#)acosh.c 1.1 (ELEFUNT) %G%";
  * shown.
  */
 
  * shown.
  */
 
-#ifdef VAX     /* VAX D format */
+#if defined(vax)||defined(tahoe)       /* VAX D format */
+#ifdef vax
+#define _0x(A,B)       0x/**/A/**/B
+#else  /* vax */
+#define _0x(A,B)       0x/**/B/**/A
+#endif /* vax */
 /* static double */
 /* ln2hi  =  6.9314718055829871446E-1    , Hex  2^  0   *  .B17217F7D00000 */
 /* ln2lo  =  1.6465949582897081279E-12   ; Hex  2^-39   *  .E7BCD5E4F1D9CC */
 /* static double */
 /* ln2hi  =  6.9314718055829871446E-1    , Hex  2^  0   *  .B17217F7D00000 */
 /* ln2lo  =  1.6465949582897081279E-12   ; Hex  2^-39   *  .E7BCD5E4F1D9CC */
-static long     ln2hix[] = { 0x72174031, 0x0000f7d0};
-static long     ln2lox[] = { 0xbcd52ce7, 0xd9cce4f1};
+static long     ln2hix[] = { _0x(7217,4031), _0x(0000,f7d0)};
+static long     ln2lox[] = { _0x(bcd5,2ce7), _0x(d9cc,e4f1)};
 #define    ln2hi    (*(double*)ln2hix)
 #define    ln2lo    (*(double*)ln2lox)
 #define    ln2hi    (*(double*)ln2hix)
 #define    ln2lo    (*(double*)ln2lox)
-#else  /* IEEE double */
+#else  /* defined(vax)||defined(tahoe) */
 static double
 ln2hi  =  6.9314718036912381649E-1    , /*Hex  2^ -1   *  1.62E42FEE00000 */
 ln2lo  =  1.9082149292705877000E-10   ; /*Hex  2^-33   *  1.A39EF35793C76 */
 static double
 ln2hi  =  6.9314718036912381649E-1    , /*Hex  2^ -1   *  1.62E42FEE00000 */
 ln2lo  =  1.9082149292705877000E-10   ; /*Hex  2^-33   *  1.A39EF35793C76 */
-#endif
+#endif /* defined(vax)||defined(tahoe) */
 
 double acosh(x)
 double x;
 {      
        double log1p(),sqrt(),t,big=1.E20; /* big+1==big */
 
 
 double acosh(x)
 double x;
 {      
        double log1p(),sqrt(),t,big=1.E20; /* big+1==big */
 
-#ifndef VAX
+#if !defined(vax)&&!defined(tahoe)
        if(x!=x) return(x);     /* x is NaN */
        if(x!=x) return(x);     /* x is NaN */
-#endif
+#endif /* !defined(vax)&&!defined(tahoe) */
 
     /* return log1p(x) + log(2) if x is large */
        if(x>big) {t=log1p(x)+ln2lo; return(t+ln2hi);} 
 
     /* return log1p(x) + log(2) if x is large */
        if(x>big) {t=log1p(x)+ln2lo; return(t+ln2hi);}