def negative_rescaled_hartmann6d_15(dtype=tf.float64):
    xdim = 1
    zdim = 5
    input_dim = (xdim + zdim)
    xmin = 0.0
    xmax = 1.0
    zmin = 0.0
    zmax = 1.0
    xs = get_meshgrid(xmin, xmax, 50, xdim)
    A = np.array([[10.0, 3.0, 17.0, 3.5, 1.7, 8.0], [0.05, 10.0, 17.0, 0.1, 8.0, 14.0], [3.0, 3.5, 1.7, 10.0, 17.0, 8.0], [17.0, 8.0, 0.05, 10.0, 0.1, 14.0]])
    A_tf = tf.constant(A, dtype=dtype)
    alpha = np.array([1.0, 1.2, 3.0, 3.2])
    alpha_tf = tf.constant(alpha, dtype=dtype)
    P = (0.0001 * np.array([[1312.0, 1696.0, 5569.0, 124.0, 8283.0, 5886.0], [2329.0, 4135.0, 8307.0, 3736.0, 1004.0, 9991.0], [2348.0, 1451.0, 3522.0, 2883.0, 3047.0, 6650.0], [4047.0, 8828.0, 8732.0, 5743.0, 1091.0, 381.0]]))
    P_tf = tf.constant(P, dtype=dtype)

    def f(x):
        x = np.tile(x.reshape((- 1), 1, input_dim), reps=(1, 4, 1))
        val = ((2.58 + np.sum((alpha * np.exp((- np.sum((A * ((x - P) ** 2)), axis=2)))), axis=1)) / 1.94)
        return (val * 10.0)

    def f_tf(x):
        x = tf.tile(tf.reshape(x, shape=((- 1), 1, input_dim)), multiples=(1, 4, 1))
        val = ((tf.constant(2.58, dtype) + tf.reduce_sum((alpha_tf * tf.exp((- tf.reduce_sum(((A_tf * (x - P_tf)) * (x - P_tf)), axis=2)))), axis=1)) / tf.constant(1.94, dtype))
        return (val * tf.cast(10.0, dtype))
    mean_tnorm = ((zmin + zmax) / 2.0)
    std_tnorm = ((zmax - zmin) / 8.0)
    low_tnorm = (mean_tnorm - (2.0 * std_tnorm))
    high_tnorm = (mean_tnorm + (2.0 * std_tnorm))
    truncated_normal = tfp.distributions.TruncatedNormal(loc=tf.cast(mean_tnorm, dtype=tf.float64), scale=tf.cast(std_tnorm, dtype=tf.float64), low=tf.cast(low_tnorm, dtype=tf.float64), high=tf.cast(high_tnorm, dtype=tf.float64), name='branin_truncated_normal')

    def z_tnorm_generator(n):
        return truncated_normal.sample(sample_shape=(n, zdim))

    def z_lpdf(z):
        return tf.reduce_sum(truncated_normal.log_prob(z), axis=1)
    zmid = ((zmin + zmax) / 2.0)
    z_values = get_meshgrid((zmid - 0.2), (zmid + 0.2), 3, zdim)
    z_lprobs = ((- np.sum(((z_values - (np.ones(zdim) * zmid)) ** 2), axis=1)) / (0.2 ** 2))
    z_lprobs = np.squeeze((z_lprobs - scsp.logsumexp(z_lprobs)))
    z_probs = np.exp(z_lprobs)
    return {'function': f, 'function_tf': f_tf, 'name': 'negative_rescaled_hartmann6d_15', 'xdim': xdim, 'zdim': zdim, 'xmin': xmin, 'xmax': xmax, 'zmin': zmin, 'zmax': zmax, 'z_generator': z_tnorm_generator, 'z_lpdf': z_lpdf, 'zvalues': z_values, 'zlprobs': z_lprobs, 'zprobs': z_probs, 'lengthscale': np.array([6.9512, 1.9341, 0.506, 4.2067, 5.0986, 3.5949]), 'signal_variance': 1.423, 'likelihood_variance': 0.0001, 'rand_opt_init_x': xs, 'max_cvar_discrete': 14.1203}
def negative_rescaled_hartmann6d_15(dtype=tf.float64):
    xdim = 1
    zdim = 5
    input_dim = (xdim + zdim)
    xmin = 0.0
    xmax = 1.0
    zmin = 0.0
    zmax = 1.0
    xs = get_meshgrid(xmin, xmax, 50, xdim)
    A = np.array([[10.0, 3.0, 17.0, 3.5, 1.7, 8.0], [0.05, 10.0, 17.0, 0.1, 8.0, 14.0], [3.0, 3.5, 1.7, 10.0, 17.0, 8.0], [17.0, 8.0, 0.05, 10.0, 0.1, 14.0]])
    A_tf = tf.constant(A, dtype=dtype)
    alpha = np.array([1.0, 1.2, 3.0, 3.2])
    alpha_tf = tf.constant(alpha, dtype=dtype)
    P = (0.0001 * np.array([[1312.0, 1696.0, 5569.0, 124.0, 8283.0, 5886.0], [2329.0, 4135.0, 8307.0, 3736.0, 1004.0, 9991.0], [2348.0, 1451.0, 3522.0, 2883.0, 3047.0, 6650.0], [4047.0, 8828.0, 8732.0, 5743.0, 1091.0, 381.0]]))
    P_tf = tf.constant(P, dtype=dtype)

    def f(x):
        x = np.tile(x.reshape((- 1), 1, input_dim), reps=(1, 4, 1))
        val = ((2.58 + np.sum((alpha * np.exp((- np.sum((A * ((x - P) ** 2)), axis=2)))), axis=1)) / 1.94)
        return (val * 10.0)

    def f_tf(x):
        x = tf.tile(tf.reshape(x, shape=((- 1), 1, input_dim)), multiples=(1, 4, 1))
        val = ((tf.constant(2.58, dtype) + tf.reduce_sum((alpha_tf * tf.exp((- tf.reduce_sum(((A_tf * (x - P_tf)) * (x - P_tf)), axis=2)))), axis=1)) / tf.constant(1.94, dtype))
        return (val * tf.cast(10.0, dtype))
    mean_tnorm = ((zmin + zmax) / 2.0)
    std_tnorm = ((zmax - zmin) / 8.0)
    low_tnorm = (mean_tnorm - (2.0 * std_tnorm))
    high_tnorm = (mean_tnorm + (2.0 * std_tnorm))
    truncated_normal = tfp.distributions.TruncatedNormal(loc=tf.cast(mean_tnorm, dtype=tf.float64), scale=tf.cast(std_tnorm, dtype=tf.float64), low=tf.cast(low_tnorm, dtype=tf.float64), high=tf.cast(high_tnorm, dtype=tf.float64), name='branin_truncated_normal')

    def z_tnorm_generator(n):
        return truncated_normal.sample(sample_shape=(n, zdim))

    def z_lpdf(z):
        return tf.reduce_sum(truncated_normal.log_prob(z), axis=1)
    zmid = ((zmin + zmax) / 2.0)
    z_values = get_meshgrid((zmid - 0.2), (zmid + 0.2), 3, zdim)
    z_lprobs = ((- np.sum(((z_values - (np.ones(zdim) * zmid)) ** 2), axis=1)) / (0.2 ** 2))
    z_lprobs = np.squeeze((z_lprobs - scsp.logsumexp(z_lprobs)))
    z_probs = np.exp(z_lprobs)
    return {'function': f, 'function_tf': f_tf, 'name': 'negative_rescaled_hartmann6d_15', 'xdim': xdim, 'zdim': zdim, 'xmin': xmin, 'xmax': xmax, 'zmin': zmin, 'zmax': zmax, 'z_generator': z_tnorm_generator, 'z_lpdf': z_lpdf, 'zvalues': z_values, 'zlprobs': z_lprobs, 'zprobs': z_probs, 'lengthscale': np.array([6.9512, 1.9341, 0.506, 4.2067, 5.0986, 3.5949]), 'signal_variance': 1.423, 'likelihood_variance': 0.0001, 'rand_opt_init_x': xs, 'max_cvar_discrete': 14.1203}