<commit_before>from math import exp, log, sqrt
from random import normalvariate, lognormvariate, seed

def simpleMC8(option, spot, vol, r, N, gatherer, randomGen):
    randomGen.dim = 1
    expiry = option.expiry()
    var = vol.integralSq(0,expiry)
    rootVar = sqrt(var)
    itoCorrection = -0.5 * var

    movedSpot = spot * exp(r.integral(0,expiry) + itoCorrection)
    discounting = exp(-r.integral(0,expiry))
    
    gaussians = randomGen.getGaussians(N)
    spots = (movedSpot * exp(rootVar) * list(v)[0] for v in gaussians)
    payoffs = (option.payoff(s) for s in spots)
    for p in payoffs:
        gatherer.addOneResult(discounting * p)

    return
<commit_msg>corrected mistake in simpleMC.py (misplaced parentheses)<commit_after>from math import exp, log, sqrt
from random import normalvariate, lognormvariate, seed

def simpleMC8(option, spot, vol, r, N, gatherer, randomGen):
    randomGen.dim = 1
    expiry = option.expiry()
    var = vol.integralSq(0,expiry)
    rootVar = sqrt(var)
    itoCorrection = -0.5 * var

    movedSpot = spot * exp(r.integral(0,expiry) + itoCorrection)
    discounting = exp(-r.integral(0,expiry))
    
    gaussians = randomGen.getGaussians(N)
    spots = (movedSpot * exp(rootVar * list(v)[0]) for v in gaussians)
    payoffs = (option.payoff(s) for s in spots)
    for p in payoffs:
        gatherer.addOneResult(discounting * p)

    return

{'fraction_non_alphanumeric': 0.11270638908829864, 'fraction_numerical': 0.01148600143575018, 'mean_word_length': 3.511326860841424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1112774', 'n_tokens_mistral': 525, 'n_tokens_neox': 499, 'n_words': 125}