Search the web
Sign In
New User? Sign Up
z390-assembler-contest · z390 Mainframe Assembler Coding Contest
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
ZMFACC z390 Mainframe Assembler Coding Contest Update 02/22/08 - 5 n   Message List  
Reply | Forward Message #55 of 70 |
Re: [z390-assembler-contest] ZMFACC z390 Mainframe Assembler Coding Contest Update 02/22/08 - 5 new solutions and 1 new problem

On Saturday 23 Feb 2008 02:05, Don Higgins wrote:
> 4.      I've posted 2 additional solutions for problem 12 calculation of
> standard deviation.  Now there are 3 solutions; one using BFP, one using
> HFP, and one using just DFP instructions.  The DFP solution proved to be
> more challenging than expected as the latest POP (at least for today) is
> missing the opcode SQXTR corresponding to the existing SQXBR and SQXR used
> in the other solutions.  As a result I have coded a substitute SQXTR macro
> which calls standalone SQXTR CSECT which uses DFP instructions to perform
> the square root function using Newton Raphson method.  For the current
> problem it converged to 34 digit solution in 7 iterations.  Suggestions for
> improving the first guess will help.  Note all 3 solutions produce the same
> result to 33+ decimal places.

This web page:
http://www.mactech.com/articles/mactech/Vol.14/14.01/FastSquareRootCalc/
describes how to use a table to obtain a more accurate first approximation.
Given that the first approximation has a known maximum error, it should be
possible to compute the maximum number of iterations required to
guarantee convergance. This saves an iteration, since the final iteration
is there just to prove convergance (the result does not improve on the final
iteration). Given that the number of iterations is fixed (and small!),
you can also fully unroll the loop.

--
Martin

martin@... http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/



Sat Feb 23, 2008 9:47 am

mward3484
Offline Offline
Send Email Send Email

Forward
Message #55 of 70 |
Expand Messages Author Sort by Date

All Visit the ZMFACC contest web site for links to source code and output logs plus new problems: ...
Don Higgins
dsh33782
Offline Send Email
Feb 23, 2008
2:06 am

... This web page: http://www.mactech.com/articles/mactech/Vol.14/14.01/FastSquareRootCalc/ describes how to use a table to obtain a more accurate first...
Martin Ward
mward3484
Offline Send Email
Feb 23, 2008
11:48 am

Martin Thanks, after SHARE I'll take a run at optimizing the SQXTR routine. The emulator pz390.java code for the SQXBR and SQXR routines actually uses Math ...
Don Higgins
dsh33782
Offline Send Email
Feb 23, 2008
12:46 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help