| 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 var t = n; | 1005 var t = n; |
| 1006 var t1 = %_ConstructDouble(%_DoubleHi(((z_h + z_l) + dp_h) + t), 0); | 1006 var t1 = %_ConstructDouble(%_DoubleHi(((z_h + z_l) + dp_h) + t), 0); |
| 1007 var t2 = z_l - (((t1 - t) - dp_h) - z_h); | 1007 var t2 = z_l - (((t1 - t) - dp_h) - z_h); |
| 1008 | 1008 |
| 1009 // t1 + t2 = log2(ax), sum up because we do not care about extra precision. | 1009 // t1 + t2 = log2(ax), sum up because we do not care about extra precision. |
| 1010 return t1 + t2; | 1010 return t1 + t2; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 //------------------------------------------------------------------- | 1013 //------------------------------------------------------------------- |
| 1014 | 1014 |
| 1015 InstallFunctions(GlobalMath, DONT_ENUM, [ | 1015 $installFunctions(GlobalMath, DONT_ENUM, [ |
| 1016 "cos", MathCos, | 1016 "cos", MathCos, |
| 1017 "sin", MathSin, | 1017 "sin", MathSin, |
| 1018 "tan", MathTan, | 1018 "tan", MathTan, |
| 1019 "sinh", MathSinh, | 1019 "sinh", MathSinh, |
| 1020 "cosh", MathCosh, | 1020 "cosh", MathCosh, |
| 1021 "log10", MathLog10, | 1021 "log10", MathLog10, |
| 1022 "log2", MathLog2, | 1022 "log2", MathLog2, |
| 1023 "log1p", MathLog1p, | 1023 "log1p", MathLog1p, |
| 1024 "expm1", MathExpm1 | 1024 "expm1", MathExpm1 |
| 1025 ]); | 1025 ]); |
| 1026 | 1026 |
| 1027 %SetInlineBuiltinFlag(MathSin); | 1027 %SetInlineBuiltinFlag(MathSin); |
| 1028 %SetInlineBuiltinFlag(MathCos); | 1028 %SetInlineBuiltinFlag(MathCos); |
| 1029 | 1029 |
| 1030 })(); | 1030 })(); |
| OLD | NEW |