一些看似无用的数学函数

张文泰 posted @ 2010年11月30日 21:14 in Code and Develop with tags C , 6484 阅读
  • log1p(x)=log(1+x):看似是一个丝毫没有用的函数,但是如果x非常之小,问题就会出现。计算机会把1+x的结果计算为1,然后返回了0,这和实际结果的相对误差实在太大。
  • expm1(x)=exp(x)-1:存在的理由和上面一样。
  • erfc(x)=1-erf(x):erf()是一个计算误差的函数,当x很大的时候,erf(x)约为1,此时1-erf(x)就会被计算为0,但它的值应该是一个正数。

转自:HACKER MONTHLY Issue 3 August by John D. Cook


本作品遵循“署名-非商业性使用-相同方式共享 3.0 Unported”协议,转载请注明来自richard-desktop
Creative Commons License
  • 无匹配
CBSE Class 2 English 说:
2022年9月15日 12:25

Download the PDF version of every chapter of Marigold & Raindrops for the CBSE Board Class 2 English Sample Paper 2023. The Marigold & Raindrops solved question paper has been created by subject specialists from the board and is recommended for at-home practise. CBSE Class 2 English Question Paper It is advised to obtain a comprehensive set of practise questions in order to improve one's performance on all Class II level exams.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter