5
$\begingroup$

How to evaluate numerically $e^{-4 \cdotp 10^{35}}$ in the form $0,a_1a_2...\times 10^{-n}$

N[E^(-4*10^35)]  

General::unfl: Underflow occurred in computation. >>
Underflow[]

doesn't work

$\endgroup$
  • $\begingroup$ How many digits would you be satisfied with? $\endgroup$ – Michael E2 Feb 25 '16 at 0:11
9
$\begingroup$
n = 35;
{pow, logdec} = {#[[1]][[;; #[[2]]]], #[[1]][[#[[2]] + 1 ;;]]} &@
                            RealDigits[N[Log[10, E^(-4 10^n)], 200]];

So there are

FromDigits@pow

(* 173717792761300731060451567566642032 *)

zeroes,followed by

dec = N[1/10^(FromDigits[logdec] 10^-Length[logdec]), 50]

(* 0.12084848148616706326389685430970719629910021783715 *)

... or may be I'm off by one :)


Checking with smaller numbers:

n=4;
{pow, logdec} = {#[[1]][[;; #[[2]]]], #[[1]][[#[[2]] + 1 ;;]]} &@
                 RealDigits[N[Log[10, E^(-4 10^n)], 200]];
FromDigits@pow
(* 17371 *)
dec = N[1/10^(FromDigits[logdec] 10^-Length[logdec]), 50]
0.16623553671520518223181112083319039297273582477854

E^(-4 10^n) // N
(* 1.66235536715*10^-17372 *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Somewhat simpler: exp = -4*10^35; tenExp = Floor[exp/Log[10]]; rem = exp - tenExp Log[10]; N[Exp[rem], 50]*Inactivate@Power[10, tenExp] Also, rem can be written as Mod[exp, Log[10]] but I wanted to make sure (and make it obvious) that the integer and fractional part add up right. $\endgroup$ – The Vee Mar 19 '16 at 23:59
1
$\begingroup$
$MinMachineNumber

$\text{2.2250738585072014$\grave{ }$*${}^{\wedge}$-308}$

and as Karsten 7 points out:

Log[$MinNumber] 

$-3.121657384082590881601471993929\times 10^{15}$


Use Exp[x] == 10^(x/Log[10])

and Exp[a b] = Exp[a] + Exp[b] to find:

$0.0183156\ 10^{-10^{35}}$

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ That's for machine-precision. $MinNumber is more relevant here. $\endgroup$ – Karsten 7. Feb 24 '16 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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