import math


def calculate_probability(x, mean, stdev) -> float:
    """
    Calculate the Gaussian probability distribution function for x from inputs:
    
    x: the variable we are calculating the probability for
    mean: the mean of the distribution
    stdev: the standard deviation of the distribution (sigma before squaring)

    It returns the Gaussian probability of a given value based on:
    f(x) = (1 / sqrt(2 * PI) * sigma) * exp(-((x-mean)^2 / (2 * sigma^2)))

    """

    if (mean or stdev) == float(0.0):
        probability = float(0.0)
    else:
        probability = (1 / (math.sqrt(2 * math.pi) * stdev)) * (math.exp(-((x-mean)**2 / (2 * stdev**2 ))))

    return probability