Post Reply 
[42S] MANT Challenge
01-23-2014, 02:52 AM (This post was last modified: 01-23-2014 03:15 AM by Gerson W. Barbosa.)
Post: #15
RE: [42S] MANT Challenge
(01-22-2014 08:58 PM)Dieter Wrote:  
(01-22-2014 08:41 PM)Gerson W. Barbosa Wrote:  I talked too soon. It wouldn't work for |x| < 0.01. Despite my bad fix attempt, which made it three times as large, it won't work for |x| < 10^-10.

Here's a 15C-version of the 42s-solution I posted:
Code:
01 ABS
02 ENTER
03 X≠0?
04 LOG
05 INT
06 1
07 -
08 9
09 9
10 CHS
11 X>Y?
12 X<>Y
13 RDN
14 10^x
15 /
16 1
17 0
18 X>Y?
19 LOG
20 /

What do you think?

Very nice! It passes all equivalent Werner's examples for the HP-15C and others I tried. So does the following, as far as I have tested:
Code:

   001 {    42 21 11 } f LBL A
   002 {       43 20 } g x=0
   003 {       43 32 } g RTN
   004 {       43 16 } g ABS
   005 {          36 } ENTER
   006 {       43 13 } g LOG
   007 {           1 } 1
   008 {          30 } -
   009 {       43 44 } g INT
   010 {          13 } 10^x
   011 {          10 } ÷
   012 {       44 36 } STO RAN#
   013 {       45 36 } RCL RAN#
   014 {           1 } 1
   015 {           0 } 0
   016 {          20 } ×
   017 {       43 32 } g RTN

What do you think? Still hanging on to the idea of using the RAN# register at some point in the program, but hoping to qualify for another category :-)

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[42S] MANT Challenge - Werner - 01-22-2014, 09:40 AM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 08:58 PM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 09:40 PM
RE: [42S] MANT Challenge - Gerson W. Barbosa - 01-23-2014 02:52 AM
RE: [42S] MANT Challenge - Werner - 01-22-2014, 12:38 PM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 01:46 PM
RE: [42S] MANT Challenge - Werner - 01-22-2014, 02:17 PM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 02:24 PM
RE: [42S] MANT Challenge - Werner - 01-22-2014, 02:34 PM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 06:50 PM
RE: [42S] MANT Challenge - Dieter - 01-22-2014, 07:53 PM
RE: [42S] MANT Challenge - Thomas Klemm - 01-23-2014, 12:40 AM
RE: [42S] MANT Challenge - Werner - 01-23-2014, 07:46 AM
RE: [42S] MANT Challenge - Werner - 01-23-2014, 09:34 AM
RE: [42S] MANT Challenge - Werner - 01-23-2014, 11:02 AM
RE: [42S] MANT Challenge - walter b - 01-23-2014, 12:07 PM
RE: [42S] MANT Challenge - Dieter - 01-23-2014, 03:15 PM
RE: [42S] MANT Challenge - Dieter - 01-23-2014, 08:19 PM
RE: [42S] MANT Challenge - Werner - 01-23-2014, 09:06 PM
RE: [42S] MANT Challenge - Dieter - 01-23-2014, 09:53 PM
RE: [42S] MANT Challenge - walter b - 01-24-2014, 08:15 AM
RE: [42S] MANT Challenge - Werner - 01-24-2014, 06:16 AM



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