News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Square root

Started by Farabi, January 02, 2013, 09:57:03 PM

Previous topic - Next topic

Farabi

What is the difference between original squareroot with reciprocal squareroot?
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

qWord

squareroot  =  sqrt(x)
reciprocal squareroot = 1/sqrt(x)

::)
MREAL macros - when you need floating point arithmetic while assembling!

dedndave

sqr(2)/2 = 1/sqr(2)   :P

Gunther

Dave,

Quote from: dedndave on January 03, 2013, 02:34:53 AM
sqr(2)/2 = 1/sqr(2)   :P

that's a special case!

Gunther
You have to know the facts before you can distort them.

dedndave

not too special
there are an infinite number of such cases   :P

Vortex

It's easy :

sqrt(x) / x = 1 / sqrt(x)

Donkey

Square root and reciprocal square root

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Gunther

Hi Dave,

Quote from: dedndave on January 03, 2013, 04:55:25 AM
not too special
there are an infinite number of such cases   :P

my point was the division by 2. :lol:

Hi Vortex,

Quote from: Vortex on January 03, 2013, 05:19:14 AM
It's easy :

sqrt(x) / x = 1 / sqrt(x)

yes, of course.

Gunther

You have to know the facts before you can distort them.

Vortex

Oops, an important statement is missing if we are in R3 :

sqrt(x) / x = 1 / sqrt(x)

with the condition :

x > 0

qWord

Quote from: Vortex on January 03, 2013, 06:04:35 AM
Oops, an important statement is missing if we are in R3 :

sqrt(x) / x = 1 / sqrt(x)

with the condition :

x > 0
also true for complex numbers.
MREAL macros - when you need floating point arithmetic while assembling!

Vortex

Off-topic : There are mental square root calculators with amazing capabilities. The art is to use cleverly the algorithms.

FORTRANS

Quote from: Vortex on January 03, 2013, 06:28:20 AM
Off-topic : There are mental square root calculators with amazing capabilities. The art is to use cleverly the algorithms.

Hi,

   Yeah, in high school there were two of us that could do
square roots on the fly.  For whatever reason, one semester
we were doing them.  I can't even find the procedure to do
it now.  (Rats.)  Or at least, the procedures I can find don't
seem to be usable with out paper and pencil.  (Hmm,  It was
while ago, late sixties.  Might be a clue?)

   Remember slide rules?  Log tables?

Cheers,

Steve N.

dedndave

it isn't hard
you deal with 2 input digits and one root digit at a time
then, basically a trial and error thing   :P
if the 2 digits are 20, you know the root digit is between 4 and 5 - use 4
then do the next 2 input digits

KeepingRealBusy

Quote from: FORTRANS on January 03, 2013, 08:00:04 AM
Quote from: Vortex on January 03, 2013, 06:28:20 AM
Off-topic : There are mental square root calculators with amazing capabilities. The art is to use cleverly the algorithms.

Hi,

   Yeah, in high school there were two of us that could do
square roots on the fly.  For whatever reason, one semester
we were doing them.  I can't even find the procedure to do
it now.  (Rats.)  Or at least, the procedures I can find don't
seem to be usable with out paper and pencil.  (Hmm,  It was
while ago, late sixties.  Might be a clue?)

   Remember slide rules?  Log tables?

Cheers,

Steve N.

I have the solution for you if you want it, along with several other methods I dreamed up and timed. I was doing the square root of BIG NUMS (up to 64 KB).

OBTW, the paper and pencil method came from a 1930's electronics text book my Dad had.

Dave.

raymond

QuoteI was doing the square root of BIG NUMS (up to 64 KB).

Curious to know which method you were using, binary or decimal with decimal input?
Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com