def scale_gradient(self, val):
        if self.min in (None, -inf) and self.max in (None, inf):
            return 1.0
        elif self.max in (None, inf):
            return val / sqrt(val*val + 1)
        elif self.min in (None, -inf):
            return -val / sqrt(val*val + 1)
        else:
            return cos(val) * (self.max - self.min) / 2.0
Return a dictionary containing pairs :math:`{(k1,k2) : C_kn}` where
dataset/ETHPy150Open xraypy/xraylarch/lib/fitting/parameter.py/Parameter.scale_gradient--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/ntheory/multinomial.py/binomial_coefficients