# Improve the accuracy of calculations of a quadratic cosine?

GROUPS:
 There is a formula Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]] Made calculations with increased accuracy Block[{$MinPrecision = 100000000,$MaxPrecision = 100000000}, Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], {x, N[Pi, 100000000]/2 - 0.0000001, N[Pi, 100000000]/2 + 0.0000001}]]  Can someone calculate with more accuracy? I do not understand whether there is a gap there or not.Sorry my English.
3 months ago
9 Replies
 Michael Rogers 4 Votes Is this what you're after?: Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], {x, Pi/2 - 0.0000001, Pi/2 + 0.0000001}, WorkingPrecision -> 16] (Note: N[Pi, 100000000]/2 - 0.0000001 is just a long way to compute Pi/2 - 0.0000001, since Mathematica converts N[Pi, 100000000]/2 to machine precision when -0.0000001 is added to it.)
3 months ago
 Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], {x, Pi/2 - 0.0000001, Pi/2 + 0.0000001}, WorkingPrecision -> 16] this does not workI do not understand this line is vertical and there is no gap or there is a slope and there is a gap?
3 months ago
 The default symbolic analysis fails to detect the discontinuity. Compare Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], {x, Pi/2 - 0.0000001, Pi/2 + 0.0000001}, WorkingPrecision -> 16, Exclusions -> ArcCos[Abs[Sin[Abs[x]]]] == 0] with Plot[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], {x, Pi/2 - 0.0000001, Pi/2 + 0.0000001}, WorkingPrecision -> 16, Exclusions -> Flatten@Values@ Solve[ArcCos[Abs[Sin[Abs[x]]]] == 0 && Pi/2 - 1*^-7 < x < Pi/2 + 1*^-7]] There should be a gap.
3 months ago
 Neil Singer 2 Votes Aleksey,There is a discontinuity there: In[20]:= Limit[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], x -> Pi/2, Direction -> "FromAbove"] Out[20]= -1 In[21]:= Limit[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]], x -> Pi/2, Direction -> "FromBelow"] Out[21]= 1 You can evaluate the expression with arbitrary accuracy by specifying the accuracy. Michael is correct that as soon as you add the 0.0000001 to Pi/2 you use machine precision. The syntax is this: ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]] /. x -> Pi/2 + .00000000000000000000000000000000150 to get -1.0000000000000000000000000000000000000000000000000 (Note: in this case I specified 50 digits of precision. You can go out to whatever you want.)
3 months ago
 just about the limits and forgot. And this proves that at the point Pi / 2 - the vertical line graphic and there is no gap or not? And how to prove it?
3 months ago
 Aleksey,I am not sure exactly what you are asking. The vertical line should not really be on the plot. It is a discontinuity (gap). The function approaches -1 from the positive side and 1 from the negative side. The limit is your proof of a discontinuity -- if the limit is different from each side, the function has a gap or discontinuity at that point. Plot connects all points so it will show the discontinuity as a vertical line.If I am not understanding your question and if your native language is Russian, please post it in Russian and my daughter will translate it for me.Regards,Neil
 This is Not the answer for Yours question only another forumla for Quadratic cosine:  HoldForm[ArcSin[Cos[x]]/ArcCos[Abs[Sin[Abs[x]]]] == HeavisideTheta[x] + 2 Sum[(-1)^k*HeavisideTheta[\[Pi]/2 - k \[Pi] + x], {k, 1, Infinity}] == -1 + (-1)^Floor[1/2 + x/\[Pi]] + HeavisideTheta[x]] // TraditionalForm ` $$\frac{\sin ^{-1}(\cos (x))}{\cos ^{-1}(\left| \sin (\left| x\right| )\right| )}=\theta (x)+2 \sum _{k=1}^{\infty } (-1)^k \theta \left(\frac{\pi }{2}-k \pi +x\right)=-1+(-1)^{\left\lfloor \frac{1}{2}+\frac{x}{\pi }\right\rfloor }+\theta (x)$$Regards,Mariusz