Warning: still more science.
(This could be getting a bit OT... Skip to the last paragraph if you wish a non-technical executive summary.)
You think incorrectly--I am not using the ideal gas law. Talking about the ideal gas implies that you are talking about taking a parcel of air and changing its pressure (due to altitude) and looking at the resultant temp change
assuming no other heat inputs or losses. My equation for temp vs altitude is an approximation of an average
static (ie non-moving) column of air, presumably based upon real measurments and certainly affected by other heat inputs and losses. You appear to be talking about the temperature lapse rate of dry or humid air (they are different) as it changes altitude (eg up or down a mountainside), I was not. (Since both the volume and pressure change as a function of altitude, the heat capacity of the gas must also be brought into the calculation of the temperature lapse rate.)
(For info on the dry and moise adiabatic (temperature) lapse rates, see, for instance:
Theory:
http://en.wikipedia.org/wiki/Adiabatic_process
Practice:
http://www.tpub.com/content/aerographer/14312/css/14312_47.htm)
A barometric altimeter generally knows the pressure at some altitude (supplied by your calibration), the local pressure, and perhaps the local temperature. It then uses some "standard" atmosphere model to estimate the local altitude which requires some assumed standard temperature profile. My equation simply summarizes such a standard temperature profile as found in an aeronautics book. What I did not show in the equation that I presented was that the standard temp profile becomes constant at 220K (-53C) above 29500 ft to some much higher altitude at which point the standard temp begins to rise again. (This higher altitude point was well above where any aircraft could fly, so it was not included in the simulator.)
Short answer is that assuming someone else's motivation is risky, and in this case, wrong.
As I have already stated, our underlying assumptions are different.
BTW, the ideal gas law is:
PV=nRT
..... P=pressure
..... V=volume
..... n=moles (amount) of gas
..... R=universal gas constant
..... T=absolute temp
All of the above is about the temp of air as a function of altitude. The speed of sound is still proportional to the sqrt(absolute_temp).
Somehow, I doubt that the average hiker needs to know much of the above--the speed of sound is still ~1000 ft/sec anywhere that one is likely to hike.
Doug