SERVING THE QUANTITATIVE FINANCE COMMUNITY

  • 1
  • 2
  • 3
  • 4
  • 5
  • 11
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Optimized math functions

October 7th, 2010, 5:21 am

A general question: are these algorithms for exp(), log() etc. from vendors being tested as black boxes. i.e. you are not concerned with/able to see the internals?
 
User avatar
Cuchulainn
Posts: 62371
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Optimized math functions

October 7th, 2010, 6:08 am

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnA general question: are these algorithms for exp(), log() etc. from vendors being tested as black boxes. i.e. you are not concerned with/able to see the internals?Yes, you need to test algortihms -like renorm does-. But the closed box vendor issue is much broader than "3rd party" tools, right? Have you ever looked at the quality and complexity of black box tools like XP, visual studio 2000 or Excel 97? Those are old, so we have a good quality overview by now. The amount of errors in those is scandalous. And even Intel makes mistakes with flops... In general I have higher regard of specialized libs because quality is their core business so they better get is right. Besides that I have a strong preference for tools with a large use base, ...and I have a strong preference for open source tools. That community is very open and engaged, tools are also very mature.In other disciplines, vendors produce tables of permissible operating limits using destructive and non-destructive statistical techniques (Weibull). Software products are different. A good example is to look at Excel stats functions.
 
User avatar
renorm
Topic Author
Posts: 886
Joined: February 11th, 2010, 10:20 pm

Optimized math functions

October 7th, 2010, 6:43 am

QuoteBtw, do you know if openMP can parallelize code across SSE? Or does it only operate at the cores, CPUs level? They are orthogonal. OpenMP is about parallelism, SSE is about using CPU's SIMD ALU.
Last edited by renorm on October 6th, 2010, 10:00 pm, edited 1 time in total.
 
User avatar
renorm
Topic Author
Posts: 886
Joined: February 11th, 2010, 10:20 pm

Optimized math functions

October 7th, 2010, 8:11 am

Are you talking about auto-parallelization and auto-vectorization features? If so, the answer to your question is yes, if the compiler supports both features. A quote from ICC manual:QuoteThe auto-parallelization feature of the Intel® compiler automatically translates serial portions of the input program into equivalent multithreaded code....Auto-vectorization detects low-level operations in the program that can be done in parallel, and then converts the sequential program to process 2, 4, 8 or up to 16 elements in one operation, depending on the data type. In some cases auto-parallelization and vectorization can be combined for better performance results. Visual Studio supports neither auto-parallelization nor auto-vectorization.
Last edited by renorm on October 6th, 2010, 10:00 pm, edited 1 time in total.
 
User avatar
AVt
Posts: 1074
Joined: December 29th, 2001, 8:23 pm

Optimized math functions

October 7th, 2010, 9:15 am

@renorm: code ... may be in the evening, if really needed.However (and ignoring that division is too expensive) this is just toreplace the computation of y in exp_ps, sse_mathfun.h, line 301 - 316,(which is the mentioned polynom in Horner form given by Moshier) bythe above rationals y = (x+x)/...Leaving off the reduction is line 296 - 299: C0+C1 = ln(2), so thatmeans x = x - tmp - z = x - fx*ln(2) in 1 step (but with some error now),for which y = exp(x) is computed in line 301 ff.Not sure, whether exp(x)*2^fx = ldexp(...) in line 319 - 338 can beimproved, that would need experience in SSE.BTW: recipes like cephes can be found in Luke.
 
User avatar
renorm
Topic Author
Posts: 886
Joined: February 11th, 2010, 10:20 pm

Optimized math functions

October 7th, 2010, 10:30 am

Which Luke? A guy from Star Wars?
 
User avatar
AVt
Posts: 1074
Joined: December 29th, 2001, 8:23 pm

Optimized math functions

October 7th, 2010, 10:52 am

almost, somewhat before Star Wars Yudell Luke
 
User avatar
renorm
Topic Author
Posts: 886
Joined: February 11th, 2010, 10:20 pm

Optimized math functions

October 8th, 2010, 6:31 am

How about inverse of normal cumulative? High precision approximations designed for doubles don't work well with floats.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On