     {
         const size_t num_out_neurons_current_layer = fp->layers[k]->num_out_neurons;
         const size_t num_in_neurons_current_layer  = fp->layers[k]->num_in_neurons;
+        std::cout << "num_out_neurons_current " << num_out_neurons_current_layer << " num_in_neurons_current " << num_in_neurons_current_layer << std::endl;
 
         const size_t num_threads = 512;
 

    cudaMemcpy(sup_coeff_tmp, src->sup_coeff, src->size*sizeof(double), cudaMemcpyHostToDevice);

    create_dense_expr_device<<<1, 1>>>(expr_array, index, inf_coeff_tmp, sup_coeff_tmp, src->inf_cst, src->sup_cst, src->size, src->type);
}



}


__global__
void create_sub_expr(expr_t** sub, const elina_dim_t y, const elina_dim_t x)
{

    expr_t* expr = (expr_t*) malloc(sizeof(expr_t));

    expr->inf_cst = 0;
    expr->sup_cst = 0;

    expr->inf_coeff = (double*) malloc(10*sizeof(double));
    expr->sup_coeff = (double*) malloc(10*sizeof(double));
    expr->dim = nullptr;

    expr->size = 10;
    expr->type = DENSE;

    for(size_t i = 0; i < 10; i++)
    {
        expr->inf_coeff[i] = 0.;
        expr->sup_coeff[i] = 0.;
    }

    expr->inf_coeff[y] = -1.;
    expr->sup_coeff[y] = 1.;

    expr->inf_coeff[x] = 1.;
    expr->sup_coeff[x] = -1.;

    *sub = expr;
}


double get_lb_using_previous_layers(elina_manager_t* man, const fppoly_t* const fp, const elina_dim_t y, const elina_dim_t x)
{
    const size_t numlayers = fp->numlayers;
    fppoly_internal_t* pr = fppoly_init_from_manager(man, ELINA_FUNID_ASSIGN_LINEXPR_ARRAY);

    double* lb_dev;
    cudaMalloc((void**) &lb_dev, sizeof(double));

    expr_t** lexpr_array;
    cudaMalloc((void**) &lexpr_array, sizeof(expr_t*));

    create_sub_expr<<<1, 1>>>(lexpr_array, y, x);

    expr_t** lexpr_array_tmp;
    cudaMalloc((void**) &lexpr_array_tmp, sizeof(expr_t*));

    for(int k = numlayers - 1; k >= 0; k--)
    {
        const size_t num_out_neurons_current_layer = fp->layers[k]->num_out_neurons;
        const size_t num_in_neurons_current_layer  = fp->layers[k]->num_in_neurons;

        const size_t num_threads = 512;

        const dim3 num_blocks_relu(1, num_out_neurons_current_layer/512 + 1, 1);
        const dim3 num_blocks_linear(1, num_in_neurons_current_layer/512 + 1, 1);

        expr_t** aux_expr_array = fp->layers[k]->expr_array;
        expr_t** aux_maxpool_lexpr_array = fp->layers[k]->maxpool_lexpr_array;
        expr_t** aux_maxpool_uexpr_array = fp->layers[k]->maxpool_uexpr_array;
