Marc:
This code:
(define-prim (##integer->char x))
relies on ##integer->char being inlined by the compiler.
Well, if you just update to git head, it isn't, so running gsi or gsc gives an infinite loop (that can't be killed with ^C, you need to ^Z it and then "kill -9" it).
I guess it's time for a new point release.
Brad
Afficher les réponses par date
On Jan 29, 2014, at 10:40 PM, Bradley Lucier lucier@math.purdue.edu wrote:
Marc:
This code:
(define-prim (##integer->char x))
relies on ##integer->char being inlined by the compiler.
Well, if you just update to git head, it isn't, so running gsi or gsc gives an infinite loop (that can't be killed with ^C, you need to ^Z it and then "kill -9" it).
I guess it's time for a new point release.
Brad
Ah the joys of a bootstrapped compiler…
You can fix this (temporarily) with
(define-prim (##integer->char x) (##fx->char x))
Marc
On Jan 29, 2014, at 10:40 PM, Bradley Lucier lucier@math.purdue.edu wrote:
I guess it's time for a new point release.
Forgot to add that I’ll be doing a release later today.
Marc
On Jan 30, 2014, at 8:32 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
On Jan 29, 2014, at 10:40 PM, Bradley Lucier lucier@math.purdue.edu wrote:
I guess it's time for a new point release.
Forgot to add that I’ll be doing a release later today.
Sorry but the release will have to wait. I have just discovered that the hyperbolic math functions aren’t implemented by the Microsoft C compiler I am using, so I have to find a workaround before I can release.
Anyone know of a good portable implementation of those functions (sinh, cosh, tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I’ll take a poor implementation if a good one doesn’t exist...
Marc
Sure, I'll send you something this evening or tomorrow. Brad
On Jan 30, 2014, at 4:27 PM, Marc Feeley feeley@iro.umontreal.ca wrote:
On Jan 30, 2014, at 8:32 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
On Jan 29, 2014, at 10:40 PM, Bradley Lucier lucier@math.purdue.edu wrote:
I guess it's time for a new point release.
Forgot to add that I’ll be doing a release later today.
Sorry but the release will have to wait. I have just discovered that the hyperbolic math functions aren’t implemented by the Microsoft C compiler I am using, so I have to find a workaround before I can release.
Anyone know of a good portable implementation of those functions (sinh, cosh, tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I’ll take a poor implementation if a good one doesn’t exist...
Marc
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca wrote:
Anyone know of a good portable implementation of those functions (sinh, cosh, tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
On Jan 30, 2014, at 5:43 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca wrote:
Anyone know of a good portable implementation of those functions (sinh, cosh, tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
Yes, this library is a good option (I don't know whether FreeBSD made many changes to the original Sun library).
Brad
On Thu, 30 Jan 2014 17:51:26 EST Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 30, 2014, at 5:43 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca wrote:
Anyone know of a good portable implementation of those functions
(sinh, cosh,
tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
Yes, this library is a good option (I don't know whether FreeBSD made many changes to the original Sun library).
There have been a number of changes, support for more arch, long double, complex number versions, performance imrovements, fixes, etc. etc. You can trawl through its history to see what was done. I don't use them enough to know of their accuracy and I don't know if exhaustive tests are run regularly. You should talk to Bruce Evans and David Schultz for details.
Perhaps for this particular environment where the C compiler doesn't bundle the required math functions (= only Microsoft?), a proper behavior would be for the configure script to check for optional availability of this external support library for the same math functions (the msun library or similar choice) and if so link it in but for basis provide an internal implementation that's focused on being short and toti-compatible?
2014-01-31 Bakul Shah bakul@bitblocks.com
On Thu, 30 Jan 2014 17:51:26 EST Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 30, 2014, at 5:43 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca
wrote:
Anyone know of a good portable implementation of those functions
(sinh, cosh,
tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
Yes, this library is a good option (I don't know whether FreeBSD made many changes to the original Sun library).
There have been a number of changes, support for more arch, long double, complex number versions, performance imrovements, fixes, etc. etc. You can trawl through its history to see what was done. I don't use them enough to know of their accuracy and I don't know if exhaustive tests are run regularly. You should talk to Bruce Evans and David Schultz for details. _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Jan 30, 2014, at 6:21 PM, Bakul Shah bakul@bitblocks.com wrote:
On Thu, 30 Jan 2014 17:51:26 EST Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 30, 2014, at 5:43 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca wrote:
Anyone know of a good portable implementation of those functions
(sinh, cosh,
tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
Yes, this library is a good option (I don't know whether FreeBSD made many changes to the original Sun library).
There have been a number of changes, support for more arch, long double, complex number versions, performance imrovements, fixes, etc. etc. You can trawl through its history to see what was done. I don't use them enough to know of their accuracy and I don't know if exhaustive tests are run regularly. You should talk to Bruce Evans and David Schultz for details.
Unfortunately the C code in those library function is very low-level (it directly accesses the bit pattern of the floats). So I don’t consider them very portable.
On the bright side I have tested MSCV and sinh, cosh, tanh are available in math.h (at least in versions 10, 11 and 12). So that leaves asinh, acosh, atanh, scalbn, ilogb, expm1, and log1p to implement.
Brad: we’ll definitely need some unit tests for these functions to make sure that switching to the Gambit internal implementation has the precision we need.
Marc
On 01/31/2014 10:29 AM, Marc Feeley wrote:
Unfortunately the C code in those library function is very low-level (it directly accesses the bit pattern of the floats). So I don’t consider them very portable.
They look at the bits because all processors now put the bits in the same place. If a function isn't written in assembler, I'd consider it portable.
On the bright side I have tested MSCV and sinh, cosh, tanh are available in math.h (at least in versions 10, 11 and 12). So that leaves asinh, acosh, atanh, scalbn, ilogb, expm1, and log1p to implement.
Brad: we’ll definitely need some unit tests for these functions to make sure that switching to the Gambit internal implementation has the precision we need.
To have the same precision as glibc, for example, is an unreasonable goal; I'm not the world expert on implementing elementary functions. Having reasonable precision is a reasonable goal.
Brad
On Fri, 31 Jan 2014 11:02:07 EST Bradley Lucier lucier@math.purdue.edu wrote:
On 01/31/2014 10:29 AM, Marc Feeley wrote:
Unfortunately the C code in those library function is very low-level (it di
rectly accesses the bit pattern of the floats). So I dont consider them very portable.
They look at the bits because all processors now put the bits in the same place. If a function isn't written in assembler, I'd consider it portable.
I agree. I don't think you can even do the right thing (except perhaps laboriously) in every case without looking at the raw bits. ilogb for instance.
On 01/31/2014 10:29 AM, Marc Feeley wrote:
On the bright side I have tested MSCV and sinh, cosh, tanh are available in math.h (at least in versions 10, 11 and 12). So that leaves asinh, acosh, atanh, scalbn, ilogb, expm1, and log1p to implement.
Use frexp and ldexp for ilogb and scalbn.
Brad
On 01/30/2014 06:21 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 17:51:26 EST Bradley Lucier lucier@math.purdue.edu wrote:
On Jan 30, 2014, at 5:43 PM, Bakul Shah wrote:
On Thu, 30 Jan 2014 16:27:11 EST Marc Feeley feeley@iro.umontreal.ca wrote:
Anyone know of a good portable implementation of those functions
(sinh, cosh,
tanh, asinh, acosh, atanh, expm1, log1p, scalbn)? I'll take a poor implementation if a good one doesn't exist...
May be you can use FreeBSD's math lib (originally from Sun). https://github.com/freebsd/freebsd/tree/master/lib/msun
Yes, this library is a good option (I don't know whether FreeBSD made many changes to the original Sun library).
There have been a number of changes, support for more arch, long double, complex number versions, performance imrovements, fixes, etc. etc. You can trawl through its history to see what was done. I don't use them enough to know of their accuracy and I don't know if exhaustive tests are run regularly. You should talk to Bruce Evans and David Schultz for details.
I trust Sun's library, we need only six functions, I'd use the version of Sun's library in FreeBSD:
https://github.com/freebsd/freebsd-head/tree/master/lib/msun/src
Brad