2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeesingtrans_intern.h"
8 /*****************************************************************************
12 AROS_LH1(float, IEEESPCosh
,
15 AROS_LHA(float, y
, D0
),
18 struct Library
*, MathIeeeSingTransBase
, 11, MathIeeeSingTrans
)
21 Calculate the hyperbolic cosine of the IEEE single precision number
26 IEEE single precision floating point number
30 negative : 0 (not possible)
31 overflow : result too big for ffp-number
36 cosh(x) = (1/2)*( e^x + e^(-x) )
38 cosh( |x| >= 9 ) = (1/2) * (e^x);
40 *****************************************************************************/
45 /* cosh(-x) = cosh(x) */
46 y
&= ( IEEESPMantisse_Mask
+ IEEESPExponent_Mask
);
48 if ( IEEESP_Pinfty
== y
)
50 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
56 if ( IEEESP_Pinfty
== Res
)
58 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
59 return 0x7f000000; /* Res; */
62 if ( y
< 0x41100000 ) Res
= IEEESPAdd(Res
, IEEESPDiv(one
, Res
));
67 if ( 0 == Res
|| Res
< 0 )
69 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);