2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #include "mathieeedoubtrans_intern.h"
8 /*****************************************************************************
12 AROS_LHQUAD1(double, IEEEDPSinh
,
15 AROS_LHAQUAD(double, y
, D0
, D1
),
18 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 10, MathIeeeDoubTrans
)
21 Calculate the hyperbolic sine of the IEEE double precision number
26 IEEE double precision floating point number
30 negative : result is negative
31 overflow : result is too big for IEEE double precsion format
36 sinh(x) = (1/2)*( e^x- e^(-x) )
38 sinh( |x| >= 18 ) = (1/2) * (e^x);
40 *****************************************************************************/
47 /* y2 = y & (IEEEDPMantisse_Mask + IEEEDPExponent_Mask); */
52 (IEEEDPMantisse_Mask_Hi
+ IEEEDPExponent_Mask_Hi
),
53 (IEEEDPMantisse_Mask_Lo
+ IEEEDPExponent_Mask_Lo
)
56 if ( is_eqC(y
, IEEEDPPInfty_Hi
, IEEEDPPInfty_Lo
))
58 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
62 /* sinh(-x) = -sinh(x) */
65 if ( is_eqC(Res
, IEEEDPPInfty_Hi
, IEEEDPPInfty_Lo
))
67 SetSR(Overflow_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
68 if ( is_lessSC(y
, 0x0, 0x0))
70 OR64QC(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
75 if ( is_lessC(y2
, 0x40320000, 0x0) )
78 Set_Value64C(One
, one_Hi
, one_Lo
);
79 ResTmp
= IEEEDPDiv(One
, Res
);
80 OR64QC(ResTmp
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
82 Res
= IEEEDPAdd(Res
, ResTmp
);
85 ADD64QC(Res
, 0xFFF00000, 0x0);
87 /* at this point Res has to be positive to be valid */
88 if ( is_leqSC(Res
, 0x0, 0x0))
90 SetSR(Zero_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
91 AND64QC(y
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
95 if ( is_lessSC(y
, 0x0, 0x0))
97 SetSR(Negative_Bit
, Zero_Bit
| Negative_Bit
| Overflow_Bit
);
98 OR64QC(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);