Comments Bradley Lucier (22 Sep 2016 18:39 UTC)
Re: Comments John Cowan (22 Sep 2016 20:55 UTC)
Re: Comments Bradley Lucier (23 Sep 2016 01:22 UTC)
Re: Comments Bradley Lucier (23 Sep 2016 01:28 UTC)

Comments Bradley Lucier 22 Sep 2016 18:32 UTC

1.  Under  (flonum number)  you state

  Returns the closest flonum equivalent to number in the sense of = and <.

I don't know what this means.  (I'm presuming that I'm an example of a
person who should understand everything in this SRFI.)

2.  Under  (make-binary-flonum x n) it says

  Returns the flonum (fl* x (expt fl-radix n)), where n is a
non-negative integer with an implementation-dependent maximum value.
(C99 scalbn)

Why is this "make-binary-flonum", when "make-flonum" assumes that the
fl-radix is 2?

3. Under (flinteger-fraction x) it says

  Returns two values, the integral part of x as a flonum and the
fractional part of x as a flonum. (C99 modf)

This site http://en.cppreference.com/w/cpp/numeric/math/modf gives a
much more detailed specification of modf.

In general, this SRFI does not specify what is returned by many
functions when the arguments are +inf.0, -inf.0, or a Not-a-Number (NaN).

Is this SRFI meant just as a FFI interface to C library routines, or as
something different?

4. Under (flnormalized-fraction-exponent x) you use the form

(fl* y (flexpt 2 n))

flexpt takes flonum arguments; "2" is not a flonum; is "n" supposed to
be a flonum?

5.  Under (flinteger? x`)‌‌, (flodd? ix), (fleven? ix), you don't state
what happens with infinite arguments.  Does flodd? and fleven? assume
that (flinteger? x) is true?

6.  Under (fl+* x y z), you state

  Returns (fl+ (fl* x y) z), possibly faster. If the constant
fl-fast-fl+* is #t, it will definitely be faster. (C99 fma)

To my understanding, the point is not that fma is faster (even if that
is generally true), but that it's more accurate, i.e., that it is
computed as if x*y+z is computed exactly and then only one rounding is
applied.  I would be more interested in a constant fl-accurate-fl+*
rather than fl-fast-fl+*.

7. Under (flnumerator x) and (flnumerator x) you don't specify what
happens with infinities and NaNs.

8. Under (flexp-1 x) you want it to mean (- (exp x) 1).

9.  Under (flsqrt x) I think you want that (flsqrt x) is NaN for x < 0.

10. Under (fllog x) I think you want that (fllog x) is NaN for x < 0.

11.  I think you should prefix first-bessel,  second-bessel, erf, and
erfc with fl.

12.  Generally speaking, I don't know what type an argument "n" is
supposed to be.  An exact integer?  A floating-point integer?

In general, again, I wonder whether you want this formally to be just a
renaming and thin FFI layer over the C library functions.  There seem to
be some functions that are not from the C library; perhaps these would
need to be more carefully specified than functions that take their
meanings from the C library.

Brad