Delta Calculation using BlackScholesFormulaRepository in Price module incorrect output

Hi,

I need to calculate delta from the given parameters, but apparently the formula is incorrect.
Here’s the link to the formula:


In the method, d1 does not seem to include rate at BlackScholesFormulaRepository:200
d1 = Math.log(spot / strike) / sigmaRootT + scnd + 0.5 * sigmaRootT;

Here’s a slight modification which is giving me the correct output:
d1 = (Math.log(spot / strike) + interestRate * timeToExpiry)/ sigmaRootT + scnd + 0.5 * sigmaRootT;

Please let me know if this is correct or if this has some other interpretation

Regards

Cost of carry b is related to interest rate r and dividend q by

b = r - q

Plugging this into the formula in BlackScholesFormulaRepository and setting dividend zero, then you will get the expression you want.