Approximate math library for Linux? Or exp function algorithm?

Approximate math library for Linux? Or exp function algorithm?

Hi,

I'm working on a project for which I need a very fast & vectorizableapproximation of the exp function, accurate to say 0.1% or so. I've tried to use the approximate math library, but that appears to be Windows-specific. (I did hack around a bit and get a version that would compile, but it causes a segfault sometime after the am_exp_ps call returns.)

Would anyone know if a) there's a Linux version around somewhere; b) what needs to be done to convert the Windows code; or c) the source of the algorithm used, so I can code it myself?

Thanks,
James

7 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

You might also want to check the vector math functions in the Intel IPP product. You can download the manual from the web, and check some of the performance number.

http://developer.intel.com/software/products/ipp/docs/ippsman.htm

Page 12-22

Shinn

I've looked at that, butI don't think it'ssuitable for what I'm doing. I'm not simply computing a vector of exps, I'm writing vector routines to compute various complicated equations,some factors inwhichare exps. So if I were to use the vector routines, I'd have to make several passes, storing intermediate results. Not only would that slow down the computation, it would require extra memory. We don't have a lot to spare - I've spent a lot of time trying to sweat the code down to fit in themere 256 GBytes available at present.

Not to mention that I'd still like to save time with a fast approximation rather than a slower but unnecessarily precise routine.

TODD R. (Intel)的头像

James,

Have you ever checked out the Intel Math Kernel Library? Intel MKL contains vecter math functions including exp as part of its Vector Math Library (VML). You can read more at the product website (http://www.intel.com/software/products/mkl/) or look at the documentation online (http://www.intel.com/software/products/mkl/docs/manuals.htm).

Todd

Intel MKL forum: http://softwareforums.intel.com/ids/board?board.id=MKL

Todd,

I've been trying to download the VML library demo, but haven't had much luck. (The registration page said it'd send me a key, but hasn't so far.) However, I think the exp function in it would compute the result to full float precision, no? I don't absolutely need that much accuracy for my project, since a) the measurements from which the code is derived are only accurate to a few percent, and b) there's a random distribution being applied to it anyway.

I wouldlike to be able to trade off that excess accuracy for increased speed. Presently I'm using a 7-term McLaurin series approximation (your basic calculus one), but the code in the AM library looks as though it might be a bit faster.

Wendy Doerner (Intel)的头像

James,

If you are having difficulty installing the Intel MKL evaluation version please file an issue at premier.intel.com so we can look into it. The "key" you mention might be a license file which should be emailed to you within an hour or two of registering. If you file an issue we can investigate what the problem might be and get you a license file.

Thanks,

Community Admin的头像

James,

I am afraid that I misunderstood your original request. I had thought you were looking vectors and not scalars. This is really out of the scope of the Intel MKL and I do not know what to recommend.

Bruce

登陆并发表评论。