@@ -219,8 +219,7 @@ and gen_operator_app = function
219219 fun ppf es ->
220220 pp_scalar_binary ppf " (%a@ /@ %a)" " elt_divide(@,%a,@ %a)" es
221221 | Pow -> fun ppf es -> pp_binary_f ppf " pow" es
222- | EltPow ->
223- fun ppf es -> pp_scalar_binary ppf " (%a@ *@ %a)" " pow(@,%a,@ %a)" es
222+ | EltPow -> fun ppf es -> pp_binary_f ppf " pow" es
224223 | Equals -> fun ppf es -> pp_binary_f ppf " logical_eq" es
225224 | NEquals -> fun ppf es -> pp_binary_f ppf " logical_neq" es
226225 | Less -> fun ppf es -> pp_binary_f ppf " logical_lt" es
@@ -358,11 +357,16 @@ and pp_user_defined_fun ppf (f, es) =
358357and pp_compiler_internal_fn ut f ppf es =
359358 let pp_array_literal ppf es =
360359 let pp_add_method ppf () = pf ppf " )@,.add(" in
361- pf ppf " stan::math::array_builder<%a>()@,.add(%a)@,.array()"
362- pp_unsizedtype_local
363- (promote_adtype es, promote_unsizedtype es)
364- (list ~sep: pp_add_method pp_expr)
365- es
360+ if List. length es = 0 then
361+ pf ppf " stan::math::array_builder<%a>()@,.add(0)@,.array()"
362+ pp_unsizedtype_local
363+ (promote_adtype es, promote_unsizedtype es)
364+ else
365+ pf ppf " stan::math::array_builder<%a>()@,.add(%a)@,.array()"
366+ pp_unsizedtype_local
367+ (promote_adtype es, promote_unsizedtype es)
368+ (list ~sep: pp_add_method pp_expr)
369+ es
366370 in
367371 match Internal_fun. of_string_opt f with
368372 | Some FnMakeArray -> pp_array_literal ppf es
0 commit comments