问题描述
是否有公开可用的库,将产生确切的
相同的结果sin,cos,floor,ceil,exp和登录32位和
64位linux,solaris和可能的其他平台?
我正在考虑以下替代方法:
a)编译
与 gcc -mfpmath = sse
和每个
平台相同的优化级别。 ..但不清楚这将工作。
b),但我担心这将是
太慢。
关于精度(编辑):对于这个特定的应用程序
我真的不需要产生值为
的数值最接近准确值。我只需要答案
在所有平台上完全相同,os和bitness。那
表示值需要是合理的(5位数将
可能就足够了)。对于我在最初的问题中没有提出这个清楚的
,我表示歉意。
我想MAPM或MPFR具有足够低的精度设置可能会做
的伎俩,但我希望找到的东西,没有
多精度机械/风味。在任何情况下,我将
尝试这个。
会这样:是你什么正在搜索(这是一个库,其目的是能够替换C99的标准数学库 - 因此在正常情况下保持足够好的性能 - 同时确保根据IEEE 754舍入模式正确舍入结果)?
Is there a publically available library that will produce the exactsame results for sin, cos, floor, ceil, exp and log on 32 bit and64 bit linux, solaris and possibly other platforms?
I am considering the following alternatives:
a) cephes compiledwith gcc -mfpmath=sse
and the same optimization levels on eachplatform ... but its not clear that this would work.
b) MPFR but I am worried that this would betoo slow.
Regarding precision (edited): For this particular applicationI don't really need something that produces the value that isnumerically closest to the exact value. I just need the answersto be the exact same on all platforms, os and "bitness". Thatbeing said the values need to be reasonable (5 digits wouldprobably be enough). I apologize for not having made this clearin my initial question.
I guess MAPM or MPFR with a low enough precision setting might dothe trick but I was hoping to find something that did not havethe "multiple precision" machinery/flavor to it. In any case, I willtry this out.
Would something like: http://lipforge.ens-lyon.fr/www/crlibm/index.html be what you are searching for (this is a library whose aim is to be able to replace the standard math library of C99 -- so keep good enough performance in the normal cases -- while ensuring correctly rounded result according to IEEE 754 rounding modes) ?
这篇关于平台独立的数学库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!