Take a look at your int foo() snippet. You have to remember, this string is the whole compilation unit, just as if you saved it into a C file. Within this compilation unit, get_int() and get_double() are actually undefined. The int version works due to luck, since all undeclared variables and functions have type of int. And this is also the reason why get_double does not work, because the same rule presumes it is in int function.
Solution is simple. Just declare your functions in your script. Use a header file or something like:
char my_program[] =
"double get_double();\n"
"int get_int();\n"
"int foo()\n"
"{\n"
" printf(\"Hello World!\\n\");\n"
" printf(\"double: %.4f\\n\", get_double()); \n"
" printf(\"int: %d\\n\", get_int()); \n"
" return 0;\n"
"}\n";
I strongly suggest you use tcc_set_error_func() to capture any warnings and errors.