Changes between Version 20 and Version 21 of FlonumsCowan


Ignore:
Timestamp:
09/16/16 16:55:19 (11 months ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FlonumsCowan

    v20 v21  
    9090`fl-integer-exponent-zero` 
    9191 
    92 Bound to whatever value is returned by `(flinteger-binary-log 0)`.  (C99 `FP_ILOGB0`) 
     92Bound to whatever exact integer is returned by `(flinteger-binary-log 0)`.  (C99 `FP_ILOGB0`) 
    9393 
    9494`fl-integer-exponent-nan` 
    9595 
    96 Bound to whatever value is returned by `(flinteger-binary-log +0.nan)`.  (C99 `FP_ILOGBNAN`) 
     96Bound to whatever exact integer is returned by `(flinteger-binary-log +0.nan)`.  (C99 `FP_ILOGBNAN`) 
    9797 
    9898`fl-radix` 
    9999 
    100 Value of the floating-point radix (2 on most machines). 
     100Bound to the floating-point radix as an exact integer (2 on most machines).  (C99 `FLT_RADIX`) 
    101101 
    102102== Constructors == 
     
    113113 
    114114Returns a flonum whose magnitude is the magnitude of ''x'' and whose sign is the sign of ''y''.  (C99 `copysign`) 
     115 
     116`(make-flonum `''x n''`)` 
     117 
     118Returns the flonum (fl* x (expt 2 n)), where ''n'' is a non-negative integer with an implementation-dependent maximum value.  (C99 `ldexp`) 
     119 
     120`(make-binary-flonum `''x n''`)` 
     121 
     122Returns the flonum (fl* x (expt fl-radix n)), where ''n'' is a non-negative integer with an implementation-dependent maximum value.  (C99 `scalbn`) 
     123 
     124=== Accessors === 
     125 
     126`(flinteger-fraction `''x''`)` 
     127 
     128Returns two values, the integral part of ''x'' as a flonum and the fractional part of ''x'' as a flonum.  (C99 `modf`) 
     129 
     130`(flexponent `''x''`)` 
     131 
     132Returns the value of `(* (fltrunc (fllog (flabs x) fl-radix)) (flsgn x))`.  (C99 `logb`) 
     133 
     134`(flinteger-exponent `''x''`)` 
     135 
     136Returns the same as `flexponent` as an exact integer.  If ''x'' is zero, returns `fl-integer-exponent-zero`; if ''x'' is a NaN, returns `fl-integer-exponent-nan`; if ''x'' is infinite, returns a large implementation-dependent exact integer.  (C99 `ilogb`) 
     137 
     138`(flnormalized-fraction-exponent `''x''`)` 
     139 
     140Returns two values, a correctly signed fraction ''y'' whose absolute value is between 0.5 (inclusive) and 1.0 (exclusive), and an exponent ''n'' such that `(fl* y (flexpt 2 n))` is equal to ''x''.  (C99 `frexp`) 
    115141 
    116142=== Predicates === 
     
    170196 
    171197Returns `(fl+ (fl* x y) z)`, possibly faster.  If the constant `fl-fast-fl+*` 
    172 is `#f`, it will definitely be faster.  (C99 `fma`) 
     198is `#t`, it will definitely be faster.  (C99 `fma`) 
    173199 
    174200`(fl- `''x y'' ...`)` 
     
    239265=== Exponents and logarithms === 
    240266 
    241 {{{ 
    242 flexp   double exp(double)      ex 
    243 fl2     double exp2(double)     base-2 exponential 
    244 flexp-minus-1   double expm1(double)    exp-1 
    245 flsquare 
    246 flsqrt 
    247 flcbrt  double cbrt(double)     cube root 
    248 flhypot double hypot(double, double)    sqrt(x2+y2) 
    249 flexp 
    250 fl2exp  double ldexp(double x, int n)   x*2n 
    251 flexponent      double logb(double x)   the exponent of x, 
    252 which is the integral part of 
    253 log_r(|x|), as a signed floating-point value, for non-zero x, 
    254 where r is the radix of the machine's floating-point arithmetic 
    255 flfraction-exponent     double modf(double, double * 
    256 returns two values, fraction and int exponent 
    257 flinteger-exponent      int ilogb(double)       binary log as int 
    258 fllog 
    259 fllog2  double log2(double)     log base 2 
    260 fllog10 double log10(double)    log base 10 
    261 fllog+1 double log1p(double x)  log (1+x) 
    262 flnormalized-fraction-exponent  double frexp(double, int *) 
    263 returns two values, fraction in range [1/2,1) and int exponent 
    264 flscalbn        double scalbn(double x, int y)  x*ry, 
    265 where r is the machine float radix 
    266 }}} 
    267  
    268 The `flsqrt` procedure returns the principal square root of ''x''. For -0.0, 
     267`(flexp `''x''`)` 
     268 
     269Corresponds to `exp`. 
     270 
     271`(flexp2 `''x''`)` 
     272 
     273Corresponds to `(expt 2.0 x)`.  (C99 `exp2`) 
     274 
     275`(flexp-1 `''x''`)` 
     276 
     277Equivalent to `(flexp (fl- x 1))`, but is much more accurate for values of x near 1.  It is recommended for use in algorithms where accuracy is important.  (C99 `expm1`) 
     278 
     279`(flsquare `''x''`)` 
     280 
     281Returns the square of ''x''. 
     282 
     283`(flsqrt `''x''`)` 
     284 
     285Returns the principal square root of ''x''. For -0.0, 
    269286`flsqrt` should return -0.0. 
    270287 
    271 The `flexpt` procedure returns ''x'' raised to the power ''y'' 
     288`(flcbrt `''x''`)` 
     289 
     290Returns the cube root of ''x''. 
     291 
     292`(flhypot `''x y''`)` 
     293 
     294Returns `(flsqrt (+ (flsquare x) (flsquare y))). 
     295 
     296`(flexpt `''x y''`)` 
     297 
     298Returns ''x'' raised to the power ''y'' 
    272299if ''x'' is non-negative or ''y'' is an integral flonum.  If ''x'' is 
    273300negative and ''y'' is not an integer, the result may be a 
     
    275302the result is zero. 
    276303 
     304`(fllog `''x''`)` 
     305 
     306Returns the natural logarithm of ''x''. 
     307 
     308`(fllog1+ `''x''`)` 
     309 
     310Equivalent to `(fllog (fl+ 1 x))`, but is much more accurate for values of x near 1.  It is recommended for use in algorithms where accuracy is important.  (C99 `log1p`) 
     311 
     312`(fllog2 `''x''`)` 
     313 
     314Returns the base-2 logarithm of ''x''. 
     315 
     316`(fllog10 `''x''`)` 
     317 
     318Returns the base-10 logarithm of ''x''. 
     319 
    277320=== Trigonometric functions === 
    278321 
    279 `(flsin `''x''`)`  (C99 `sin`) 
    280  
    281 `(flcos `''x''`)`  (C99 `cos`) 
    282  
    283 `(fltan `''x''`)`  (C99 `tan`) 
    284  
    285 `(flasin `''x''`)`  (C99 `asin`) 
    286  
    287 `(flacos `''x''`)`  (C99 `acos`) 
    288  
    289 `(flatan `''x'' [''y'']`)`  (C99 `atan` and `atan2`) 
    290  
    291 `(flsinh `''x''`)`  (C99 `sinh`) 
    292  
    293 `(flcosh `''x''`)`  (C99 `cosh`) 
    294  
    295 `(fltanh `''x''`)`  (C99 `tanh`) 
    296  
    297 `(flasinh `''x''`)`  (C99 `asinh`) 
    298  
    299 `(flacosh `''x''`)`  (C99 `acosh`) 
    300  
    301 `(flatanh `''x''`)`  (C99 `atanh`) 
    302  
    303 These are the usual trigonometric functions. The `flatan` function, when passed two arguments, returns `(flatan (/ y x))` without requiring the use of complex numbers. 
    304  
    305 `(flremquo `''x y''`)` 
    306  
    307 Returns two values, the result of `(flround-remainder x y)` and the low-order ''n'' bits (as a correctly signed exact integer) of the rounded quotient.  The value of ''n'' is implementation-dependent but at least 3.  This function can be used to reduce the argument of the inverse trigonometric functions, while preserving the correct quadrant or octant. 
     322`(flsin `''x''`)` 
     323 
     324`(flcos `''x''`)` 
     325 
     326`(fltan `''x''`)` 
     327 
     328`(flasin `''x''`)` 
     329 
     330`(flacos `''x''`)` 
     331 
     332`(flatan `''x'' [''y'']`)` 
     333 
     334`(flsinh `''x''`)` 
     335 
     336`(flcosh `''x''`)` 
     337 
     338`(fltanh `''x''`)` 
     339 
     340`(flasinh `''x''`)` 
     341 
     342`(flacosh `''x''`)` 
     343 
     344`(flatanh `''x''`)` 
     345 
     346These are the usual trigonometric functions. The `flatan` function, when passed two arguments, returns `(flatan (/ y x))` without requiring the use of complex numbers (C99 `atan2`). 
    308347 
    309348 
     
    324363except that it is an error if the arguments are not flonums. 
    325364 
     365`(flremquo `''x y''`)` 
     366 
     367Returns two values, the result of `(flround-remainder x y)` and the low-order ''n'' bits (as a correctly signed exact integer) of the rounded quotient.  The value of ''n'' is implementation-dependent but at least 3.  This function can be used to reduce the argument of the inverse trigonometric functions, while preserving the correct quadrant or octant. 
     368 
    326369=== Special functions === 
    327370