But in a computer programming language, the range of the sqrt and asin functions should be defined such that there is only 1 correct answer for each possible input. Programming is hard enough as it is; any surprises that can be removed should be removed.

]]>(sqrt 1)^3 can be 1 or -1. and both are ok answers.

Maybe a best test is something like ( asin(sin(asin x)) == asin x )

]]>http://pubs.opengroup.org/onlinepubs/009695399/functions/csqrt.html

]]>2) Let’s just follow Common Lisp. They’ve got the experience, and they’ve already written the definitions. Just make sure we get the current definitions. (I’m not a Lisp expert, so I’m not sure if the link you mention is up-to-date.)

Here’s another link to look at:

http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_asincm_acoscm_atan.html

]]>