2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeesingtrans_intern.h"
10 Calculate the hyperbolic cosine of the IEEE single precision number
13 IEEE single precision floating point number
17 negative : 0 (not possible)
18 overflow : result too big for ffp-number
30 cosh(x) = (1/2)*( e^x + e^(-x) )
32 cosh( |x| >= 9 ) = (1/2) * (e^x);
38 AROS_LH1(float, IEEESPCosh
,
39 AROS_LHA(float, y
, D0
),
40 struct Library
*, MathIeeeSingTransBase
, 11, MathIeeeSingTrans
46 /* cosh(-x) = cosh(x) */
47 y
&= ( IEEESPMantisse_Mask
+ IEEESPExponent_Mask
);
49 if ( IEEESP_Pinfty
== y
)
51 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
57 if ( IEEESP_Pinfty
== Res
)
59 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
60 return 0x7f000000; /* Res; */
63 if ( y
< 0x41100000 ) Res
= IEEESPAdd(Res
, IEEESPDiv(one
, Res
));
68 if ( 0 == Res
|| Res
< 0 )
70 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);