[math-fun] FullSimplify[ArcTan[Cos[x], Sin[x]]] == ArcTan[Cos[x], Sin[x]] ?
Ouch! I think it's just a modulus function, that's what the graph looks like at least: Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Mod[x + Pi, 2 Pi] - Pi, {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500 ] Or is it supposed to be: Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Pi - Mod[Pi - x, 2 Pi], {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500] Gotta watch those boundary values, and don't forget all of the broken evaluation over complexes: ArcTan[Cos[x],Sin[x]]==(Pi-Mod[Pi-Re[x],2*Pi]+I*Im[x]) LHS Sometimes returns precision errors? What the bleep is it doing numerics for an identity map? Try: ArcTan[Cos[I #], Sin[I #]] & /@ Range[100] ArcTan[Sin[I #]/Cos[I #]] & /@ Range[100] Refine[ArcTanh[Tanh[x]], {x \[Element] Reals}] Surprisingly, the second alternative does quite a bit better, managing to get up to n=75 rather than n=18, but still dies at 76 and thereafter. This is okay as long as we only need a thin strip around the real axis, but in general, no, "Indeterminate" is not a good return. --Brad
On 2019-10-17 07:13, Brad Klee wrote:
Ouch! I think it's just a modulus function, that's what the graph looks like at least:
Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Mod[x + Pi, 2 Pi] - Pi, {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500 ]
Or is it supposed to be:
Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Pi - Mod[Pi - x, 2 Pi], {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500]
I believe they're both Mod[x, 2 Pi, -Pi].
Gotta watch those boundary values, and don't forget all of the broken evaluation over complexes:
ArcTan[Cos[x],Sin[x]]==(Pi-Mod[Pi-Re[x],2*Pi]+I*Im[x])
I doubt there's a consensus on ArcTan[_complex,_complex].
LHS Sometimes returns precision errors? What the bleep is it doing numerics for an identity map? Try:
ArcTan[Cos[I #], Sin[I #]] & /@ Range[100]
In[60]:= ArcTan[Cos[I #], Sin[I #]] & /@ Range[20] During evaluation of In[60]:= Divide::indet: Indeterminate expression 0.\[CenterDot]10^-9/0. encountered. During evaluation of In[60]:= Divide::indet: Indeterminate expression 0.\[CenterDot]10^-8/0. encountered. Out[60]= {I, 2 I, 3 I, 4 I, 5 I, 6 I, 7 I, 8 I, 9 I, 10 I, 11 I, 12 I, 13 I, 14 I, 15 I, 16 I, 17 I, 18 I, ArcTan[Cosh[19], I Sinh[19]], ArcTan[Cosh[20], I Sinh[20]]} In[61]:= 19 I == %[[19]] Out[61]= 19 I == ArcTan[Cosh[19], I Sinh[19]] In[62]:= FullSimplify@% Out[62]= True In[63]:= FullSimplify /@ %% Out[63]= True Those 0/0 printouts are surely reportable. The slackeroid simplification is probably a time-limitng heuristic.
ArcTan[Sin[I #]/Cos[I #]] & /@ Range[100] . . . During evaluation of In[64]:= N::meprec: Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating -((120 I)/\[Pi])+ArcTan[I Tanh[60]]/(\[Pi]/2).
During evaluation of In[64]:= General::stop: Further output of N::meprec will be suppressed during this calculation. Out[64]= {I, 2 I, 3 I, 4 I, 5 I, 6 I, 7 I, 8 I, 9 I, 10 I, 11 I, 12 I, 13 I, 14 I, 15 I, 16 I, 17 I, 18 I, 19 I, 20 I, 21 I, 22 I, 23 I, 24 I, 25 I, 26 I, 27 I, 28 I, 29 I, 30 I, 31 I, 32 I, 33 I, 34 I, 35 I, 36 I, 37 I, 38 I, 39 I, 40 I, 41 I, 42 I, 43 I, 44 I, 45 I, 46 I, 47 I, 48 I, 49 I, 50 I, 51 I, 52 I, 53 I, 54 I, 55 I, 56 I, 57 I, 58 I, 59 I, 60 I, 61 I, 62 I, 63 I, 64 I, 65 I, 66 I, 67 I, 68 I, 69 I, 70 I, 71 I, 72 I, 73 I, 74 I, 75 I, ArcTan[I Tanh[76]], ArcTan[I Tanh[77]], ArcTan[I Tanh[78]], ArcTan[I Tanh[79]], ArcTan[I Tanh[80]], ArcTan[I Tanh[81]], ArcTan[I Tanh[82]], . . ., ArcTan[I Tanh[100]]} Those precision complaints are also probably reportable.
Refine[ArcTanh[Tanh[x]], {x \[Element] Reals}]
Surprisingly, the second alternative does quite a bit better, managing to get up to n=75 rather than n=18,
76 = 4⨉19
but still dies at 76 and thereafter. This is okay as long as we only need a thin strip around the real axis, but in general, no, "Indeterminate" is not a good return.
In 12.1, at least, no Indeterminate is actually returned. Just some unsettling whimpers. —Bill
--Brad
_______________________________________________
Hi Bill, Mi Yan at Wolfram also thinks it’s a genuine bug —not the endangered kind, ha ha. He’s working on it, but my guess is that the priority is lower than FB-Libra whatever. The hang up, as I said before, is boundary evaluation, and complex arguments. So your preferred form may be technically incorrect on a measure zero set. However, depending on order of evaluation, there is a legit case for: ArcTan[Tan[x]] == x , which completely disagrees with Wolfram. Personally, I like that answer best, but I am just a little orange-yellow-green Chinavia Hilaris nymph next to the grand old Reimannian heroes of the symbolic computing revolution. Remember Qin Chen! He is the real, fallen “Showstopper” ! —Brad
On Oct 18, 2019, at 5:04 PM, rwg <rwg@ma.sdf.org> wrote:
On 2019-10-17 07:13, Brad Klee wrote: Ouch! I think it's just a modulus function, that's what the graph looks like at least: Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Mod[x + Pi, 2 Pi] - Pi, {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500 ] Or is it supposed to be: Show[ Plot[ArcTan[Cos[x], Sin[x]], {x, -10 Pi, 10 Pi}, PlotStyle -> Thick], Plot[Pi - Mod[Pi - x, 2 Pi], {x, -10 Pi, 10 Pi}, PlotStyle -> Directive[Dashing[.05], Thick, Red]], PlotRange -> All, ImageSize -> 500]
I believe they're both Mod[x, 2 Pi, -Pi].
Gotta watch those boundary values, and don't forget all of the broken evaluation over complexes: ArcTan[Cos[x],Sin[x]]==(Pi-Mod[Pi-Re[x],2*Pi]+I*Im[x])
I doubt there's a consensus on ArcTan[_complex,_complex].
LHS Sometimes returns precision errors? What the bleep is it doing numerics for an identity map? Try: ArcTan[Cos[I #], Sin[I #]] & /@ Range[100]
In[60]:= ArcTan[Cos[I #], Sin[I #]] & /@ Range[20]
During evaluation of In[60]:= Divide::indet: Indeterminate expression 0.\[CenterDot]10^-9/0. encountered.
During evaluation of In[60]:= Divide::indet: Indeterminate expression 0.\[CenterDot]10^-8/0. encountered.
Out[60]= {I, 2 I, 3 I, 4 I, 5 I, 6 I, 7 I, 8 I, 9 I, 10 I, 11 I, 12 I, 13 I, 14 I, 15 I, 16 I, 17 I, 18 I, ArcTan[Cosh[19], I Sinh[19]], ArcTan[Cosh[20], I Sinh[20]]}
In[61]:= 19 I == %[[19]]
Out[61]= 19 I == ArcTan[Cosh[19], I Sinh[19]]
In[62]:= FullSimplify@%
Out[62]= True
In[63]:= FullSimplify /@ %%
Out[63]= True
Those 0/0 printouts are surely reportable. The slackeroid simplification is probably a time-limitng heuristic.
ArcTan[Sin[I #]/Cos[I #]] & /@ Range[100] . . . During evaluation of In[64]:= N::meprec: Internal precision limit $MaxExtraPrecision = 50.` reached while evaluating -((120 I)/\[Pi])+ArcTan[I Tanh[60]]/(\[Pi]/2).
During evaluation of In[64]:= General::stop: Further output of N::meprec will be suppressed during this calculation.
Out[64]= {I, 2 I, 3 I, 4 I, 5 I, 6 I, 7 I, 8 I, 9 I, 10 I, 11 I, 12 I, 13 I, 14 I, 15 I, 16 I, 17 I, 18 I, 19 I, 20 I, 21 I, 22 I, 23 I, 24 I, 25 I, 26 I, 27 I, 28 I, 29 I, 30 I, 31 I, 32 I, 33 I, 34 I, 35 I, 36 I, 37 I, 38 I, 39 I, 40 I, 41 I, 42 I, 43 I, 44 I, 45 I, 46 I, 47 I, 48 I, 49 I, 50 I, 51 I, 52 I, 53 I, 54 I, 55 I, 56 I, 57 I, 58 I, 59 I, 60 I, 61 I, 62 I, 63 I, 64 I, 65 I, 66 I, 67 I, 68 I, 69 I, 70 I, 71 I, 72 I, 73 I, 74 I, 75 I, ArcTan[I Tanh[76]], ArcTan[I Tanh[77]], ArcTan[I Tanh[78]], ArcTan[I Tanh[79]], ArcTan[I Tanh[80]], ArcTan[I Tanh[81]], ArcTan[I Tanh[82]], . . ., ArcTan[I Tanh[100]]}
Those precision complaints are also probably reportable.
Refine[ArcTanh[Tanh[x]], {x \[Element] Reals}] Surprisingly, the second alternative does quite a bit better, managing to get up to n=75 rather than n=18,
76 = 4⨉19
but still dies at 76 and thereafter. This is okay as long as we only need a thin strip around the real axis, but in general, no, "Indeterminate" is not a good return.
In 12.1, at least, no Indeterminate is actually returned. Just some unsettling whimpers.
—Bill
--Brad _______________________________________________
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (3)
-
Brad Klee -
bradklee@gmail.com -
rwg