CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2000
    Location
    Germany
    Posts
    369

    fast arithmetic operations

    Hello!
    I am going to write a programm that needs to be very fast. I am using many arithmetic operations so i am looking for the fastest way of calculating and best way of transforming my formulars. In addition to that i have an exponential function integrated. I want to know which operations are fast and if they aren´t fast - what´s the best way to transform them?

    Thanks in advance....

  2. #2
    Join Date
    Jan 2001
    Posts
    588
    You're going to need to be more specific than that. Is the exponential that you need to integrate one with an analytic solution? In this case, you could store the formula that the integral evaluates to and just compute it for specific values. Is it an integral that you need to evaluate numerically? You might have to try to come up with your own integration rule if you're all about speed, possibly a Gauss rule. Or, if accuracy isn't too important, you could just create a lookup table, for even faster access to your data. Your particular application dictates what you're going to want to do. If you need info on numerical computations, I suggest you consult the Numerical Recipes books, as they have more mathematical gobbledegook than you'll ever want. Good luck!

  3. #3
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    KK,

    I think that Gauss-Legendre integration or some other integration with weighted special functions will, in general, be faster than any type of extended Simpson's rule.

    Be specific about the problem as Bob said. Once you have an implementation, there are sometimes some really good optimizations which can be done with clever use of constant tabular data and references. Be sure to never initialize constants more than once.

    I found this book very helpful (http://www.amazon.com/exec/obidos/tg...glance&s=books). Although written for the FORTRAN77 language, the techniques are explained in a general fashion.

    Sincerely, Chris.

    You're gonna go blind staring into that box all day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured