code: import numpy as np
  import tensorflow as tf 
  
  def density_1(z):
  	z1, z2 = tf.split(z, [1,1], axis=1) 
  	norm = tf.sqrt(z1 ** 2 + z2 ** 2)
  	exp1 = tf.exp(-0.5 * ((z1 - 2) / 0.8) ** 2)
  	exp2 = tf.exp(-0.5 * ((z1 + 2) / 0.8) ** 2)
  	u = 0.5 * ((norm - 4) / 0.4) ** 2 - tf.log(exp1 + exp2)
  	return tf.exp(-u)
  
  def density_2(z):
  	z1, z2 = tf.split(z, [1,1], axis=1) 
  	norm = tf.sqrt(z1 ** 2 + z2 ** 2)
  	exp1 = tf.exp(-0.5 * ((z1 - 2) / 0.8) ** 2)
  	exp2 = tf.exp(-0.5 * ((z1 + 2) / 0.8) ** 2)
  	u = 0.5 * ((norm - 2) / 0.4) ** 2 - tf.log(exp1 + exp2)
  	return tf.exp(-u)
  
apis: tensorflow.log tensorflow.split tensorflow.exp tensorflow.sqrt
api_extract: [(5, 'tensorflow.split', 'tf.split', (['z', '[1, 1]'], {'axis': '(1)'}), True, 'import tensorflow as tf\n'), (6, 'tensorflow.sqrt', 'tf.sqrt', (['(z1 ** 2 + z2 ** 2)'], {}), True, 'import tensorflow as tf\n'), (7, 'tensorflow.exp', 'tf.exp', (['(-0.5 * ((z1 - 2) / 0.8) ** 2)'], {}), True, 'import tensorflow as tf\n'), (8, 'tensorflow.exp', 'tf.exp', (['(-0.5 * ((z1 + 2) / 0.8) ** 2)'], {}), True, 'import tensorflow as tf\n'), (10, 'tensorflow.exp', 'tf.exp', (['(-u)'], {}), True, 'import tensorflow as tf\n'), (13, 'tensorflow.split', 'tf.split', (['z', '[1, 1]'], {'axis': '(1)'}), True, 'import tensorflow as tf\n'), (14, 'tensorflow.sqrt', 'tf.sqrt', (['(z1 ** 2 + z2 ** 2)'], {}), True, 'import tensorflow as tf\n'), (15, 'tensorflow.exp', 'tf.exp', (['(-0.5 * ((z1 - 2) / 0.8) ** 2)'], {}), True, 'import tensorflow as tf\n'), (16, 'tensorflow.exp', 'tf.exp', (['(-0.5 * ((z1 + 2) / 0.8) ** 2)'], {}), True, 'import tensorflow as tf\n'), (18, 'tensorflow.exp', 'tf.exp', (['(-u)'], {}), True, 'import tensorflow as tf\n'), (9, 'tensorflow.log', 'tf.log', (['(exp1 + exp2)'], {}), True, 'import tensorflow as tf\n'), (17, 'tensorflow.log', 'tf.log', (['(exp1 + exp2)'], {}), True, 'import tensorflow as tf\n')]