(array)
| 78 | // We sum up in the reverse order for higher precision, as we expect the terms |
| 79 | // to grow smaller for x reasonably close to 0. |
| 80 | function precision_sum(array) { |
| 81 | var result = 0; |
| 82 | while (array.length > 0) { |
| 83 | result += array.pop(); |
| 84 | } |
| 85 | return result; |
| 86 | } |
| 87 | |
| 88 | function sin(x) { |
| 89 | var sign = 1; |