MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to avoid overflow or underflow in mathematica?

  • To: mathgroup at
  • Subject: [mg88674] Re: [mg88648] How to avoid overflow or underflow in mathematica?
  • From: "W_Craig Carter" <ccarter at>
  • Date: Mon, 12 May 2008 04:46:47 -0400 (EDT)
  • References: <>

Hello Quantum Fang,

You could use arbitrary precision and do something like this (although
I don't advise this approach):

fermiseries =
  Normal[Series[1/(1 + E^((muShift) beta)), {beta, 0, 14}]];

colist = Simplify[CoefficientList[fermiseries, beta]]

and then write a function that calls N[beta, bigNumber] and N[mushift,
bigNumber] on the product of the two list until you have the accuracy
that you want.... This is a bad idea.

However your function, except for ((omega - mu - Ef)/KBT)
approximately 1, is the unit step function (0 if x<0, 1/2 x=0, 1 if
x>0). If you are interested in the physical aspects of this problem
then expand (omega - mu - ef) near 1/(kb T).  In other words, scale
your energies with the thermal energy.


On Sun, May 11, 2008 at 3:14 PM, quantumfang <membrane at> wrote:
> It's well known that Mathematica can do evaluation to arbitrary precision. But I don't know how to avoid the following trouble in computing:
>  Ef = 0.;
>  mu=0.;
>  KBT = 1.*10^-10;
>  FL[omega_Real] := 1./(1. + E^((omega - mu - Ef)/KBT));
>  the error message shows
>  General::ovfl: Overflow occurred in computation. >>
>  General::unfl: Underflow occurred in computation. >>

W. Craig Carter

  • Prev by Date: Re: Re: Request for Collective Wisdom...
  • Next by Date: Re: Solving on mathematica
  • Previous by thread: Re: How to avoid overflow or underflow in mathematica?
  • Next by thread: Conjugate of Symbolic Expression