Original link: Writing generic code in C / hristo blog.
I had never heard about _Generic or tgmath.h before.
For more info on tgmath.h see here.