static float calculate ( float lower_limit , float upper_limit , int interval_limit ) {
  float value ;
  float interval_size = ( upper_limit - lower_limit ) / interval_limit ;
  float sum = func ( lower_limit ) + func ( upper_limit ) ;
  for ( int i = 1 ;
  i < interval_limit ;
  i ++ ) {
    if ( i % 3 == 0 ) sum = sum + 2 * func ( lower_limit + i * interval_size ) ;
    else sum = sum + 3 * func ( lower_limit + i * interval_size ) ;
  }
  return ( 3 * interval_size / 8 ) * sum ;
}

static float calculate ( float lower_limit , float upper_limit , int interval_limit ) { float value ; float interval_size = ( upper_limit - lower_limit ) / interval_limit ; float sum = func ( lower_limit ) + func ( upper_limit ) ; for ( int i = 1 ; i < interval_limit ; i ++ ) { if ( i % 3 == 0 ) sum = sum + 2 * func ( lower_limit + i * interval_size ) ; else sum = sum + 3 * func ( lower_limit + i * interval_size ) ; } return ( 3 * interval_size / 8 ) * sum ; }
(method_declaration (modifiers) type: (floating_point_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (floating_point_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))))))) alternative: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))))))))) (return_statement (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))) right: (identifier)))))