MathGroup Archive 2002

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

Search the Archive

When does x/x not equal 1?

  • To: mathgroup at
  • Subject: [mg32417] When does x/x not equal 1?
  • From: mjperson at MIT.EDU (Michael J Person)
  • Date: Sat, 19 Jan 2002 01:17:15 -0500 (EST)
  • Organization: Massachusetts Institute of Technology
  • Sender: owner-wri-mathgroup at

Greetings all:

	  I'm having a bit of a problem with Math on Mac OS 9.1...
	  Specifically we have a lot of large planetary calculations that only
occasionally produce piles of complex numbers of the form:

103.3 + 3.4432 *10^-39 I

      These tiny complex pieces then get carried all around in our 
calculations and destroy the formatting of our outputs and things 
even though the real part seems to be a quite reasonable answer to 
our problems.

    Hunting it down piece by piece, we seem to have traced it to places
where we're taking the square roots of things that include ratios of
numbers that should be equaling 1 at the boundaries but aren't.

Sqrt[1-x/x] -> tiny complex number instead of 0!

	    It seem to be that x/x that's causing the problem in our codes,
but as we try to track it down, all sort of mystifying behavior starts
to manefest.  Among the worst of it are the following sorts of things:

	(x = (1.992+$MachineEpsilon))   //FullForm
	x/x //FullForm
	Now, I'd guess that wonky things start happening when you start
fooling around with numbers near $MachineEpsilon, but shouldn't
x/x = 1?  Worse, is when we tried to fix the problem in various ways,
we came up with terribly confusing things like the following:

	x/x //FullForm
(*That's just like above.)

	Divide[x,x] //FullForm
	Ah ha!  That's just the sort of thing we want in our calculations.
So we try to see what the difference is....

	Divide[a,b] //FullForm

	Times[a, Power[b, -1]]
	a/b //FullForm
	Times[a, Power[b, -1]]
	They're handled exactly the same way! So, can anyone explain to me 
what's going on here, and how I can keep very small complex numbers from
arising in all of those cases when x/x != 1.  

	(As I mentioned these problems are completely intermittent.  In the 
examples given above, they do not occur for 1.991, or 1.994, just 1.992
and 1.993.  Bah!)

Thanks for anything you can tell me.
-Michael Person
mjperson at
Massachusetts Institute of Technology
Department of Earth, Atmospheric, and Planetary Sciences

  • Prev by Date: webMathematica & Mathematica training in Amsterdam
  • Next by Date: Unstable solutions to NonlinearFit
  • Previous by thread: webMathematica & Mathematica training in Amsterdam
  • Next by thread: Re: When does x/x not equal 1?