Author: mattip <[email protected]> Branch: numpypy-complex2 Changeset: r57258:32ccbb214dae Date: 2012-09-09 23:28 +0300 http://bitbucket.org/pypy/pypy/changeset/32ccbb214dae/
Log: merge within branch diff --git a/pypy/module/micronumpy/test/complex_testcases.txt b/pypy/module/micronumpy/test/complex_testcases.txt --- a/pypy/module/micronumpy/test/complex_testcases.txt +++ b/pypy/module/micronumpy/test/complex_testcases.txt @@ -1638,10 +1638,10 @@ exp1019 exp inf 4.2 -> -inf -inf exp1020 exp inf 5.6 -> inf -inf exp1021 exp inf 7.0 -> inf inf -exp1022 exp -inf inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -exp1023 exp inf inf -> inf nan invalid ignore-real-sign -exp1024 exp -inf nan -> 0.0 0.0 ignore-real-sign ignore-imag-sign -exp1025 exp inf nan -> inf nan ignore-real-sign +exp1022 exp -inf inf -> nan nan ignore-real-sign ignore-imag-sign +exp1023 exp inf inf -> nan nan invalid ignore-real-sign +exp1024 exp -inf nan -> nan nan ignore-real-sign ignore-imag-sign +exp1025 exp inf nan -> nan nan ignore-real-sign exp1026 exp nan 0.0 -> nan 0.0 exp1027 exp nan 2.3 -> nan nan exp1028 exp nan inf -> nan nan @@ -1664,8 +1664,8 @@ exp1045 exp inf -4.2 -> -inf inf exp1046 exp inf -5.6 -> inf inf exp1047 exp inf -7.0 -> inf -inf -exp1048 exp -inf -inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -exp1049 exp inf -inf -> inf nan invalid ignore-real-sign +exp1048 exp -inf -inf -> nan nan ignore-real-sign ignore-imag-sign +exp1049 exp inf -inf -> nan nan invalid ignore-real-sign exp1050 exp nan -0.0 -> nan -0.0 exp1051 exp nan -2.3 -> nan nan exp1052 exp nan -inf -> nan nan @@ -1709,8 +1709,8 @@ -- special values cosh1000 cosh 0.0 0.0 -> 1.0 0.0 -cosh1001 cosh 0.0 inf -> nan 0.0 invalid ignore-imag-sign -cosh1002 cosh 0.0 nan -> nan 0.0 ignore-imag-sign +cosh1001 cosh 0.0 inf -> nan nan invalid ignore-imag-sign +cosh1002 cosh 0.0 nan -> nan nan ignore-imag-sign cosh1003 cosh 2.3 inf -> nan nan invalid cosh1004 cosh 2.3 nan -> nan nan cosh1005 cosh inf 0.0 -> inf 0.0 @@ -1719,14 +1719,14 @@ cosh1008 cosh inf 4.2 -> -inf -inf cosh1009 cosh inf 5.6 -> inf -inf cosh1010 cosh inf 7.0 -> inf inf -cosh1011 cosh inf inf -> inf nan invalid ignore-real-sign -cosh1012 cosh inf nan -> inf nan +cosh1011 cosh inf inf -> nan nan invalid ignore-real-sign +cosh1012 cosh inf nan -> nan nan cosh1013 cosh nan 0.0 -> nan 0.0 ignore-imag-sign cosh1014 cosh nan 2.3 -> nan nan cosh1015 cosh nan inf -> nan nan cosh1016 cosh nan nan -> nan nan cosh1017 cosh 0.0 -0.0 -> 1.0 -0.0 -cosh1018 cosh 0.0 -inf -> nan 0.0 invalid ignore-imag-sign +cosh1018 cosh 0.0 -inf -> nan nan invalid ignore-imag-sign cosh1019 cosh 2.3 -inf -> nan nan invalid cosh1020 cosh inf -0.0 -> inf -0.0 cosh1021 cosh inf -1.4 -> inf -inf @@ -1734,13 +1734,13 @@ cosh1023 cosh inf -4.2 -> -inf inf cosh1024 cosh inf -5.6 -> inf inf cosh1025 cosh inf -7.0 -> inf -inf -cosh1026 cosh inf -inf -> inf nan invalid ignore-real-sign +cosh1026 cosh inf -inf -> nan nan invalid ignore-real-sign cosh1027 cosh nan -0.0 -> nan 0.0 ignore-imag-sign cosh1028 cosh nan -2.3 -> nan nan cosh1029 cosh nan -inf -> nan nan cosh1030 cosh -0.0 -0.0 -> 1.0 0.0 -cosh1031 cosh -0.0 -inf -> nan 0.0 invalid ignore-imag-sign -cosh1032 cosh -0.0 nan -> nan 0.0 ignore-imag-sign +cosh1031 cosh -0.0 -inf -> nan nan invalid ignore-imag-sign +cosh1032 cosh -0.0 nan -> nan nan ignore-imag-sign cosh1033 cosh -2.3 -inf -> nan nan invalid cosh1034 cosh -2.3 nan -> nan nan cosh1035 cosh -inf -0.0 -> inf 0.0 @@ -1749,10 +1749,10 @@ cosh1038 cosh -inf -4.2 -> -inf -inf cosh1039 cosh -inf -5.6 -> inf -inf cosh1040 cosh -inf -7.0 -> inf inf -cosh1041 cosh -inf -inf -> inf nan invalid ignore-real-sign -cosh1042 cosh -inf nan -> inf nan +cosh1041 cosh -inf -inf -> nan nan invalid ignore-real-sign +cosh1042 cosh -inf nan -> nan nan cosh1043 cosh -0.0 0.0 -> 1.0 -0.0 -cosh1044 cosh -0.0 inf -> nan 0.0 invalid ignore-imag-sign +cosh1044 cosh -0.0 inf -> nan nan invalid ignore-imag-sign cosh1045 cosh -2.3 inf -> nan nan invalid cosh1046 cosh -inf 0.0 -> inf -0.0 cosh1047 cosh -inf 1.4 -> inf -inf @@ -1760,7 +1760,7 @@ cosh1049 cosh -inf 4.2 -> -inf inf cosh1050 cosh -inf 5.6 -> inf inf cosh1051 cosh -inf 7.0 -> inf -inf -cosh1052 cosh -inf inf -> inf nan invalid ignore-real-sign +cosh1052 cosh -inf inf -> nan nan invalid ignore-real-sign --------------------------- @@ -1801,8 +1801,8 @@ -- special values sinh1000 sinh 0.0 0.0 -> 0.0 0.0 -sinh1001 sinh 0.0 inf -> 0.0 nan invalid ignore-real-sign -sinh1002 sinh 0.0 nan -> 0.0 nan ignore-real-sign +sinh1001 sinh 0.0 inf -> nan nan invalid ignore-real-sign +sinh1002 sinh 0.0 nan -> nan nan ignore-real-sign sinh1003 sinh 2.3 inf -> nan nan invalid sinh1004 sinh 2.3 nan -> nan nan sinh1005 sinh inf 0.0 -> inf 0.0 @@ -1811,14 +1811,14 @@ sinh1008 sinh inf 4.2 -> -inf -inf sinh1009 sinh inf 5.6 -> inf -inf sinh1010 sinh inf 7.0 -> inf inf -sinh1011 sinh inf inf -> inf nan invalid ignore-real-sign -sinh1012 sinh inf nan -> inf nan ignore-real-sign +sinh1011 sinh inf inf -> nan nan invalid ignore-real-sign +sinh1012 sinh inf nan -> nan nan ignore-real-sign sinh1013 sinh nan 0.0 -> nan 0.0 sinh1014 sinh nan 2.3 -> nan nan sinh1015 sinh nan inf -> nan nan sinh1016 sinh nan nan -> nan nan sinh1017 sinh 0.0 -0.0 -> 0.0 -0.0 -sinh1018 sinh 0.0 -inf -> 0.0 nan invalid ignore-real-sign +sinh1018 sinh 0.0 -inf -> nan nan invalid ignore-real-sign sinh1019 sinh 2.3 -inf -> nan nan invalid sinh1020 sinh inf -0.0 -> inf -0.0 sinh1021 sinh inf -1.4 -> inf -inf @@ -1826,13 +1826,13 @@ sinh1023 sinh inf -4.2 -> -inf inf sinh1024 sinh inf -5.6 -> inf inf sinh1025 sinh inf -7.0 -> inf -inf -sinh1026 sinh inf -inf -> inf nan invalid ignore-real-sign +sinh1026 sinh inf -inf -> nan nan invalid ignore-real-sign sinh1027 sinh nan -0.0 -> nan -0.0 sinh1028 sinh nan -2.3 -> nan nan sinh1029 sinh nan -inf -> nan nan sinh1030 sinh -0.0 -0.0 -> -0.0 -0.0 -sinh1031 sinh -0.0 -inf -> 0.0 nan invalid ignore-real-sign -sinh1032 sinh -0.0 nan -> 0.0 nan ignore-real-sign +sinh1031 sinh -0.0 -inf -> nan nan invalid ignore-real-sign +sinh1032 sinh -0.0 nan -> nan nan ignore-real-sign sinh1033 sinh -2.3 -inf -> nan nan invalid sinh1034 sinh -2.3 nan -> nan nan sinh1035 sinh -inf -0.0 -> -inf -0.0 @@ -1841,10 +1841,10 @@ sinh1038 sinh -inf -4.2 -> inf inf sinh1039 sinh -inf -5.6 -> -inf inf sinh1040 sinh -inf -7.0 -> -inf -inf -sinh1041 sinh -inf -inf -> inf nan invalid ignore-real-sign -sinh1042 sinh -inf nan -> inf nan ignore-real-sign +sinh1041 sinh -inf -inf -> nan nan invalid ignore-real-sign +sinh1042 sinh -inf nan -> nan nan ignore-real-sign sinh1043 sinh -0.0 0.0 -> -0.0 0.0 -sinh1044 sinh -0.0 inf -> 0.0 nan invalid ignore-real-sign +sinh1044 sinh -0.0 inf -> nan nan invalid ignore-real-sign sinh1045 sinh -2.3 inf -> nan nan invalid sinh1046 sinh -inf 0.0 -> -inf 0.0 sinh1047 sinh -inf 1.4 -> -inf inf @@ -1852,7 +1852,7 @@ sinh1049 sinh -inf 4.2 -> inf -inf sinh1050 sinh -inf 5.6 -> -inf -inf sinh1051 sinh -inf 7.0 -> -inf inf -sinh1052 sinh -inf inf -> inf nan invalid ignore-real-sign +sinh1052 sinh -inf inf -> nan nan invalid ignore-real-sign ------------------------------ @@ -1905,8 +1905,8 @@ tanh1008 tanh inf 2.1 -> 1.0 -0.0 tanh1009 tanh inf 2.8 -> 1.0 -0.0 tanh1010 tanh inf 3.5 -> 1.0 0.0 -tanh1011 tanh inf inf -> 1.0 0.0 ignore-imag-sign -tanh1012 tanh inf nan -> 1.0 0.0 ignore-imag-sign +tanh1011 tanh inf inf -> nan nan ignore-imag-sign +tanh1012 tanh inf nan -> nan nan ignore-imag-sign tanh1013 tanh nan 0.0 -> nan 0.0 tanh1014 tanh nan 2.3 -> nan nan tanh1015 tanh nan inf -> nan nan @@ -1920,7 +1920,7 @@ tanh1023 tanh inf -2.1 -> 1.0 0.0 tanh1024 tanh inf -2.8 -> 1.0 0.0 tanh1025 tanh inf -3.5 -> 1.0 -0.0 -tanh1026 tanh inf -inf -> 1.0 0.0 ignore-imag-sign +tanh1026 tanh inf -inf -> nan nan ignore-imag-sign tanh1027 tanh nan -0.0 -> nan -0.0 tanh1028 tanh nan -2.3 -> nan nan tanh1029 tanh nan -inf -> nan nan @@ -1935,8 +1935,8 @@ tanh1038 tanh -inf -2.1 -> -1.0 0.0 tanh1039 tanh -inf -2.8 -> -1.0 0.0 tanh1040 tanh -inf -3.5 -> -1.0 -0.0 -tanh1041 tanh -inf -inf -> -1.0 0.0 ignore-imag-sign -tanh1042 tanh -inf nan -> -1.0 0.0 ignore-imag-sign +tanh1041 tanh -inf -inf -> nan nan ignore-imag-sign +tanh1042 tanh -inf nan -> nan nan ignore-imag-sign tanh1043 tanh -0.0 0.0 -> -0.0 0.0 tanh1044 tanh -0.0 inf -> nan nan invalid tanh1045 tanh -2.3 inf -> nan nan invalid @@ -1946,7 +1946,7 @@ tanh1049 tanh -inf 2.1 -> -1.0 -0.0 tanh1050 tanh -inf 2.8 -> -1.0 -0.0 tanh1051 tanh -inf 3.5 -> -1.0 0.0 -tanh1052 tanh -inf inf -> -1.0 0.0 ignore-imag-sign +tanh1052 tanh -inf inf -> nan nan ignore-imag-sign ----------------- @@ -1983,11 +1983,11 @@ -- special values cos1000 cos -0.0 0.0 -> 1.0 0.0 -cos1001 cos -inf 0.0 -> nan 0.0 invalid ignore-imag-sign -cos1002 cos nan 0.0 -> nan 0.0 ignore-imag-sign +cos1001 cos -inf 0.0 -> nan nan invalid ignore-imag-sign +cos1002 cos nan 0.0 -> nan nan ignore-imag-sign cos1003 cos -inf 2.2999999999999998 -> nan nan invalid cos1004 cos nan 2.2999999999999998 -> nan nan -cos1005 cos -0.0 inf -> inf 0.0 +cos1005 cos -0.0 inf -> inf nan cos1006 cos -1.3999999999999999 inf -> inf inf cos1007 cos -2.7999999999999998 inf -> -inf inf cos1008 cos -4.2000000000000002 inf -> -inf -inf @@ -2212,155 +2212,3 @@ tan1051 tan -3.5 -inf -> -0.0 -1.0 tan1052 tan -inf -inf -> -0.0 -1.0 ignore-real-sign - ------------------------------------------------------------------------- --- rect: Conversion from polar coordinates to rectangular coordinates -- ------------------------------------------------------------------------- --- --- For cmath.rect, we can use the same testcase syntax as for the --- complex -> complex functions above, but here the input arguments --- should be interpreted as a pair of floating-point numbers rather --- than the real and imaginary parts of a complex number. --- --- Here are the 'spirit of C99' rules for rect. First, the short --- version: --- --- rect(x, t) = exp(log(x)+it) for positive-signed x --- rect(x, t) = -exp(log(-x)+it) for negative-signed x --- rect(nan, t) = exp(nan + it), except that in rect(nan, +-0) the --- sign of the imaginary part is unspecified. --- --- and now the long version: --- --- rect(x, -t) = conj(rect(x, t)) for all x and t --- rect(-x, t) = -rect(x, t) for all x and t --- rect(+0, +0) returns +0 + i0 --- rect(+0, inf) returns +- 0 +- i0, where the signs of the real and --- imaginary parts are unspecified. --- rect(x, inf) returns NaN + i NaN and raises the "invalid" --- floating-point exception, for finite nonzero x. --- rect(inf, inf) returns +-inf + i NaN and raises the "invalid" --- floating-point exception (where the sign of the real part of the --- result is unspecified). --- rect(inf, +0) returns inf+i0 --- rect(inf, x) returns inf*cis(x), for finite nonzero x --- rect(inf, NaN) returns +-inf+i NaN, where the sign of the real part --- of the result is unspecified. --- rect(NaN, x) returns NaN + i NaN for all nonzero numbers (including --- infinities) x --- rect(NaN, 0) returns NaN +- i0, where the sign of the imaginary --- part is unspecified --- rect(NaN, NaN) returns NaN + i NaN --- rect(x, NaN) returns NaN + i NaN for finite nonzero x --- rect(+0, NaN) return +-0 +- i0, where the signs of the real and --- imaginary parts are unspecified. - --- special values -rect1000 rect 0.0 0.0 -> 0.0 0.0 -rect1001 rect 0.0 inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1002 rect 2.3 inf -> nan nan invalid -rect1003 rect inf inf -> inf nan invalid ignore-real-sign -rect1004 rect inf 0.0 -> inf 0.0 -rect1005 rect inf 1.4 -> inf inf -rect1006 rect inf 2.8 -> -inf inf -rect1007 rect inf 4.2 -> -inf -inf -rect1008 rect inf 5.6 -> inf -inf -rect1009 rect inf 7.0 -> inf inf -rect1010 rect nan 0.0 -> nan 0.0 ignore-imag-sign -rect1011 rect nan 2.3 -> nan nan -rect1012 rect nan inf -> nan nan -rect1013 rect nan nan -> nan nan -rect1014 rect inf nan -> inf nan ignore-real-sign -rect1015 rect 2.3 nan -> nan nan -rect1016 rect 0.0 nan -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1017 rect 0.0 -0.0 -> 0.0 -0.0 -rect1018 rect 0.0 -inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1019 rect 2.3 -inf -> nan nan invalid -rect1020 rect inf -inf -> inf nan invalid ignore-real-sign -rect1021 rect inf -0.0 -> inf -0.0 -rect1022 rect inf -1.4 -> inf -inf -rect1023 rect inf -2.8 -> -inf -inf -rect1024 rect inf -4.2 -> -inf inf -rect1025 rect inf -5.6 -> inf inf -rect1026 rect inf -7.0 -> inf -inf -rect1027 rect nan -0.0 -> nan 0.0 ignore-imag-sign -rect1028 rect nan -2.3 -> nan nan -rect1029 rect nan -inf -> nan nan -rect1030 rect -0.0 0.0 -> -0.0 -0.0 -rect1031 rect -0.0 inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1032 rect -2.3 inf -> nan nan invalid -rect1033 rect -inf inf -> -inf nan invalid ignore-real-sign -rect1034 rect -inf 0.0 -> -inf -0.0 -rect1035 rect -inf 1.4 -> -inf -inf -rect1036 rect -inf 2.8 -> inf -inf -rect1037 rect -inf 4.2 -> inf inf -rect1038 rect -inf 5.6 -> -inf inf -rect1039 rect -inf 7.0 -> -inf -inf -rect1040 rect -inf nan -> inf nan ignore-real-sign -rect1041 rect -2.3 nan -> nan nan -rect1042 rect -0.0 nan -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1043 rect -0.0 -0.0 -> -0.0 0.0 -rect1044 rect -0.0 -inf -> 0.0 0.0 ignore-real-sign ignore-imag-sign -rect1045 rect -2.3 -inf -> nan nan invalid -rect1046 rect -inf -inf -> -inf nan invalid ignore-real-sign -rect1047 rect -inf -0.0 -> -inf 0.0 -rect1048 rect -inf -1.4 -> -inf inf -rect1049 rect -inf -2.8 -> inf inf -rect1050 rect -inf -4.2 -> inf -inf -rect1051 rect -inf -5.6 -> -inf -inf -rect1052 rect -inf -7.0 -> -inf inf - -------------------------------------------------------------------------- --- polar: Conversion from rectangular coordinates to polar coordinates -- -------------------------------------------------------------------------- --- --- For cmath.polar, we can use the same testcase syntax as for the --- complex -> complex functions above, but here the output arguments --- should be interpreted as a pair of floating-point numbers rather --- than the real and imaginary parts of a complex number. --- --- Annex G of the C99 standard describes fully both the real and --- imaginary parts of polar (as cabs and carg, respectively, which in turn --- are defined in terms of the functions hypot and atan2). - --- overflow -polar0100 polar 1.4e308 1.4e308 -> inf 0.78539816339744828 overflow - --- special values -polar1000 polar 0.0 0.0 -> 0.0 0.0 -polar1001 polar 0.0 -0.0 -> 0.0 -0.0 -polar1002 polar -0.0 0.0 -> 0.0 3.1415926535897931 -polar1003 polar -0.0 -0.0 -> 0.0 -3.1415926535897931 -polar1004 polar inf 0.0 -> inf 0.0 -polar1005 polar inf 2.3 -> inf 0.0 -polar1006 polar inf inf -> inf 0.78539816339744828 -polar1007 polar 2.3 inf -> inf 1.5707963267948966 -polar1008 polar 0.0 inf -> inf 1.5707963267948966 -polar1009 polar -0.0 inf -> inf 1.5707963267948966 -polar1010 polar -2.3 inf -> inf 1.5707963267948966 -polar1011 polar -inf inf -> inf 2.3561944901923448 -polar1012 polar -inf 2.3 -> inf 3.1415926535897931 -polar1013 polar -inf 0.0 -> inf 3.1415926535897931 -polar1014 polar -inf -0.0 -> inf -3.1415926535897931 -polar1015 polar -inf -2.3 -> inf -3.1415926535897931 -polar1016 polar -inf -inf -> inf -2.3561944901923448 -polar1017 polar -2.3 -inf -> inf -1.5707963267948966 -polar1018 polar -0.0 -inf -> inf -1.5707963267948966 -polar1019 polar 0.0 -inf -> inf -1.5707963267948966 -polar1020 polar 2.3 -inf -> inf -1.5707963267948966 -polar1021 polar inf -inf -> inf -0.78539816339744828 -polar1022 polar inf -2.3 -> inf -0.0 -polar1023 polar inf -0.0 -> inf -0.0 -polar1024 polar nan -inf -> inf nan -polar1025 polar nan -2.3 -> nan nan -polar1026 polar nan -0.0 -> nan nan -polar1027 polar nan 0.0 -> nan nan -polar1028 polar nan 2.3 -> nan nan -polar1029 polar nan inf -> inf nan -polar1030 polar nan nan -> nan nan -polar1031 polar inf nan -> inf nan -polar1032 polar 2.3 nan -> nan nan -polar1033 polar 0.0 nan -> nan nan -polar1034 polar -0.0 nan -> nan nan -polar1035 polar -2.3 nan -> nan nan -polar1036 polar -inf nan -> inf nan _______________________________________________ pypy-commit mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-commit
