def flat_speed(power):
    """Converts power to flat-ground running speed.

  This function is simply an inversion of the speed-power function.

  Args:
    power: A float or array of floats representing running power,
           in Watts/kg.

  TODO: Find a pythonic way to invert the flat_run_power equation.
  """
    value = (25 * power ** 2 + 8640) ** 0.5 + 5 * power
    return (5 ** (1 / 3) * value ** (2 / 3) - 12 * 5 ** (2 / 3)) / value ** (
        1 / 3)
