The functions erf, erfc are part of the C++11 standard. They are already implemented in <math.h> and available in the global namespace after #including it. However, they are missing from <cmath>.
Apparently, when compiled with --std=c++11, the erf(c) functions are correctly placed in the std:: namespace. Otherwise, they're in the global namespace (this is math.h's behavior).
Then what? This is expected and conforming.
(In reply to comment #2) > Then what? This is expected and conforming. Oh, it just struck me as funny that cmath imports std::exp and friends, but not std::erf. I filed the bug since apparently not only I was confused (cf. http://gcc.gnu.org/ml/gcc-help/2012-12/msg00043.html). Anyhow. I suppose libstdc++ is consistent in that cmath doesn't provide more than what is in the standard.
(In reply to comment #3) > Oh, it just struck me as funny that cmath imports std::exp and friends, but not > std::erf. std::exp is in C++98, std::erf isn't. As I said on the list, I assumed you were using -std=c++11 when you said it wasn't in <cmath>
Bottom line: problem solved. I just compile my code with -std=c++11 and get std::erf immediately. Thanks for the clarification!