Ieee fast square root
This presentation is the property of its rightful owner.
Sponsored Links
1 / 13

IEEE Fast Square Root PowerPoint PPT Presentation


  • 63 Views
  • Uploaded on
  • Presentation posted in: General

IEEE Fast Square Root. Ref: Graphics Gems III; 2 Spring 2003. Motivation. Square root operations are frequently used in many applications (e.g., computer graphics) Usually speed is more important than accuracy Is there any way faster than sqrt( )? Idea: tabulated sqrt!.

Download Presentation

IEEE Fast Square Root

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Ieee fast square root

IEEE Fast Square Root

Ref: Graphics Gems III; 2

Spring 2003


Motivation

Motivation

  • Square root operations are frequently used in many applications (e.g., computer graphics)

  • Usually speed is more important than accuracy

  • Is there any way faster than sqrt( )?

    • Idea: tabulated sqrt!


Math background

Negative exponents: same!

Math Background

For 52-bit mantissa (double), only limited cases need to be computed: 2252 entries; each entry with 52 bits


Abridged table

Abridged Table

  • Sacrifice accuracy for smaller tables

  • Indexed by first 13 bits of mantissa only

    • Only 2213 entries; each entry with 20 significant binary bits

  • Further accuracy, if required, can be obtained by one or two Newton iterations, using the tabulated value as initial guess

Try this yourself!


How numbers are stored in memory

B7

B6

B5

B4

B3

B2

B1

B0

How Numbers are Stored in Memory

Conceptually:

SEEEEEEEEEEEMMMM MMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMM

B0

B1

B2

B3

B4

B5

B6

B7

Stored (on PC): byte swapping; Least Significant Byte first

Byte swapping:

Cautious when exchanging binary files and direct data access;

But when we read/operate as the declared data, do not need to worry (it reads backward)

This is why the examiner works


Byte swapping cont

Byte Swapping (cont)

short 1029: 0x 0405

int 218+5: 0x 0040 0005

float 3.5: 0x 4060 0000

double 3.5: 0x 400c 0000 0000 0000

Use this program to see for yourself


Implementation

Implementation

Setup Table

Evaluation


Details access m s byte

B7

B6

B5

B4

B3

B2

B1

B0

Details: access M.S.Byte

f

fi


Ieee fast square root

13

7

MMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMM SEEEEEEEEEEEMMMM MMMMMMMMMMMMMMMM

f

fi


Evaluation

Evaluation


Time a function

Time a function


Example

Example


Ieee fast square root

Twice faster; but note the overhead for building up the tables


  • Login