| 17 | } |
| 18 | |
| 19 | private static void test(MathUtilsTest.OPER oper, boolean fast) |
| 20 | { |
| 21 | MathHelper.fastMath = fast; |
| 22 | double d0; |
| 23 | double d1; |
| 24 | |
| 25 | switch (oper) |
| 26 | { |
| 27 | case SIN: |
| 28 | case COS: |
| 29 | d0 = (double)(-MathHelper.PI); |
| 30 | d1 = (double)MathHelper.PI; |
| 31 | break; |
| 32 | |
| 33 | case ASIN: |
| 34 | case ACOS: |
| 35 | d0 = -1.0D; |
| 36 | d1 = 1.0D; |
| 37 | break; |
| 38 | |
| 39 | default: |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | int i = 10; |
| 44 | |
| 45 | for (int j = 0; j <= i; ++j) |
| 46 | { |
| 47 | double d2 = d0 + (double)j * (d1 - d0) / (double)i; |
| 48 | float f; |
| 49 | float f1; |
| 50 | |
| 51 | switch (oper) |
| 52 | { |
| 53 | case SIN: |
| 54 | f = (float)Math.sin(d2); |
| 55 | f1 = MathHelper.sin((float)d2); |
| 56 | break; |
| 57 | |
| 58 | case COS: |
| 59 | f = (float)Math.cos(d2); |
| 60 | f1 = MathHelper.cos((float)d2); |
| 61 | break; |
| 62 | |
| 63 | case ASIN: |
| 64 | f = (float)Math.asin(d2); |
| 65 | f1 = MathUtils.asin((float)d2); |
| 66 | break; |
| 67 | |
| 68 | case ACOS: |
| 69 | f = (float)Math.acos(d2); |
| 70 | f1 = MathUtils.acos((float)d2); |
| 71 | break; |
| 72 | |
| 73 | default: |
| 74 | return; |
| 75 | } |
| 76 | |