HP Forums
Expon bug in wp34s - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Expon bug in wp34s (/thread-246391.html)



Expon bug in wp34s - Andrew Nikitin - 07-13-2013

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 - Marcus von Cube, Germany - 07-13-2013

Look in xrom/distributions/exponential.wp34s.


Re: Expon bug in wp34s - Andrew Nikitin - 07-13-2013

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 - Andrew Nikitin - 07-13-2013

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 - Paul Dale - 07-13-2013

Thanks for this. Patch applied now.


- Pauli


Re: Expon bug in wp34s - Andrew Nikitin - 07-13-2013

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 - Paul Dale - 07-14-2013

Hopefully fixed now.

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


Pauli


Re: Expon bug in wp34s - Marcus von Cube, Germany - 07-14-2013

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