def _sabr_implied_vol_hagan_A4_fprime_by_strike(
        underlying, strike, maturity, alpha, beta, rho, nu):
    """_sabr_implied_vol_hagan_A4_fprime_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_half = (3.0 - beta) / 2.0

    numerator1 = one_minus_beta2 * (alpha ** 2) * (strike ** (-two_minus_beta))
    denominator1 = 24.0 * (underlying ** one_minus_beta)
    term1 = numerator1 / denominator1

    numerator2 = rho * beta * nu * alpha * (strike ** (-three_minus_beta_half))
    denominator2 = 8.0 * (underlying ** one_minus_beta_half)
    term2 = numerator2 / denominator2

    return -(term1 + term2) * maturity * one_minus_beta