def _sabr_implied_vol_hagan_A4_fhess_by_strike(underlying, strike, maturity,
    alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A4_fhess_by_strike
    See :py:func:`_sabr_implied_vol_hagan_A4`.

    :param float underlying:
    :param float strike:
    :param float maturity:
    :param float alpha: must be within [0, 1].
    :param float beta: must be greater than 0.
    :param float rho: must be within [-1, 1].
    :param float nu: volatility of volatility. This must be positive.

    :return: value of factor.
    :rtype: float.
    """
    one_minus_beta = 1.0 - beta
    one_minus_beta_half = one_minus_beta / 2.0
    one_minus_beta2 = one_minus_beta ** 2
    two_minus_beta = 2.0 - beta
    three_minus_beta = 3.0 - beta
    five_minus_beta_half = (5.0 - beta) / 2.0
    factor1 = strike ** -three_minus_beta
    numerator1 = one_minus_beta2 * alpha ** 2 * -two_minus_beta
    denominator1 = 24.0 * underlying ** one_minus_beta
    term1 = numerator1 * factor1 / denominator1
    factor2 = strike ** -five_minus_beta_half
    numerator2 = rho * beta * nu * alpha * -three_minus_beta
    denominator2 = 16.0 * underlying ** one_minus_beta_half
    term2 = numerator2 * factor2 / denominator2
    return -(term1 + term2) * maturity * one_minus_beta
