Expressing mathematical subroutines constructively
暂无分享,去创建一个
The typical subroutines that compute sin(x) and exp(x) bear little resemblance to our mathematical knowledge of these functions: they are composed of concrete arithmetic expressions that include many mysterious numerical constants. Instead of programming these subroutines conventionally, we can express their construction using symbolic ideas such as periodicity, Taylor series, and economization. Such an approach has many advantages: the code is closer to the mathematical basis of the function, is less vulnerable to errors, and is trivially adaptable to various precisions.
[1] Forman S. Acton,et al. Numerical methods that work , 1970 .
[2] Gerald J. Sussman,et al. Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.
[3] Milton Abramowitz,et al. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables , 1964 .