import tensorflow as tf

def _spherical_harmonics_normalization(l, m, var_type=tf.float64):
  l = tf.cast(l, dtype=var_type)
  m = tf.cast(m, dtype=var_type)
  numerator = (2.0 * l + 1.0) * factorial(l - tf.abs(m))
  denominator = 4.0 * np.pi * factorial(l + tf.abs(m))
  return tf.sqrt(numerator / denominator)
