4.14 find all functions except builtin math functions

Given expression \(3 \sin \left (x \right )+t +3 f \left (x , t\right ) t +g \left (x , t\right )\) find all functions, if any, in the expression but exclude the math functions such as \(\sin \) in the above.

restart; 
expr := 3*sin(x)+t+3*f(x,t)*t+g(x,t); 
res  := indets(expr, And( function, Not(typefunc(mathfunc)))); 
if numelems(res)<>0 then 
   print("Found these functions",res); 
else 
   print("could not find any function)"); 
fi;
 

"Found these functions", f(x, t), g(x, t)