def total_absorptivity(absorptivity: float, reflectivity: float) -> float:
  """Compute total internal balloon absorptivity/emissivity factor.

  This function computes total absorptivity or total emissivity. For the
  absorptivity process, the dynamics are as follows:

  --> From the radiation hitting the surface, R is reflected outward, A is
      absorbed, and the rest, T, is "transmitted" through the surface,
      where T = 1 - R - A.
  --> From the amount transmitted through the surface, T, a portion TA is
      absorbed, a portion TR is reflected back into the sphere, and the
      rest (TT) leaves the sphere.
  --> From the amount reflected into the sphere, TR, a portion TRA is
      absorbed, a portion TRR is reflected back into the sphere, and the
      rest (TRT) is lost.
  --> Continuing this process to infinity and adding up all the aborbed
      amounts gives the following:

         A_total = A + TA + TRA + TR^2 A + TR^3 A + ...
                 = A + TA (1 + R + R^2 + R^3 + ...)
                 = A (1 + T / (1 - R))

  Similarly, we can analyze the emissivity process:

  --> From the radiation emitted by the surface, A is emitted outwards where
      E = A = emissivity, and A is emitted inwards (double radiation).
  --> From the inwards amount, AA is re-absorbed, AR is internally reflected
      and AT is emitted through the film.
  --> From the internally reflected amount, ARA is re-absorbed, ARR is
      internally reflected, and ART is emitted through the film.
  --> Continuing this process to infinity and adding up all the outwards
      emissions gives the following:

         E_total = A + AT + ART + AR^2T + AR^3 T + ...
                 = A + AT (1 + R + R^2 + R^3 + ...)
                 = A (1 + T / (1 - R))

  Noting that E_total and A_total are equivalent, we can use this function
  for both incoming and outgoing emissions.

  Args:
    absorptivity: Balloon film's absorptivity/emissivity.
    reflectivity: Balloon film's reflectivity.

  Returns:
    total_absorptivity_factor: Factor of radiation absorbed/emitted by balloon.
  """
  transmisivity = 1.0 - absorptivity - reflectivity
  total_absorptivity_factor = absorptivity * (1.0 + transmisivity /
                                              (1.0 - reflectivity))
  if total_absorptivity_factor < 0.0 or total_absorptivity_factor > 1.0:
    raise ValueError(
        'total_absorptivity: '
        'Computed total absorptivity factor out of expected range [0, 1].')

  return total_absorptivity_factor