# arcsin() return value with tiny imaginary part ?

Hi

where does this imaginary small quantity come from ?

SageMath notebook 9.1 W10

show(arcsin(sqrt(2)*sqrt(1/2)).n())

show(arcsin(sqrt(2)*sqrt(2^(-1))).n())

show(arcsin(sqrt(2)/sqrt(2)).n(),"\t ok no small imaginary part")

edit retag close merge delete

Sort by ยป oldest newest most voted

It comes from machine precision. sqrt(2)*sqrt(1/2) is slightly bigger than one. In fact sqrt(2)*sqrt(1/2)-1 returns 2.22044604925031e-16 on my computer, instead of zero. To avoid the issue, you can simply replace .n() by .simplify().n().

more

Hi Florentin

but arcsin((2.22044604925031e-16)).n() does not have tiny imaginary part .

( 2020-11-08 20:18:40 +0200 )edit

You forgot the +1. Arcsin is a complex (multivalued) function outside $[-1, 1]$. Try to compute arcsin(1+1/1000). (Also It's not accepting floats, since reals values outside the interval define a branch cut, you can find the plots on wikipedia).

( 2020-11-09 08:56:48 +0200 )edit

Thank you Florentin

( 2020-11-10 08:26:32 +0200 )edit

## Stats

Seen: 196 times

Last updated: Nov 08 '20