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 10 matching lines...) Expand all Loading... |
21 | 21 |
22 (function(global, utils) { | 22 (function(global, utils) { |
23 | 23 |
24 "use strict"; | 24 "use strict"; |
25 | 25 |
26 %CheckIsBootstrapping(); | 26 %CheckIsBootstrapping(); |
27 | 27 |
28 // ------------------------------------------------------------------- | 28 // ------------------------------------------------------------------- |
29 // Imports | 29 // Imports |
30 | 30 |
31 var GlobalFloat64Array = global.Float64Array; | |
32 var GlobalMath = global.Math; | 31 var GlobalMath = global.Math; |
33 var MathAbs; | 32 var MathAbs; |
34 var MathExp; | 33 var MathExp; |
35 var NaN = %GetRootNaN(); | 34 var NaN = %GetRootNaN(); |
36 var rempio2result; | 35 var rempio2result; |
37 | 36 |
38 utils.Import(function(from) { | 37 utils.Import(function(from) { |
39 MathAbs = from.MathAbs; | 38 MathAbs = from.MathAbs; |
40 MathExp = from.MathExp; | 39 MathExp = from.MathExp; |
41 }); | 40 }); |
42 | 41 |
43 utils.CreateDoubleResultArray = function(global) { | 42 utils.SetupTypedArray(function(arg) { |
44 rempio2result = new GlobalFloat64Array(2); | 43 rempio2result = arg; |
45 }; | 44 }); |
46 | 45 |
47 // ------------------------------------------------------------------- | 46 // ------------------------------------------------------------------- |
48 | 47 |
49 define INVPIO2 = 6.36619772367581382433e-01; | 48 define INVPIO2 = 6.36619772367581382433e-01; |
50 define PIO2_1 = 1.57079632673412561417; | 49 define PIO2_1 = 1.57079632673412561417; |
51 define PIO2_1T = 6.07710050650619224932e-11; | 50 define PIO2_1T = 6.07710050650619224932e-11; |
52 define PIO2_2 = 6.07710050630396597660e-11; | 51 define PIO2_2 = 6.07710050630396597660e-11; |
53 define PIO2_2T = 2.02226624879595063154e-21; | 52 define PIO2_2T = 2.02226624879595063154e-21; |
54 define PIO2_3 = 2.02226624871116645580e-21; | 53 define PIO2_3 = 2.02226624871116645580e-21; |
55 define PIO2_3T = 8.47842766036889956997e-32; | 54 define PIO2_3T = 8.47842766036889956997e-32; |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 "log10", MathLog10, | 1107 "log10", MathLog10, |
1109 "log2", MathLog2, | 1108 "log2", MathLog2, |
1110 "log1p", MathLog1p, | 1109 "log1p", MathLog1p, |
1111 "expm1", MathExpm1 | 1110 "expm1", MathExpm1 |
1112 ]); | 1111 ]); |
1113 | 1112 |
1114 %SetForceInlineFlag(MathSin); | 1113 %SetForceInlineFlag(MathSin); |
1115 %SetForceInlineFlag(MathCos); | 1114 %SetForceInlineFlag(MathCos); |
1116 | 1115 |
1117 }) | 1116 }) |
OLD | NEW |