Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Arbitrary and infinite precision math libraries

Options
  • 23-08-2004 11:16pm
    #1
    Closed Accounts Posts: 1,575 ✭✭✭


    OK. This is really a computing AND mathematics question so apologies if this isn't the right forum.

    I'm looking to write some code where I'm looking for accuracy. Did a quick trawl on google and found a bewildering array of options - none for what I'm exactly looking for.

    A free math lib for Visual C++. Or one I have to pay for in same language - depends on price. I would hate to have to code in scheme again tbh.

    Anyone got helpful ideas/experience on this?


Comments

  • Registered Users Posts: 196 ✭✭charlieroot


    I've used both MIRACL http://indigo.ie/~mscott/ and GMP http://www.swox.com/gmp/. Both have there advantages - what specifically are you trying to do? Pari is also quite good http://pari.math.u-bordeaux.fr/.


    Noel.
    OK. This is really a computing AND mathematics question so apologies if this isn't the right forum.

    I'm looking to write some code where I'm looking for accuracy. Did a quick trawl on google and found a bewildering array of options - none for what I'm exactly looking for.

    A free math lib for Visual C++. Or one I have to pay for in same language - depends on price. I would hate to have to code in scheme again tbh.

    Anyone got helpful ideas/experience on this?


  • Closed Accounts Posts: 1,575 ✭✭✭elivsvonchiaing


    I've used both MIRACL http://indigo.ie/~mscott/ and GMP http://www.swox.com/gmp/. Both have there advantages - what specifically are you trying to do? Pari is also quite good http://pari.math.u-bordeaux.fr/.

    Noel.
    Just took a quick look at your first link. Seems the flash data type could be just what I'm looking for.

    Just to implement some differential equations: I worked some years ago on Black-Scholes API - the guy who wrote it was on holiday and I was roped in to do a quick fix on it. It made me appreciate how easy it is screw up something that first appears simple... it put me using standard floating point types for just about anything serious - for life. Respected the guy wrote it though, afterwards.

    Cheers. Thanks a lot for that.


  • Registered Users Posts: 196 ✭✭charlieroot


    I hope you're not actually using the B-S model for investing anything?

    Noel.


  • Closed Accounts Posts: 1,575 ✭✭✭elivsvonchiaing


    I hope you're not actually using the B-S model for investing anything?

    Noel.
    God no! I'm not a big fish - can't think of any individual who would use it - maybe George Sauros?


  • Registered Users Posts: 196 ✭✭charlieroot


    Just wondering, was it them who won some big prize with the model - tried to use the money they won ( 1m$ ) to invest using the model and lost it all?

    Noel.


  • Advertisement
  • Registered Users Posts: 1,372 ✭✭✭silverside


    "Big prize" - I suppose you could call the Nobel prize big. :)

    Scholes and Merton (Black died in 1995) did invest money in LTCM, which eventually blew up and had to be bailed out by the rest of the financial community to avoid the whole system collapsing.

    It wasn't as simple as their model failing - they were doing some good trades, but they tried to get a bit too big, and got squeezed by the big guys who saw them coming.

    Read "When Genius Failed" for the full story.

    For the original poster: I usually use "Numerical Recipes" to see what is a good method to use, then either use the code provided or look for a better implementation with Google. I'm more of an engineer than a pure mathematician though - not trying to do the same things as you by the sounds of it.

    (I can't see how double-precision (or even long-double ) wouldn't be enough - can't you just take another few terms in a Taylor expansion if you need to?

    What exactly do you mean by 'accuracy' and what are you trying to do?


  • Closed Accounts Posts: 1,575 ✭✭✭elivsvonchiaing


    silverside wrote:
    "Big prize" - I suppose you could call the Nobel prize big. :)

    Scholes and Merton (Black died in 1995) did invest money in LTCM, which eventually blew up and had to be bailed out by the rest of the financial community to avoid the whole system collapsing.

    It wasn't as simple as their model failing - they were doing some good trades, but they tried to get a bit too big, and got squeezed by the big guys who saw them coming.

    Read "When Genius Failed" for the full story.

    For the original poster: I usually use "Numerical Recipes" to see what is a good method to use, then either use the code provided or look for a better implementation with Google. I'm more of an engineer than a pure mathematician though - not trying to do the same things as you by the sounds of it.

    (I can't see how double-precision (or even long-double ) wouldn't be enough - can't you just take another few terms in a Taylor expansion if you need to?

    What exactly do you mean by 'accuracy' and what are you trying to do?
    Seem to remember there was a Japanese Nick Leeson in roughly 1996 - lost the proverbial shirt on copper futures I think. Often wondered did he dabble with B-S and get the parameters wrong or something.

    Accuracy: just saw the limitations of floating point when I had to mess with B-S model implementing code.

    What I'm mainly trying to do is get back in the groove with the math I know and mainly forgotten. I you don't use it you lose it. Never really understood this in early 20's believe you me its scarily true.


Advertisement