Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged


Im going to hazard a guess that your problem is u**(N-i). Large exponents are notoriously poor performers, I would first look to restructure that aspect of the code and then isolate other poorly performant sections afterwards. For example you might observe that: S_T[i] = S0 * u**(N-i) * d**(i) is equivalent to: S_T[i] = S0 * u**N * (d/u)**i then u**N ...

Top 50 recent answers are included