This question already has an answer here:

My understanding is that Mathematica 11 Plot can now handle singularities automatically when plotting. identify-types-of-singularities-and-discontinuitie

I found an a function where Mathematica 11.0.1 gives a 1/0 error message. But still the plot is generated. Here it is 1/(Tan[1/t])

f = 1/Tan[1/t];
Plot[f, {t, - Pi/2, Pi/2}, 
 ExclusionsStyle -> {None, Directive[Red, AbsolutePointSize[5]]}]

Mathematica graphics

It is having hard time with 1/Tan[1/t] The singularities for this function are (using function that finds these, thanks to Edmund and Carl Woll from does-mathematica-have-a-function-to-find-all-singularities-of-an-expression)

singularityDomain[f_, x_] := Module[{res = FunctionDomain[f, x]}, 
  Reduce[! res] /; ! MatchQ[res, _FunctionDomain]]

singularityDomain[1/Tan[1/x], x]

Mathematica graphics

Is this known, is this a bug?


marked as duplicate by Michael E2 plotting Jan 25 '17 at 13:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ Known bug. Comes from the improvements in the Exclusions system, i.e. setting Exclusions -> None turns off the messages (and the benefits of exclusion processing, too). $\endgroup$ – rcollyer Jan 24 '17 at 14:35
  • $\begingroup$ @rcollyer thanks. If this is known, should I delete this post then? $\endgroup$ – Nasser Jan 24 '17 at 14:38
  • $\begingroup$ @rcollyer is there currently a question which has this bug in it? $\endgroup$ – Feyre Jan 24 '17 at 15:05
  • 1
    $\begingroup$ @Feyre I don't know of another one. My knowledge comes from internal testing. $\endgroup$ – rcollyer Jan 24 '17 at 15:18
  • 1
    $\begingroup$ @MichaelE2 I think it is. $\endgroup$ – rcollyer Jan 24 '17 at 18:40

This is a known bug introduced in 11.0 with the improvements to the Exclusions code. One workaround is

Plot[1/Tan[1/t], {t, - Pi/2, Pi/2}, Exclusions -> None]

eliminates the message but removes the benefits of Exclusions. A better alternative is to specify the Exclusions yourself,

Plot[1/Tan[1/t], {t, - Pi/2, Pi/2}, Exclusions -> {Tan[1/t] == 0}]

Recommend that you avoid any region where you know that a function becomes infinitely dense.

f[t_] = 1/Tan[1/t];

 reg = ImplicitRegion[
   (ts && -max < t < -min) || min < t < max, t];
 Plot[f[t], t ∈ reg,
  PlotPoints -> 100,
  MaxRecursion -> 15],
 {{ts, True, "two-sided"}, {True, False}},
 {{min, 0.025}, 0.001, 0.1, Appearance -> "Labeled"},
 {{max, Pi/2}, 1.1 min, Pi/2, Appearance -> "Labeled"}]

enter image description here


Not the answer you're looking for? Browse other questions tagged or ask your own question.