# Cannot Plot Log

I tried following command and it worked well (you can see the function is positive).

Plot[1 - x^(2^(n + 1)^a - 2^n^a) /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85, 98}, WorkingPrecision -> 100]

But, I couldn't plot Log of this function:

Plot[Log[1 - x^(2^(n + 1)^a - 2^n^a)] /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85, 98}, WorkingPrecision -> 100]

This shows only axes. I tried LogPlot, but it fails as well:

LogPlot[1 - x^(2^(n + 1)^a - 2^n^a) /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85, 98}, WorkingPrecision -> 100]

Why Mathematica can't show log of this function?

• The above is done in Mathematica 11.1. I tried in Mathematica 10.4, then LogPlot showed something but wrong. This function must vanish as x decrease but LogPlot showed that it approaches to 1 (Plot[1 - x^(2^(n + 1)^a - 2^n^a)] showed vanishing property). – selpo Jul 8 '17 at 8:48
• If I replace Log by RealExponent, it works. (RealExponent[..] is equivalent to Log[Abs[..]], though.) – Michael E2 Jul 8 '17 at 19:32

$Version (* "11.1.1 for Mac OS X x86 (64-bit) (April 18, 2017)" *)  Clear[f] f[n_, prec_: 25] := Module[{rn = Rationalize[n, 0]}, N[1 - x^(2^(rn + 1)^a - 2^rn^a) /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, prec]] f[90.1] (* 0.07970588475709084543825009 *) Plot[f[n], {n, 85, 98}] LogPlot[f[n], {n, 85, 98}] • It's a very simple but smart solution! – selpo Jul 8 '17 at 14:11 In Mathematica 10.1.0 LogPlot works: LogPlot[1 - x^(2^(n + 1)^a - 2^n^a) /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85, 98}, WorkingPrecision -> 100] Plot however returns empty: Plot[Log[1 - x^(2^(n + 1)^a - 2^n^a)] /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85, 98}, WorkingPrecision -> 100] A work-around is Table and ListLinePlot: ListLinePlot[ Table[Log[1 - x^(2^(n + 1)^a - 2^n^a)] /. {a -> 1 - 1/10, x -> 1 - 4^(-30)}, {n, 85100, 98100}], DataRange -> {85, 98} ] • Thanks! This problem seems to be very sensitive to the implementation of Mathematica. Plot and LogPlot does not use the same method of evaluation. – selpo Jul 8 '17 at 13:05 fun = 1 - x^(2^(n + 1)^a - 2^n^a) /. {a -> 1 - 1/10, x -> 1 - 4^(-30)} For real n this monster formula returns Indeterminate: Table[Log @ N[fun, 5], {n, 85, 98, 0.5}] // Short  {Indeterminate, ..., Indeterminate} But it produces results for integer and rational n: Table[N[Log @ fun, 3], {n, 85, 98, 1/4}] // Short which you can display with ListLinePlot ListLinePlot @ Table[Log @ fun, {n, 85, 98, 1/4}] • Thanks a lot! Oh, this formula needs too big precision. I decided to use Round[n, 1/100] instead of n. – selpo Jul 8 '17 at 13:02 Here is an approach that works equally in versions 11.1 and 11.0: Plot[Log[SetPrecision[ 1 - x^(2^(n + 1)^a - 2^n^a),$MachinePrecision] /. {a -> 1 - 1/10,

I wrapped the original function in SetPrecision, which also allows me to omit the original WorkingPrecision option, so I think this is the simplest solution.
This also works with LogPlot.
{"ft_lang_label":"__label__en","ft_lang_prob":0.74311304,"math_prob":0.9842726,"size":924,"snap":"2020-34-2020-40","text_gpt3_token_len":355,"char_repetition_ratio":0.116304345,"word_repetition_ratio":0.32738096,"special_character_ratio":0.45454547,"punctuation_ratio":0.17788461,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9981772,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"im_url_duplicate_count":[null,4,null,4,null,4,null,4,null,4,null,4,null,4,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T16:30:09Z\",\"WARC-Record-ID\":\"<urn:uuid:f874e7e2-abb8-44d4-805c-ca260e05dc54>\",\"Content-Length\":\"175165\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1f7891c2-460b-4201-879b-a6764ca3b2c2>\",\"WARC-Concurrent-To\":\"<urn:uuid:8e8bc362-6166-415d-99b9-ccd9ae327aba>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/149972/cannot-plot-log\",\"WARC-Payload-Digest\":\"sha1:SUFC7KYVKQBBO4LWK253B3OB7JXRQDYZ\",\"WARC-Block-Digest\":\"sha1:BXIJNY5ENMLVUVC4E377UD3P3FZLSMM4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735963.64_warc_CC-MAIN-20200805153603-20200805183603-00574.warc.gz\"}"}