Re: [racket-dev] Inferring numeric function types from representative argument values

2013-01-04 Thread Neil Toronto
On 01/04/2013 10:38 AM, Vincent St-Amour wrote: At Thu, 03 Jan 2013 21:09:52 -0700, Neil Toronto wrote: I thought it would be helpful to find the most precise types possible for numeric functions. I wrote a program that infers them using a few thousand representative argument values, which have

Re: [racket-dev] Inferring numeric function types from representative argument values

2013-01-04 Thread Vincent St-Amour
At Thu, 03 Jan 2013 21:09:52 -0700, Neil Toronto wrote: > > I thought it would be helpful to find the most precise types possible > for numeric functions. I wrote a program that infers them using a few > thousand representative argument values, which have been chosen to > exhibit underflow, ove

Re: [racket-dev] Inferring numeric function types from representative argument values

2013-01-04 Thread Matthew Flatt
At Thu, 03 Jan 2013 21:09:52 -0700, Neil Toronto wrote: > 1. Implementation of `sqrt': most Single-Float-Complex inputs yield > Float-Complex outputs. The type is sane, but the behavior isn't: > > > (sqrt 1.0f0+5.2f0i) > - : Single-Flonum-Complex > 1.7741590586312472+1.465482

Re: [racket-dev] Inferring numeric function types from representative argument values

2013-01-04 Thread Sam Tobin-Hochstadt
On Thu, Jan 3, 2013 at 11:09 PM, Neil Toronto wrote: > (In particular, platform-independent Index and Fixnum types scare me.) Platform-independent Fixnum is easy -- just if |x| <= 2^30, then x is a fixnum on all platforms Racket supports. [1] Index is a little trickier, since it's not documented

[racket-dev] Inferring numeric function types from representative argument values

2013-01-03 Thread Neil Toronto
I thought it would be helpful to find the most precise types possible for numeric functions. I wrote a program that infers them using a few thousand representative argument values, which have been chosen to exhibit underflow, overflow, exactness preservation (e.g. perfect squares for `sqrt' and