## Question: How does GL compute sin(x)?

### Question: How does GL compute sin(x)?

QUESTION:  how does GL compute sin(x) and cos(x) when performing:

rot(x, axis);                   /* this uses floats */

or:

rotate(x, axis);                /* this uses shorts */

are these computed in software or are they closer to the hardware -
i.e. hardwired into the graphics engine somehow, or assembly instructions for
the f.p. unit?

"rotate" seems to be faster than "rot" on a number of architectures - are there
shortcuts involved because the former operates on 'low percision' shorts?

thanks,
Mike

### Question: How does GL compute sin(x)?

|>
|>
|> QUESTION:  how does GL compute sin(x) and cos(x) when performing:
|>
|> rot(x, axis);                     /* this uses floats */
|>
|> or:
|>
|> rotate(x, axis);          /* this uses shorts */
|>
|>
|> are these computed in software or are they closer to the hardware -
|> i.e. hardwired into the graphics engine somehow, or assembly
instructions for
|> the f.p. unit?
|>
|> "rotate" seems to be faster than "rot" on a number of architectures -
are there
|> shortcuts involved because the former operates on 'low percision' shorts?
|>

both routines call the same subroutine.
(The angle in rotate is multiplied by 0.1 first)
I don't know what would explain the difference?

The subroutine they both call is supported in hardware
on some platforms and software on others.

ChrisF

|> thanks,
|> Mike
|>

### Question: How does GL compute sin(x)?

|>
|>
|> QUESTION:  how does GL compute sin(x) and cos(x) when performing:
|>
|> rot(x, axis);                     /* this uses floats */
|>
|> or:
|>
|> rotate(x, axis);          /* this uses shorts */
|>
[stuff deleted]

both routines call the same subroutine.
(The angle in rotate is multiplied by 0.1 first)
I don't know what would explain the difference?

[it appears "rotate" executes FASTER on many architectures]

The subroutine they both call is supported in hardware
on some platforms and software on others.

i was looking for more specific information - what architectures use which and
are the subroutines/hardware operations user accessible?  presumbably someone
spent some time making these run fast, and i'd like to take advantage of that
speed when i'm computing my own transformations.

is there a similar situation with "sqrt" computation - i.e., are there fast
subroutines or hardware that compute square root, such that it is user
accessible?

-Mike

*******************************************************************************
Mike Marr