The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Expon bug in wp34s
Message #1 Posted by Andrew Nikitin on 13 July 2013, 3:12 p.m.

Quote:
1 [sto] J 0 [sto] K 1 [chs] Expon

returns -1.71828182846 instead of correct 0.

I tried to correct it but failed to find code for Expon. I found the distributions.wp34s in xrom folder, but Expon is not there. Where is it?

      
Re: Expon bug in wp34s
Message #2 Posted by Marcus von Cube, Germany on 13 July 2013, 3:20 p.m.,
in response to message #1 by Andrew Nikitin

Look in xrom/distributions/exponential.wp34s.

            
Re: Expon bug in wp34s
Message #3 Posted by Andrew Nikitin on 13 July 2013, 4:21 p.m.,
in response to message #2 by Marcus von Cube, Germany

Here is a patch (I kind of tested it by building, flashing and trying).

Index: trunk/xrom/distributions/exponential.wp34s

===================================================================

--- trunk/xrom/distributions/exponential.wp34s (revision 3429)

+++ trunk/xrom/distributions/exponential.wp34s (working copy)

@@ -55,6 +55,8 @@

SPEC? JMP cdf_infinite [times] + x<0? + JMP ret_0 +/- e[^x]-1 +/- @@ -70,7 +72,6 @@

xOUT xOUT_NORMAL

expon_param:: RCL J - GSB check_special_pos - RTN + JMP check_special_pos

            
Re: Expon bug in wp34s
Message #4 Posted by Andrew Nikitin on 13 July 2013, 5:01 p.m.,
in response to message #2 by Marcus von Cube, Germany

Since I was there, I think that similar bug in Expon_u should also be fixed. I tried this one in console emulator.

Index: trunk/xrom/distributions/exponential.wp34s
===================================================================
--- trunk/xrom/distributions/exponential.wp34s	(revision 3429)
+++ trunk/xrom/distributions/exponential.wp34s	(working copy)
@@ -43,6 +43,8 @@
 			SPEC?
 				JMP cdf_infinite
 			[times]
+                        x<0?
+				JMP ret_1
 			+/-
 			e[^x]
 			xOUT xOUT_NORMAL
@@ -55,6 +57,8 @@
 			SPEC?
 				JMP cdf_infinite
 			[times]
+                        x<0?
+				JMP ret_0
 			+/-
 			e[^x]-1
 			+/-
@@ -70,7 +74,6 @@
 			xOUT xOUT_NORMAL

expon_param:: RCL J - GSB check_special_pos - RTN + JMP check_special_pos

Edited: 13 July 2013, 5:01 p.m.

                  
Re: Expon bug in wp34s
Message #5 Posted by Paul Dale on 13 July 2013, 7:35 p.m.,
in response to message #4 by Andrew Nikitin

Thanks for this. Patch applied now.

- Pauli

                        
Re: Expon bug in wp34s
Message #6 Posted by Andrew Nikitin on 13 July 2013, 11:49 p.m.,
in response to message #5 by Paul Dale

I am not sure what happened, but when I updated from SVN, the Expon_u became this:

		XLBL"CDFU_EXPON"
			xIN MONADIC
			GSB expon_param
			SPEC?
				JMP cdf_infinite
			x<0?
				JMP ret_1
			[times]
			x<0?
				JMP ret_1
			+/-
			e[^x]
			xOUT xOUT_NORMAL

the first instance "x<0? jmp ret_1" (right before [times]) was not in the patch and should not be there.

                              
Re: Expon bug in wp34s
Message #7 Posted by Paul Dale on 14 July 2013, 2:46 a.m.,
in response to message #6 by Andrew Nikitin

Hopefully fixed now.

I had to manually apply the patch -- the patch program didn't like me.

Pauli

                                    
Re: Expon bug in wp34s
Message #8 Posted by Marcus von Cube, Germany on 14 July 2013, 3:23 a.m.,
in response to message #7 by Paul Dale

I've uploaded a new build to SVN. It should fix the RUN vs STOP issue, too.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall