So I want to define a new function, probit, from functions that I use in the SpecialFunctions toolbox. i.e. the function itself is a variant of a function found in this toolbox.
Right now I have the following
function probit(t)
using SpecialFunctions
return 0.5*(1+erf(t/sqrt(2)))
end
However I figure that having to load the SpecialFunctions package every time this function is called may not be the most efficient way of doing things. Is there some way to import just the erf function and therefore save some time?
Alternately could I just make it so that this function returns an error if the SpecialFunctions package has not been loaded somehow?
Thanks
EDIT: Actually when I run the above I get an error: “syntax: “using” expression not at top level”
so should I just keep this at the top of my function definition file?