Elementary Functions: Algorithms and Implementation