pazzo83 / QuantLib.jl

Quantlib implementation in pure Julia
Other
137 stars 42 forks source link

Use expm1 #2

Closed mschauer closed 8 years ago

mschauer commented 8 years ago

Just because my eye fell on it, julia has expm1(x) which is numerically stable for exp(x)-1 as for example in the Ornstein-Uhlenbeck code, (1.0 - exp(-2.0 * process.speed * dt))

pazzo83 commented 8 years ago

Thanks! I wasn't aware of that method in Base, but I will go through and see where I can use it to replace existing code.

pazzo83 commented 8 years ago

I think I've resolved all the instances where expm1 can be used, if any more are found, please reopen!

https://github.com/pazzo83/QuantLib.jl/commit/89a1413f1e7212eabfc77fd88d182e7eacb5dcbc