Pi/2 radians different from 90 deg?

12132021, 06:14 PM
Post: #1




Pi/2 radians different from 90 deg?
For some strange reason, tan(Pi/2) in radian mode result is a moderately large but finite number, while tan(90) in degree mode is infinity. How that can be? Am I missing something?


12132021, 06:54 PM
Post: #2




RE: Pi/2 radians different from 90 deg?
In Home "pi/2" is not really pi/2, but only the first 12 significant digits of it, rounded off. The tangent of THAT number is what older firmware versions of Prime return in Home view.
If you want to find the tangent of EXACTLY pi/2, then use CAS view, in which "tan(pi/2)" returns +/ infinity. In general, use Home for 12digit floatingpoint number crunching (like most other nonancient HP models use) and use CAS for exact math and/or symbolic math. Note that some recent firmware versions for the Prime return +/ infinity for tan(pi/2) even in Home view, even when "Intelligent Math" mode is turned off. <0ɸ0> Joe 

12132021, 07:35 PM
Post: #3




RE: Pi/2 radians different from 90 deg?
Thank you, Joe.
Actually, not really 12 digits. To get a similar result in degrees, one needs to calculate tan(90+3e8). So, it's more like 910 digit accuracy. 

12132021, 08:50 PM
Post: #4




RE: Pi/2 radians different from 90 deg?
Hi, celltx
You are off by a factor of more than 100. Home side, radian mode, TAN(PI/2) = 195,948,537,906 tan(90°+3e8°) = 1/tan(3e8°) ≈ 1/(3e8*pi/180) ≈ 1,909,859,317.1 

12132021, 10:25 PM
(This post was last modified: 12132021 10:30 PM by Joe Horn.)
Post: #5




RE: Pi/2 radians different from 90 deg?
(12132021 07:35 PM)celltx Wrote: Thank you, Joe. The reason that final results are not always accurate to 12 digits is that intermediate results are rounded to 12 digits, and the roundoff error can accumulate. Each intermediate step of every algebraic calculation in Home view is calculated internally to 15 truncated digits, then that result is rounded to 12 significant digits. For example, tan(pi/2) is calculated internally like this: Step 1: pi > 3.14159265358979 (15 truncated digits) > gets rounded to exactly 3.14159265359 Step 2: take THAT number (which is not pi!) and divide THAT by 2 > 1.570796326795 (exactly) > gets rounded to exactly 1.5707963268 Notice that roundoff error has already accumulated: pi/2 is closer to 1.57079632679 Step 3: take the tangent of THAT result (which is not pi/2) > 195948537905.977 (15 truncated digits) > gets rounded to exactly 195948537906 <0ɸ0> Joe 

12142021, 10:20 PM
Post: #6




RE: Pi/2 radians different from 90 deg?
The difference is results obtained using degrees and radians seems to go back a long way, as on some older models (sin(cos(1)) is 0 using degrees but when using radians the result is small but not quite zero.
I've tested this on an actual HP34C, HP10C and HP11C and all three return exactly the same result. Further testing using a simulator gives the same results for the HP31, HP32, HP33 and HP67 so I suspect that all these series of similar models behave the same way. Interestingly the even older HP21 and HP25 both return zero when using degrees and radians. It seems counter intuitive but I suspect that as the value of Pi is an approximation, the later models are technically more accurate... Mike T. HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S 

12142021, 11:16 PM
Post: #7




RE: Pi/2 radians different from 90 deg?
(12142021 10:20 PM)Mike T. Wrote: It seems counter intuitive but I suspect that as the value of Pi is an approximation, the later models are technically more accurate... Let PI = approximate values of true pi, we have: SIN(PI) = SIN(pi  PI) ≈ pi  PI This is why machine with more internal digits of pi gives SIN(PI) an tiny number. We can use this to pull out internal stored digits of pi, by simple rearrangement. pi ≈ PI + SIN(PI) see [VA] SRC#006 Pi Day 2020 Special: A New Fast Way to Compute Pi 

12172021, 06:06 PM
Post: #8




RE: Pi/2 radians different from 90 deg?
(12132021 06:54 PM)Joe Horn Wrote: ... then use CAS view, in which "tan(pi/2)" returns +/ infinity. Interesting, but: 1/0 also gives +/ infinity ??? (I don't have the Prime). When the angle aproximates 90 degrees, the tan goes to +/infinity, but tan(90o) > error, isn't it? Best regards, Artur ARTUR MARIO JUNIOR BRAZIL 

12182021, 01:49 PM
(This post was last modified: 12182021 01:51 PM by Joe Horn.)
Post: #9




RE: Pi/2 radians different from 90 deg?
(12172021 06:06 PM)Artur  Brasil Wrote:(12132021 06:54 PM)Joe Horn Wrote: ... then use CAS view, in which "tan(pi/2)" returns +/ infinity. For 1/0, Prime's Home view returns +Inf when "Intelligent Math" mode is turned on, but it returns "Error: X/0" when "Intelligent Math" mode is turned off. Prime's CAS view returns +/infinity in exact mode, but it returns +Infinity in approximate mode. Why? I have no idea. (12172021 06:06 PM)Artur  Brasil Wrote: When the angle aproximates 90 degrees, the tan goes to +/infinity, but tan(90o) > error, isn't it? For tan(90°), Prime returns either infinity or 1.63312393532×10^16 depending on mode settings. Other HP calculators also differ in what they return for tan(90°). The HP41 returns 9.999999999×10^99, but the HP42S says "Out of Range". The HP15C blinks with an overflow error. The 35S says "Invalid Data" and the 10bII+ says "OFLO". The 50g in exact mode returns unsigned infinity for tan(90) but in approximate mode it beeps and says "TAN Error: Infinite Result". Wolfram Alpha says that tan(90°) is "complex infinity". <0ɸ0> Joe 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)