Why does table-based sin approximation literature always use this formula when another formula seems to make more sense?

后端 未结 3 1354
失恋的感觉
失恋的感觉 2020-12-11 01:05

The literature on computing the elementary function sin with tables refers to the formula:

sin(x) = sin(Cn) * cos(h) + cos(Cn) * sin(h)
<         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 02:10

    You are meeting the boundary between theoretical mathematics and practical numerical calculations.

    The trigonometric identity

    sin(a + b) = sin(a) * cos( b ) + cos(a) * sin(b)
    

    gives rise to the formula that you quote:

    sin(x) = sin(Cn) * cos(h) + cos(Cn) * sin(h)
    

    when you substitute Cn + h for x. This formula is mathematically exact.

    However, due to the limitations of practical numeric computation, i.e. floating point arithmetic in your case, we do not have the infinite precision available to numerically calculate such formula exactly. In practice we need to consider the accuracy that we can use to represent the values in the table and what errors are introduced when we perform limited accuracy calculations on these limited accuracy values. The mathematical discipline that deals with practical numerical computation is Numerical Analysis.

    There is a very brief summary of Numerical Analysis on Wikipedia with many links to various topics within the subject. I think that you might find Computing values of functions and Interpolation, Extrapolation, and Regression of particular relevance.

提交回复
热议问题