"Tom" <lackey@ltu.edu> writes:
> Description: user function call unexpected "input out of range"
Why does this surprise you? Floating point computation is inherently
inexact, so coming out with a value fractionally greater than 1 for
the acos() argument doesn't seem all that unlikely. You probably
ought to add some code to clamp the result to the legal range.
regards, tom lane