Boris Herman wrote:
If there's interest, I could add ArcSin and ArcCos to the runtime library. This would be great!
I've found out that I get more precision by using this self-written function:
function ArcSin(x:double):double; const c1=1e-6; begin if abs(x-1)<c1 then ArcSin:=pi/2 else if abs(1+x)<c1 then ArcSin:=-pi/2 else ArcSin:=ArcTan(x/sqrt(1-sqr(x))); end;
I hope Emil will comment on the numeric stability of this function etc. I'm a bit worried about the c1 definition. It might be suitable for the Double type on your platform, but I think a general function should try to work with MinReal, EpsReal etc. If this is worked out, I could include such a function (and a corresponding ArcCos). Otherwise, I can still refer to the libm functions ... Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707