Re: [racket] Typed Racket Performance Optimization

2012-05-10 Thread Hendrik Boom
On Thu, May 10, 2012 at 08:55:06AM -0400, Ray Racine wrote: > It was late... but the penny dropped this morning. Consider the domain of > log (x) for x<0. Where log a multivalued function, and none of the values are real. Acually, the logarithm function complex numbers is multivalued even when

Re: [racket] Typed Racket Performance Optimization

2012-05-10 Thread Ray Racine
It was late... but the penny dropped this morning. Consider the domain of log (x) for x<0. On Thu, May 10, 2012 at 8:38 AM, Vincent St-Amour wrote: > As Neil said, `fllog' is guaranteed to return floats. > > If you want to know for which input types `log' has a return type of > `Float', you can

Re: [racket] Typed Racket Performance Optimization

2012-05-10 Thread Vincent St-Amour
As Neil said, `fllog' is guaranteed to return floats. If you want to know for which input types `log' has a return type of `Float', you can use `:query-result-type' at the TR REPL. -> (:query-result-type log Float) (case-> (Nonnegative-Flonum -> Float) (Float-Zero -> Negative-Float)) If

Re: [racket] Typed Racket Performance Optimization

2012-05-09 Thread Neil Toronto
I (require racket/flonum) and use `fllog'. Neil ⊥ On 05/09/2012 09:52 PM, Ray Racine wrote: The Typed Racket Performance button in DrRacket informs me that (log v) returns a Complex type, despite all its arguments being reals and that if I do not want or expect a complex number as results, I ma

[racket] Typed Racket Performance Optimization

2012-05-09 Thread Ray Racine
The Typed Racket Performance button in DrRacket informs me that (log v) returns a Complex type, despite all its arguments being reals and that if I do not want or expect a complex number as results, I mam restrict the type of the arguments. How does one do that? #lang typed/racket/base (: real-l