I noticed that Weregoose created an algorithm to simplify a radical, but I found that using brute force is actually much more successful. This program will take a number or a square root as input, and will simplify it, for example, √(200, will simplify to 10√(2, all in easily less than a second. This program accepts both square roots as input, and the actually squared number, so 14.14213562 (√(200)) is valid input and so is just the number 200. They will both output 10√(2. But it gets better. Not only can this program handle square roots, it can handle cubed roots or any root you can think of just by storing the value to L1 as a one dimensional list. For example,

Input =54

Right now the program is mildly buggy, but works very well otherwise. If something doesn't simplify that should, try putting it under the square root sign instead (or cubed root or whatever). While the calculator should be evaluating this in it's code, I find that doing this helps a lot for some reason. Anyway, here's the code:
BASIC Code wrote:
:If 1≠dim(L1
:Disp "Root set to:",L1(1
:Input "Input =",A
:Lbl θ0
:If 0≠fPart(A
:If not(fPart(Z^x^√(A
:Disp "Perfect square:",Z^x^√(A
:If not(fPart(A/θ^Z
:Disp θ
Generated by SourceCoder, © 2005-2012 Cemetech

The little x followed by the square root sign is the root sign under [MATH][5]
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum