On Nov 25, 2013, at 3:30 PM, Bradley Lucier lucier@math.purdue.edu wrote:
Marc:
I have the following definitions in a file I'm using when updating Gambit's trigonometric (and adding hyperbolic) functions:
;;; #include <math.h> is in gambit.h
(define ##scalbn (c-lambda (double int) double "scalbn")) (define ##ilogb (c-lambda (double) int "ilogb"))
(define ##flsinh (c-lambda (double) double "sinh")) (define ##flcosh (c-lambda (double) double "cosh")) (define ##fltanh (c-lambda (double) double "tanh"))
(define ##flasinh (c-lambda (double) double "asinh")) (define ##flacosh (c-lambda (double) double "acosh")) (define ##flatanh (c-lambda (double) double "atanh"))
(define ##fllog1p (c-lambda (double) double "log1p")) (define ##flexpm1 (c-lambda (double) double "expm1"))
It would be really helpful for me if these could be added to gambit.h, the compiler, and _num.scm; then I could just propose patches to _num.scm for my changes, which will come in stages.
Also, it would be good to know whether these are available on all systems that Gambit runs on.
Brad
These primitives have now been added. It would be nice to also have generic versions (sinh, cosh, etc). Brad, can you implement these in _num.scm? The hardest part is determining what the branch cuts are.
Are there more Schemish names for scalbn, ilogb, expm1 and log1p? I kind of like that they are the same as in C, but if there is are names for these things in other Schemes, then I'm open to change the names for compatibility reasons.
Marc