| OLD | NEW |
| 1 // The following is adapted from fdlibm (http://www.netlib.org/fdlibm), | 1 // The following is adapted from fdlibm (http://www.netlib.org/fdlibm), |
| 2 // | 2 // |
| 3 // ==================================================== | 3 // ==================================================== |
| 4 // Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. | 4 // Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. |
| 5 // | 5 // |
| 6 // Developed at SunSoft, a Sun Microsystems, Inc. business. | 6 // Developed at SunSoft, a Sun Microsystems, Inc. business. |
| 7 // Permission to use, copy, modify, and distribute this | 7 // Permission to use, copy, modify, and distribute this |
| 8 // software is freely granted, provided that this notice | 8 // software is freely granted, provided that this notice |
| 9 // is preserved. | 9 // is preserved. |
| 10 // ==================================================== | 10 // ==================================================== |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 var t = n; | 1016 var t = n; |
| 1017 var t1 = %_ConstructDouble(%_DoubleHi(((z_h + z_l) + dp_h) + t), 0); | 1017 var t1 = %_ConstructDouble(%_DoubleHi(((z_h + z_l) + dp_h) + t), 0); |
| 1018 var t2 = z_l - (((t1 - t) - dp_h) - z_h); | 1018 var t2 = z_l - (((t1 - t) - dp_h) - z_h); |
| 1019 | 1019 |
| 1020 // t1 + t2 = log2(ax), sum up because we do not care about extra precision. | 1020 // t1 + t2 = log2(ax), sum up because we do not care about extra precision. |
| 1021 return t1 + t2; | 1021 return t1 + t2; |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 //------------------------------------------------------------------- | 1024 //------------------------------------------------------------------- |
| 1025 | 1025 |
| 1026 utils.InstallFunctions(GlobalMath, DONT_ENUM, [ | 1026 $installFunctions(GlobalMath, DONT_ENUM, [ |
| 1027 "cos", MathCos, | 1027 "cos", MathCos, |
| 1028 "sin", MathSin, | 1028 "sin", MathSin, |
| 1029 "tan", MathTan, | 1029 "tan", MathTan, |
| 1030 "sinh", MathSinh, | 1030 "sinh", MathSinh, |
| 1031 "cosh", MathCosh, | 1031 "cosh", MathCosh, |
| 1032 "log10", MathLog10, | 1032 "log10", MathLog10, |
| 1033 "log2", MathLog2, | 1033 "log2", MathLog2, |
| 1034 "log1p", MathLog1p, | 1034 "log1p", MathLog1p, |
| 1035 "expm1", MathExpm1 | 1035 "expm1", MathExpm1 |
| 1036 ]); | 1036 ]); |
| 1037 | 1037 |
| 1038 %SetForceInlineFlag(MathSin); | 1038 %SetForceInlineFlag(MathSin); |
| 1039 %SetForceInlineFlag(MathCos); | 1039 %SetForceInlineFlag(MathCos); |
| 1040 | 1040 |
| 1041 }) | 1041 }) |
| OLD | NEW |