> Hello!
> 
> I need to deal with functions of type (Double -> Double). I need Fourier 
> transform, integration, + - * / operations, value of a function in a point, 
> probably composition.
> 
> However it is not very effective to use straightforwardly this type. Since 
> functions in question are rather smooth (if not analytical), the best option 
> would be to use some kind of pointwise representation (e.g. lists, arrays). 
> But in this case the code wouldn't be so easy to understand and implement, 
> compact and so on.
> 
> Is there some libraries which allow me to work with functions as if their 
> type was (Double -> Double), but indeed it was something faster?

Lazy polynomial splines: http://hackage.haskell.org/package/lazysplines

Lazy polynomial splines are potentially infinite sequences of segments 
represented by polynomials. They're a very straightforward abstraction for 
functions which can be treated as piecewise analytic. They provide efficient 
addition, subtraction integration and differentiation. Multiplication and 
composition can be more expensive, and division by a non-scalar can, if one is 
not careful, be somewhat disastrous. The package was intended as much as a 
proof-of-concept as for production. But the concept is simple enough that you 
should be able to tune it to your needs.

Cheers,
Gershom
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to