2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubtrans_intern.h"
10 Calculate the hyperbolic sine of the IEEE double precision number
13 IEEE double precision floating point number
17 negative : result is negative
18 overflow : result is too big for IEEE double precsion format
30 sinh(x) = (1/2)*( e^x- e^(-x) )
32 sinh( |x| >= 18 ) = (1/2) * (e^x);
38 AROS_LHQUAD1(double, IEEEDPSinh
,
39 AROS_LHAQUAD(double, y
, D0
, D1
),
40 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 10, MathIeeeDoubTrans
48 /* y2 = y & (IEEEDPMantisse_Mask + IEEEDPExponent_Mask); */
53 (IEEEDPMantisse_Mask_Hi
+ IEEEDPExponent_Mask_Hi
),
54 (IEEEDPMantisse_Mask_Lo
+ IEEEDPExponent_Mask_Lo
)
57 if ( is_eqC(y
, IEEEDPPInfty_Hi
, IEEEDPPInfty_Lo
))
59 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
63 /* sinh(-x) = -sinh(x) */
66 if ( is_eqC(Res
, IEEEDPPInfty_Hi
, IEEEDPPInfty_Lo
))
68 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
69 if ( is_lessSC(y
, 0x0, 0x0))
71 OR64QC(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
76 if ( is_lessC(y2
, 0x40320000, 0x0) )
79 Set_Value64C(One
, one_Hi
, one_Lo
);
80 ResTmp
= IEEEDPDiv(One
, Res
);
81 OR64QC(ResTmp
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
83 Res
= IEEEDPAdd(Res
, ResTmp
);
86 ADD64QC(Res
, 0xFFF00000, 0x0);
88 /* at this point Res has to be positive to be valid */
89 if ( is_leqSC(Res
, 0x0, 0x0))
91 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
92 AND64QC(y
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
96 if ( is_lessSC(y
, 0x0, 0x0))
98 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
99 OR64QC(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);