1

I am trying to plot a figure by the following codes:

Plot[(27 2^((-2 + a)/(-1 + a)) 5^(a/(-1 + a)) 7^(1/(1 - a)) 
      a^2)/((-1 + a) (4 + 9 a)), {a, 1.001, 3}]

When running the above program, the warning appeared:

General::munfl: 1/7^960.765 is too small to represent as a normalized machine number; precision may be lost.

How can I fix this problem? I have tried to set a higher WorkingPrecision value, but it didn't work.

xzczd
  • 65,995
  • 9
  • 163
  • 468
Ya He
  • 160
  • 7
  • 1
    I'd just add Quiet@Plot[... it does not affect anything in terms of the plot. It is just saying it is too small of a number. – Nasser Nov 21 '22 at 11:22
  • @Nasser Thanks. I knew this method, but I think this method only "escaped" the problem rather than really solved it. I would like to know if there is other ways to fix the problem. – Ya He Nov 21 '22 at 11:28
  • 1
    Machine numbers have a gap between zero and the next larger number. For Plotting purposes this warning may be ignored and do as Nasser suggest. – Daniel Huber Nov 21 '22 at 11:29
  • {a, 1 + 1/100, 3} – cvgmt Nov 21 '22 at 11:29
  • @cvgmt Pls note that the starting point is 1.001, not 1.01. – Ya He Nov 21 '22 at 11:32
  • @YaHe We need not start from 1.001 since Limit[(27 2^((-2 + a)/(-1 + a)) 5^(a/(-1 + a)) 7^(1/(1 - a)) a^2)/((-1 + a) (4 + 9 a)), a -> 1, Direction -> "FromAbove"] – cvgmt Nov 21 '22 at 11:35
  • @cvgmt Yes, this function converges to zero as a ->1. But I still hope there is some way to fix the mentioned problem which occurs when a is very close to 1 (e.g., a=1.001 or 1.002). – Ya He Nov 21 '22 at 19:14
  • @YaHe It's impossible to do even for the simplest example. Plot[1/x^1000, {x, .001, 1}] – cvgmt Nov 21 '22 at 23:25
  • @cvgmt It's possible. To be more specific: Plot[With[{a = SetPrecision[a, 16]}, a (27 2^((-2 + a)/(-1 + a)) 5^(a/(-1 + a)) 7^(1/(1 - a)) a^2)/((-1 + a) (4 + 9 a))], {a, 1.001, 3}] Please refer to the suggested duplicate to understand the reason. – xzczd Nov 22 '22 at 02:19
  • @xzczd Many thanks! Your proposal works quite well! – Ya He Nov 22 '22 at 22:55

0 Answers0