#### Archived

This topic is now archived and is closed to further replies.

This topic is 5502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have been writing a program for my TI-83 that simplifies radicals. For example, if you enter 512, it tells you that that is 16 * radical(2). I simply take the square root of the number entered and start at the largest integer not more than that square root, and decrease the number by one in each iteration. For each number, I square it, and if the square divides evenly into the original number (ex. 512), you factor that number out, and you are done. However, this is very slow when you start working with large numbers. Does anyone know of an algorithm or equation that is more efficient? Thanks! ----------------------------- Weeks of programming can save you hours of planning. There are 10 kinds of people in this world-- those who understand binary and those who don''t.

##### Share on other sites
What is this for?

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

##### Share on other sites
This is not homework. I''m trying to make a program on my calculator to do this so I can compare the speed of an algorithm that evaluates, say, the square root of 162 compared to one that evaluates nine times the square root of two. I''m trying a few different approaches to a fast square root- I know that this has been done millions of times before, but I get a lot of satisfaction from figuring these things out myself.

-----------------------------
Weeks of programming can save you hours of planning.

There are 10 kinds of people in this world-- those who understand binary and those who don''t.

##### Share on other sites
I''ve got an idea. Say you have a "large" number like 5,012. First bitshift all the way to the right to isolate digit 5. Now, since this is base 10, you know that 5,000 equals 5 * 10 * 10 * 10. And you know you had to bitshift 3 times (ie 10 ^<b>3</b> by previously taking the length of the integer. So on the outside of the radical you already have 10*radical(10*5). Well, is that a start?

-leinad (my acct has been banned for some reason)

##### Share on other sites
That''s an interesting idea. One question, though- if I understand you right, you would end up with an answer like 50 radical(2) + 2 radical(3), correct? This is not actually what I was going for (I meant simplest radical form), but I''ll try it out for efficiency anyway!

-----------------------------
Weeks of programming can save you hours of planning.

There are 10 kinds of people in this world-- those who understand binary and those who don''t.

##### Share on other sites
no, (a + b) ^ .5 != a^.5 + b^.5. I just didn''t finish the algorithm. That would be a problem. It could even be a bad approach.

##### Share on other sites
Oh, of course. I wasn''t thinking that through. So how would your algorithm work?

##### Share on other sites
I don''t know it was a guess.

##### Share on other sites
Perhaps it would be better to start at the bottom - since, for example, it''s very likely to have a sqrt(2) in it. You could go from 2 to sqrt of your number, checking if you get a perfect square when you divide your number by it.

##### Share on other sites
BTW, you''re not really simplifying radicals in general - you''re only doing square roots. Perhaps there is a way to optimize it for square roots...

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5

• 10
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633402
• Total Posts
3011670
• ### Who's Online (See full list)

There are no registered users currently online

×