lkml.org 
[lkml]   [2004]   [Mar]   [17]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 18 Mar 2004 10:21:05 +1100
FromPeter Williams <>
SubjectRe: arithmetic functions for linux driver
VINOD GOPAL wrote:
> Hi,>  I am new to linux world and this mailing list.
> 
>  I need to use the arithmetic functions like sin, cos,
> exp, log, etc in linux device driver.
> 
>  On search read , not to use libm from kernel driver
> as it will harm the fpu registers.
> 
>   Do you have any insight how to support these
> functions in linux driver or any code that is
> available which I can make use of?

I'd recommend using fixed denominator rational numbers to represent real 
numbers and polynomial approximations for the transcendental functions. 
  We do this in our EBS scheduler patches and it seems to be successful. 
  The main downside to this approach is the limited range (and 
precision) of values that can be represented so you need to have a clear 
idea of the likely values at various stages of your calculations.

The "Handbook of Mathematical Functions" by Abramowitz and Stegun, Dover 
Publications, New York ISBN 486-61272-4 (LCN 65-12253) is a good source 
of methods for approximating functions.

If you'd like more detailed assistance don't hesitate to ask.

Peter
-- 
Dr Peter Williams, Chief Scientist                peterw@aurema.com
Aurema Pty Limited                                Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia  Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [from the cache]
©2003-2008