[gambit-list] Proposed patch

Bradley Lucier lucier at math.purdue.edu
Mon Dec 9 22:28:39 EST 2013


I think we could have more discussion of proposed patches on this list, 
if we like.

So here's a proposed patch for your consideration, with a real changelog 
entry ;-):

lib/_num#.scm: Add (macro-inexact-+pi/4) and (macro-inexact-+3pi/4).

lib/_num.scm: Add ##flsquare, ##square, and square.  Add 
##exact-int.negative?
Use it in ##abs.  Add functions from Kahan's paper: ##kahan.abs, 
##kahan.arg,
##kahan.cssqs, ##kahan.csqrt, ##kahan.cacos, ##kahan.casin, ##kahan.casinh,
##kahan.catanh, ##kahan.ctanh, ##kahan.ctan; and constants ##kahan.omega,
##kahan.epsilon, ##kahan.lambda.  Add functions ##conjugate and conjugate.
In ##log, use ##fllog1p for arguments near 1. In ##sin and ##cos, use 
real trigonometric
and hyperbolic functions for complex arguments.  In ##tan, use ##tanh 
for complex
arguments.  In ##casin, use ##kahan.casin. In ##acos, use ##kahan.acos. In
##atan, use ##atanh.  In ##atan2, use Kahan's conventions for infinite 
arguments.
##sinh, sinh, ##cosh, cosh, ##tanh, tanh, ##asinh, asinh, ##acosh, 
acosh, ##atanh,
atanh: New functions.  In ##sqrt: Use ##kahan.csqrt for complex 
arguments. In
##magnitude: use ##exact-int.negative? for ratnum arguments and 
##kahan.abs for
complex arguments.

lib:gambit#.scm: Add entries for acosh, asinh, atanh, conjugate, cosh, 
sinh, square,
and atanh.

Marc: I'd like to have the compiler recognize ##flsquare.

I'll attach the patch.  I would really appreciate any comments.

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hyp.patch
Type: text/x-patch
Size: 33506 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20131209/5b05fd8a/attachment.bin>


More information about the Gambit-list mailing list