source code for sin() in FORTRAN

fortran, function, implementation, trigonometry

Solution

You can make an `elemental` function

Problem

I want to know how the build-in function sin() is implemented in FORTRAN, because I try to write functions that can receive both scalars and array as its input variable, the effect of which can be found in sin(), that sin(0) returns 0 and sin(a), where array a=(/0,3.14...), returns an array (0,0). I hope all mathematical functions I am gonna write can have this kind of flexibility and advantage. Someone could do me a favor?

Original source