def _weightFun(x):
    exp_x = math.exp(x)

    if abs(x) < 1.0e-5:
        # taylor expand (exp(x) - 1) / (2x) near the origin
        return (exp_x + 1.0) / (0.5 - 0.25 * x)

    return (exp_x - 1.0) / (exp_x + 1.0) / (2.0 * x)
dataset/ETHPy150Open ufora/ufora/packages/python/pyfora/algorithms/logistic/FullRankMajorizationSolver.py/_weightFun/swapped operands of `/`