Hello Peter:

The system ROM of the Model 100 laptop has one error within its logarithm
table.  I don't consider this as "weird", but results returned by the
transcendental functions (e.g., COSine functiob) can be deleteriously
influenced by the error.  Rather than "some early model 100s" being
afflicted, my understanding is that the erroneous logarithm table is present
in the system ROM of all Model 100 laptops regardless of manufacturing date.

The system ROM of the Model 102 laptop and Model 200 laptop does not have an
erroneous logarithm table -- Tandy corrected the error when these subsequent
laptop models were manufactured.

Below is an email conversation between Gerson Barbose and I.

============================================================================
> ----- Original Message ----- 
> From: Gerson W. Barbosa
> To: Ron Wiesen
> Sent: Sunday, September 19, 2010 3:22 PM
> Subject: Re: An Accurate Approximation of the Constant Pi in the Model 100
> Laptop -- Was: Re: Jake's blog
> 
> 
> 
> Hello Ron,
> Kudos for your excellent Sun Compass program! I had already taken a look
at
> the result of the 27th Anniversary Model 100 Programming Contest, it's
> incredible what talented programers can do with these vintage machines
even
> today!
> Regarding the problem to resolve Pi on the Model 100 laptop, the problem
> doesn't lie in the trigonometric identity PI=4*ATN(1). Of course anyone
trying
> to approximate pi to 14 digits using the series arctan(x) = x - x^3/3 +
> x^5/5 - x^7/7... using this identity (by replacing x with 1 and
multiplying
> the result by 4) would soon discover that task would be practically
> impossible, as the series converges more and more slowly as x approaches
to 1.
> Arcantangent algorithms to compute pi using that series usually to it for
> arguments in a limited range and then use a trigonometric identity to
compute
> the arguments out of that range, this is what is called range reduction.
In
> the case of the Model 100 BASIC (and other Microsoft BASICs), for
arguments in
> the range 0 to 2-sqrt(3) the function is calculated by means of of
polynomial
> aproximation thus requiring only eight coefficients to yield 14-digit
> accuracy, which are slightly different from the ones in the series (1,
1/3,
> 1/5, 1/7, ...)  :
>   1.0000000000000
>  -.33333333333160
>   .19999999948967
>  -.14285708554884
>   .11110794184029
>  -.09081343224705
>   .07530714913480
>  -.05208693904000
> For arguments out of the range, the function is calculated as
>  arctan(x)=(pi/6 + arctan((|x|*srqt(3) - 1)/(|x| + sqrt(3)))) * x/|x|,
> for    (2 - sqrt(3)) < |x| <= 1;
> 
>  arctan(x) = (pi/2 - arctan(1/|x|) * x/|x|,
> for                        |x| > 1;
> 
> The arctangent function implementation in the Model 100 laptop should be
ok.
> However, it appears someone mistyped the constant  -.14285708554884
> as -.142856708554884 when preparing the production ROM, something like the
> Pentium bug but in a lesser scale.
> In the m100 that 56 in the constant is encoded in ROM address 13247
(33BFh),
> if it is changed to 57h (by burning a new ROM or EPROM), the problem
> disappears.
> Some years ago I implemented the trigonometric functions in the HP-12C
> Platinum calculator, which lacks them, so I had to do some research. If
you're
> interested, more information is available at
> http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=654
> The references there are interesting, particularly Robin's Green paper
(Faster
> Math Functions)
> I also implemented the trigometric function in Turbo Pascal (BCD version),
as
> a way to document the algorithms in a higher level language:
> http://www.geocities.ws/gwbarbosa/prgms_4.html
> That made some sense because the BCD version was meant for financial
> applications, and therefore it lacked trigs.
> 
> You're using a large argument to get pi accurate to 14 digits is a clever
> solution. I had thought of the less simple 3*ATN(SQR(3)). Although this
does
> solve the problem for pi, it does not solve the arctangent problem. I have
> noticed ATN is used many times in your program. Anyway, since the function
> always delivers at least 10 correct digits, no practical problem would
arise
> from this minor problem.
> I have included excerpts of my email messages to Rick Hanson, who kindly
> replied them and suggested me to post the finding here. I hope it
clarifies
> all maters.
> Best regards,
> Gerson.
============================================================================

The manual that Tandy included with Model 100 sales contains a BASIC
language example with a method of obtaining the constant Pi.  As I recall,
the method Tandy published is based upon the BASIC expression 4*ATN(1).  Due
to the error within the log table of the Model 100, the result is erroneous.
Because Tandy corrected the error in the log table of the Model 102 (and
Model 200), the BASIC expression 4*ATN(1) obtains a correct value of Pi.

Because I wanted my Sun Compass program to produce an accurate North compass
bearing regardless of which Tandy laptop model is at play, the Sun Compass
program uses the BASIC expression 4*ATN(1) in order to obtain the correct
value of Pi.  My Inductor LoadeD RADiator antenna modelling program (ILDRAD)
also uses the BASIC expression 4*ATN(1) -- ILDRAD lines 0, 100, and 102 are
relevant and are shown below.

============================================================================
0 IFPI#THENELSE100'If Pi is defined then pass through to next line, elsewise
Pi is not defined (i.e., resolved as zero) because initial assignment of
constants and variables has not been made -- go make those initial
assignments
100 'Initial assignment of constants and variables
102 PI#=2*ATN(3D13)'Constant Pi approximation for all laptop Models
(100/102/200) based on value of 3D13 being a sufficiently close
approximation to infinity
============================================================================

Here's a demonstration.  Invoke the BASIC interpreter, type the following
BASIC statement, and then look at the two resulting 14-digit results.

?4*ATN(1)"wrong in Model 100":?2*ATN(3D13)"correct in all models"

The 14-digit results differ if this is done with a Model 100 laptop.  The
results are identical and correct if this is done with other laptop models.

Keeper of the Primordial Bit (mother of all bits), -= Ron Wiesen =-


-----Original Message-----
From: M100 [mailto:m100-boun...@lists.bitchin100.com] On Behalf Of Peter
Vollan
Sent: Wednesday, August 12, 2015 18:56
To: Model 100 Discussion
Subject: [M100] math error

Refresh my memory about that weird math error that some early model 100s
have

Reply via email to