#NEWLINE# @ autojit #NEWLINE# def black_scholes_numba( callResult , putResult , stockPrice , optionStrike , optionYears , Riskfree , Volatility ) : #NEWLINE# #INDENT# S = stockPrice #NEWLINE# X = optionStrike #NEWLINE# T = optionYears #NEWLINE# R = Riskfree #NEWLINE# V = Volatility #NEWLINE# for i in range ( len ( S ) ) : #NEWLINE# #INDENT# sqrtT = math . sqrt ( T [ i ] ) #NEWLINE# d1 = ( ( math . log ( ( S [ i ] / X [ i ] ) ) + ( ( R + ( ( 0.5 * V ) * V ) ) * T [ i ] ) ) / ( V * sqrtT ) ) #NEWLINE# d2 = ( d1 - ( V * sqrtT ) ) #NEWLINE# cndd1 = cnd_numba ( d1 ) #NEWLINE# cndd2 = cnd_numba ( d2 ) #NEWLINE# expRT = math . exp ( ( ( ( - 1.0 ) * R ) * T [ i ] ) ) #NEWLINE# callResult [ i ] = ( ( S [ i ] * cndd1 ) - ( ( X [ i ] * expRT ) * cndd2 ) ) #NEWLINE# putResult [ i ] = ( ( ( X [ i ] * expRT ) * ( 1.0 - cndd2 ) ) - ( S [ i ] * ( 1.0 - cndd1 ) ) )