a68g-mp.h

     
   1  //! @file a68g-mp.h
   2  //! @author J. Marcel van der Veer
   3  
   4  //! @section Copyright
   5  //!
   6  //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
   7  //! Copyright 2001-2024 J. Marcel van der Veer [algol68g@xs4all.nl].
   8  
   9  //! @section License
  10  //!
  11  //! This program is free software; you can redistribute it and/or modify it 
  12  //! under the terms of the GNU General Public License as published by the 
  13  //! Free Software Foundation; either version 3 of the License, or 
  14  //! (at your option) any later version.
  15  //!
  16  //! This program is distributed in the hope that it will be useful, but 
  17  //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  18  //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
  19  //! more details. You should have received a copy of the GNU General Public 
  20  //! License along with this program. If not, see [http://www.gnu.org/licenses/].
  21  
  22  //! @section Synopsis
  23  //!
  24  //! Definitions for multiple precision modes.
  25  
  26  #if !defined (__A68G_MP_H__)
  27  #define __A68G_MP_H__
  28  
  29  // A68G's multiprecision algorithms are not suited for more than a few hundred
  30  // digits. This is however sufficient for most practical MP applications.
  31  
  32  #define MP_MAX_DECIMALS 250
  33  #define MP_MAX_DIGITS (1 + MP_MAX_DECIMALS / LOG_MP_RADIX)
  34  
  35  #define MP_STATUS(z) ((z)[0])
  36  #define MP_EXPONENT(z) ((z)[1])
  37  #define MP_DIGIT(z, n) ((z)[(n) + 1])
  38  #define MP_SIGN(z) (SIGN (MP_DIGIT (z, 1)))
  39  #define LEN_MP(digs) (2 + digs)
  40  #define SIZE_MP(digs) A68_ALIGN (LEN_MP (digs) * sizeof (MP_T))
  41  #define IS_ZERO_MP(z) (MP_DIGIT (z, 1) == (MP_T) 0)
  42  
  43  #define PLUS_INF_MP(u) ((UNSIGNED_T) MP_STATUS (u) & PLUS_INF_MASK)
  44  #define MINUS_INF_MP(u) ((UNSIGNED_T) MP_STATUS (u) & MINUS_INF_MASK)
  45  #define INF_MP(u) (PLUS_INF_MP (u) || MINUS_INF_MP (u))
  46  #define CHECK_LONG_REAL(p, u, moid) PRELUDE_ERROR (INF_MP (u), p, ERROR_INFINITE, moid)
  47  
  48  static inline MP_T *set_mp (MP_T * z, MP_T x, INT_T expo, int digs)
  49  {
  50    a68_bufset (z, 0, SIZE_MP (digs));
  51    MP_STATUS (z) = (MP_T) INIT_MASK;
  52    MP_DIGIT (z, 1) = x;
  53    MP_EXPONENT (z) = (MP_T) expo;
  54    return z;
  55  }
  56  
  57  static inline MP_T *move_mp (MP_T *z, MP_T *x, int N) 
  58  {
  59    MP_T *y = z;
  60    N += 2;
  61    while (N--) {
  62      *z++ = *x++;
  63    }
  64    return y;
  65  }
  66  
  67  static inline MP_T *move_mp_part (MP_T *z, MP_T *x, int N) 
  68  {
  69    MP_T *y = z;
  70    while (N--) {
  71      *z++ = *x++;
  72    }
  73    return y;
  74  }
  75  
  76  static inline void check_mp_exp (NODE_T *p, MP_T *z) 
  77  {
  78    MP_T expo = (MP_EXPONENT (z) < 0 ? -MP_EXPONENT (z) : MP_EXPONENT (z));
  79    if (expo > MAX_MP_EXPONENT || (expo == MAX_MP_EXPONENT && ABS (MP_DIGIT (z, 1)) > (MP_T) 1)) {
  80      errno = EDOM;
  81      diagnostic (A68_RUNTIME_ERROR, p, ERROR_MP_OUT_OF_BOUNDS, NULL);
  82      extern void exit_genie (NODE_T *, int);
  83      exit_genie (p, A68_RUNTIME_ERROR);
  84    }
  85  }
  86  
  87  static inline MP_T *mp_one (int digs)
  88  {
  89    if (digs > A68_MP (mp_one_size)) {
  90      if (A68_MP (mp_one) != (MP_T *) NULL) {
  91        a68_free (A68_MP (mp_one));
  92      }
  93      A68_MP (mp_one) = (MP_T *) get_heap_space (SIZE_MP (digs));
  94      set_mp (A68_MP (mp_one), 1, 0, digs);
  95    }
  96    return A68_MP (mp_one);
  97  }
  98  
  99  static inline MP_T *lit_mp (NODE_T *p, MP_T u, INT_T expo, int digs)
 100  {
 101    ADDR_T pop_sp = A68_SP;
 102    if ((A68_SP += SIZE_MP (digs)) > A68 (expr_stack_limit)) {
 103      diagnostic (A68_RUNTIME_ERROR, p, ERROR_STACK_OVERFLOW);
 104      extern void exit_genie (NODE_T *, int);
 105      exit_genie (p, A68_RUNTIME_ERROR);
 106    }
 107    MP_T *z = (MP_T *) STACK_ADDRESS (pop_sp);
 108    (void) set_mp (z, u, expo, digs);
 109    return z;
 110  }
 111  
 112  static inline MP_T *nil_mp (NODE_T *p, int digs)
 113  {
 114    ADDR_T pop_sp = A68_SP;
 115    if ((A68_SP += SIZE_MP (digs)) > A68 (expr_stack_limit)) {
 116      diagnostic (A68_RUNTIME_ERROR, p, ERROR_STACK_OVERFLOW);
 117      extern void exit_genie (NODE_T *, int);
 118      exit_genie (p, A68_RUNTIME_ERROR);
 119    }
 120    MP_T *z = (MP_T *) STACK_ADDRESS (pop_sp);
 121    (void) set_mp (z, 0, 0, digs);
 122    return z;
 123  }
 124  
 125  static inline MP_T *empty_mp (NODE_T *p, int digs)
 126  {
 127    ADDR_T pop_sp = A68_SP;
 128    if ((A68_SP += SIZE_MP (digs)) > A68 (expr_stack_limit)) {
 129      diagnostic (A68_RUNTIME_ERROR, p, ERROR_STACK_OVERFLOW);
 130      extern void exit_genie (NODE_T *, int);
 131      exit_genie (p, A68_RUNTIME_ERROR);
 132    }
 133    return (MP_T *) STACK_ADDRESS (pop_sp);
 134  }
 135  
 136  extern MP_T *lengthen_mp (NODE_T *, MP_T *, int, MP_T *, int);
 137  
 138  static inline MP_T *len_mp (NODE_T *p, MP_T *u, int digs, int gdigs)
 139  {
 140    ADDR_T pop_sp = A68_SP;
 141    if ((A68_SP += SIZE_MP (gdigs)) > A68 (expr_stack_limit)) {
 142      diagnostic (A68_RUNTIME_ERROR, p, ERROR_STACK_OVERFLOW);
 143      extern void exit_genie (NODE_T *, int);
 144      exit_genie (p, A68_RUNTIME_ERROR);
 145    }
 146    MP_T *z = (MP_T *) STACK_ADDRESS (pop_sp);
 147    for (int k = 1; k <= digs; k++) {
 148      MP_DIGIT (z, k) = MP_DIGIT (u, k);
 149    }
 150    for (int k = digs + 1; k <= gdigs; k++) {
 151      MP_DIGIT (z, k) = (MP_T) 0;
 152    }
 153    MP_EXPONENT (z) = MP_EXPONENT (u);
 154    MP_STATUS (z) = MP_STATUS (u);
 155    return z;
 156  }
 157  
 158  static inline MP_T *cut_mp (NODE_T *p, MP_T *u, int digs, int gdigs)
 159  {
 160    ADDR_T pop_sp = A68_SP;
 161    ASSERT (digs > gdigs);
 162    BOOL_T neg = MP_DIGIT (u, 1) < 0;
 163    if ((A68_SP += SIZE_MP (gdigs)) > A68 (expr_stack_limit)) {
 164      diagnostic (A68_RUNTIME_ERROR, p, ERROR_STACK_OVERFLOW);
 165      extern void exit_genie (NODE_T *, int);
 166      exit_genie (p, A68_RUNTIME_ERROR);
 167    }
 168    MP_T *z = (MP_T *) STACK_ADDRESS (pop_sp);
 169    for (int k = 1; k <= gdigs; k++) {
 170      MP_DIGIT (z, k) = MP_DIGIT (u, k);
 171    }
 172    if (neg) {
 173      MP_DIGIT (z, 1) = -MP_DIGIT (z, 1);
 174    }
 175    if (MP_DIGIT (u, gdigs + 1) >= MP_RADIX / 2) {
 176      MP_DIGIT (z, gdigs) += 1;
 177      for (int k = digs; k >= 2 && MP_DIGIT (z, k) == MP_RADIX; k --) {
 178        MP_DIGIT (z, k) = 0;
 179        MP_DIGIT (z, k - 1) ++;
 180      }
 181    }
 182    if (neg) {
 183      MP_DIGIT (z, 1) = -MP_DIGIT (z, 1);
 184    }
 185    MP_EXPONENT (z) = MP_EXPONENT (u);
 186    MP_STATUS (z) = MP_STATUS (u);
 187    return z;
 188  }
 189  
 190  //! @brief Length in bytes of a long mp number.
 191  
 192  static inline size_t size_mp (void)
 193  {
 194    return (size_t) SIZE_MP (LONG_MP_DIGITS);
 195  }
 196  
 197  //! @brief Length in digits of a long mp number.
 198  
 199  static inline int mp_digits (void)
 200  {
 201    return LONG_MP_DIGITS;
 202  }
 203  
 204  //! @brief Length in bytes of a long long mp number.
 205  
 206  static inline size_t size_long_mp (void)
 207  {
 208    return (size_t) (SIZE_MP (A68_MP (varying_mp_digits)));
 209  }
 210  
 211  //! @brief digits in a long mp number.
 212  
 213  static inline int long_mp_digits (void)
 214  {
 215    return A68_MP (varying_mp_digits);
 216  }
 217  
 218  #define SET_MP_ZERO(z, digits)\
 219    (void) set_mp ((z), 0, 0, digits);
 220  
 221  #define SET_MP_ONE(z, digits)\
 222    (void) set_mp ((z), (MP_T) 1, 0, digits);
 223  
 224  #define SET_MP_MINUS_ONE(z, digits)\
 225    (void) set_mp ((z), (MP_T) -1, 0, digits);
 226  
 227  #define SET_MP_HALF(z, digits)\
 228    (void) set_mp ((z), (MP_T) (MP_RADIX / 2), -1, digits);
 229  
 230  #define SET_MP_MINUS_HALF(z, digits)\
 231    (void) set_mp ((z), (MP_T) -(MP_RADIX / 2), -1, digits);
 232  
 233  #define SET_MP_QUART(z, digits)\
 234    (void) set_mp ((z), (MP_T) (MP_RADIX / 4), -1, digits);
 235  
 236  enum {MP_SQRT_PI, MP_PI, MP_LN_PI, MP_SQRT_TWO_PI, MP_TWO_PI, MP_HALF_PI, MP_180_OVER_PI, MP_PI_OVER_180};
 237  
 238  // If MP_DOUBLE_PRECISION is defined functions are evaluated in double precision.
 239  
 240  #undef MP_DOUBLE_PRECISION
 241  
 242  #define MINIMUM(x, y) ((x) < (y) ? (x) : (y))
 243  
 244  // GUARD_DIGITS: number of guard digits.
 245  
 246  #if defined (MP_DOUBLE_PRECISION)
 247  #define GUARD_DIGITS(digits) (digits)
 248  #else
 249  #define GUARD_DIGITS(digits) (2)
 250  #endif
 251  
 252  #define FUN_DIGITS(n) ((n) + GUARD_DIGITS (n))
 253  
 254  BOOL_T check_mp_int (MP_T *, const MOID_T *);
 255  BOOL_T same_mp (NODE_T *, MP_T *, MP_T *, int);
 256  int long_mp_digits (void);
 257  INT_T mp_to_int (NODE_T *, MP_T *, int);
 258  int width_to_mp_digits (int);
 259  MP_T *abs_mp (NODE_T *, MP_T *, MP_T *, int);
 260  MP_T *acosdg_mp (NODE_T *, MP_T *, MP_T *, int);
 261  MP_T *acosh_mp (NODE_T *, MP_T *, MP_T *, int);
 262  MP_T *acos_mp (NODE_T *, MP_T *, MP_T *, int);
 263  MP_T *acotdg_mp (NODE_T *, MP_T *, MP_T *, int);
 264  MP_T *acot_mp (NODE_T *, MP_T *, MP_T *, int);
 265  MP_T *acsc_mp (NODE_T *, MP_T *, MP_T *, int);
 266  MP_T *acscdg_mp (NODE_T *, MP_T *, MP_T *, int);
 267  MP_T *add_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 268  MP_T *align_mp (MP_T *, INT_T *, int);
 269  MP_T *asec_mp (NODE_T *, MP_T *, MP_T *, int);
 270  MP_T *asecdg_mp (NODE_T *, MP_T *, MP_T *, int);
 271  MP_T *asindg_mp (NODE_T *, MP_T *, MP_T *, int);
 272  MP_T *asinh_mp (NODE_T *, MP_T *, MP_T *, int);
 273  MP_T *asin_mp (NODE_T *, MP_T *, MP_T *, int);
 274  MP_T *atan2dg_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 275  MP_T *atan2_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 276  MP_T *atandg_mp (NODE_T *, MP_T *, MP_T *, int);
 277  MP_T *atanh_mp (NODE_T *, MP_T *, MP_T *, int);
 278  MP_T *atan_mp (NODE_T *, MP_T *, MP_T *, int);
 279  MP_T *beta_inc_mp (NODE_T *, MP_T *, MP_T *, MP_T *, MP_T *, int);
 280  MP_T *beta_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 281  MP_T *cacosh_mp (NODE_T *, MP_T *, MP_T *, int);
 282  MP_T *cacos_mp (NODE_T *, MP_T *, MP_T *, int);
 283  MP_T *casinh_mp (NODE_T *, MP_T *, MP_T *, int);
 284  MP_T *casin_mp (NODE_T *, MP_T *, MP_T *, int);
 285  MP_T *catanh_mp (NODE_T *, MP_T *, MP_T *, int);
 286  MP_T *catan_mp (NODE_T *, MP_T *, MP_T *, int);
 287  MP_T *ccosh_mp (NODE_T *, MP_T *, MP_T *, int);
 288  MP_T *ccos_mp (NODE_T *, MP_T *, MP_T *, int);
 289  MP_T *cdiv_mp (NODE_T *, MP_T *, MP_T *, MP_T *, MP_T *, int);
 290  MP_T *cexp_mp (NODE_T *, MP_T *, MP_T *, int);
 291  MP_T *cln_mp (NODE_T *, MP_T *, MP_T *, int);
 292  MP_T *cmul_mp (NODE_T *, MP_T *, MP_T *, MP_T *, MP_T *, int);
 293  MP_T *cosdg_mp (NODE_T *, MP_T *, MP_T *, int);
 294  MP_T *cosh_mp (NODE_T *, MP_T *, MP_T *, int);
 295  MP_T *cas_mp (NODE_T *, MP_T *, MP_T *, int);
 296  MP_T *cos_mp (NODE_T *, MP_T *, MP_T *, int);
 297  MP_T *cospi_mp (NODE_T *, MP_T *, MP_T *, int);
 298  MP_T *cotdg_mp (NODE_T *, MP_T *, MP_T *, int);
 299  MP_T *cot_mp (NODE_T *, MP_T *, MP_T *, int);
 300  MP_T *cotpi_mp (NODE_T *, MP_T *, MP_T *, int);
 301  MP_T *csc_mp (NODE_T *, MP_T *, MP_T *, int);
 302  MP_T *cscdg_mp (NODE_T *, MP_T *, MP_T *, int);
 303  MP_T *csinh_mp (NODE_T *, MP_T *, MP_T *, int);
 304  MP_T *csin_mp (NODE_T *, MP_T *, MP_T *, int);
 305  MP_T *csqrt_mp (NODE_T *, MP_T *, MP_T *, int);
 306  MP_T *ctanh_mp (NODE_T *, MP_T *, MP_T *, int);
 307  MP_T *ctan_mp (NODE_T *, MP_T *, MP_T *, int);
 308  MP_T *curt_mp (NODE_T *, MP_T *, MP_T *, int);
 309  MP_T *div_mp_digit (NODE_T *, MP_T *, MP_T *, MP_T, int);
 310  MP_T *div_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 311  MP_T *entier_mp (NODE_T *, MP_T *, MP_T *, int);
 312  MP_T *erfc_mp (NODE_T *, MP_T *, MP_T *, int);
 313  MP_T *erf_mp (NODE_T *, MP_T *, MP_T *, int);
 314  MP_T *expm1_mp (NODE_T *, MP_T *, MP_T *, int);
 315  MP_T *exp_mp (NODE_T *, MP_T *, MP_T *, int);
 316  MP_T *floor_mp (NODE_T *, MP_T *, MP_T *, int);
 317  MP_T *gamma_inc_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 318  MP_T *gamma_mp (NODE_T *, MP_T *, MP_T *, int);
 319  MP_T *half_mp (NODE_T *, MP_T *, MP_T *, int);
 320  MP_T *hyp_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 321  MP_T *hypot_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 322  MP_T *int_to_mp (NODE_T *, MP_T *, INT_T, int);
 323  MP_T *inverfc_mp (NODE_T *, MP_T *, MP_T *, int);
 324  MP_T *inverf_mp (NODE_T *, MP_T *, MP_T *, int);
 325  MP_T *lnbeta_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 326  MP_T *lngamma_mp (NODE_T *, MP_T *, MP_T *, int);
 327  MP_T *ln_mp (NODE_T *, MP_T *, MP_T *, int);
 328  MP_T *log_mp (NODE_T *, MP_T *, MP_T *, int);
 329  MP_T *minus_mp (NODE_T *, MP_T *, MP_T *, int);
 330  MP_T *minus_one_mp (NODE_T *, MP_T *, MP_T *, int);
 331  MP_T *mod_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 332  MP_T *mp_ln_10 (NODE_T *, MP_T *, int);
 333  MP_T *mp_ln_scale (NODE_T *, MP_T *, int);
 334  MP_T *mp_pi (NODE_T *, MP_T *, int, int);
 335  MP_T *ten_up_mp (NODE_T *, MP_T *, int, int);
 336  MP_T *mul_mp_digit (NODE_T *, MP_T *, MP_T *, MP_T, int);
 337  MP_T *mul_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 338  MP_T *one_minus_mp (NODE_T *, MP_T *, MP_T *, int);
 339  MP_T *over_mp_digit (NODE_T *, MP_T *, MP_T *, MP_T, int);
 340  MP_T *over_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 341  MP_T *plus_one_mp (NODE_T *, MP_T *, MP_T *, int);
 342  MP_T *pow_mp_int (NODE_T *, MP_T *, MP_T *, INT_T, int);
 343  MP_T *pow_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 344  MP_T *real_to_mp (NODE_T *, MP_T *, REAL_T, int);
 345  MP_T *rec_mp (NODE_T *, MP_T *, MP_T *, int);
 346  MP_T *round_mp (NODE_T *, MP_T *, MP_T *, int);
 347  MP_T *sec_mp (NODE_T *, MP_T *, MP_T *, int);
 348  MP_T *secdg_mp (NODE_T *, MP_T *, MP_T *, int);
 349  MP_T *set_mp (MP_T *, MP_T, INT_T, int);
 350  MP_T *shorten_mp (NODE_T *, MP_T *, int, MP_T *, int);
 351  MP_T *sindg_mp (NODE_T *, MP_T *, MP_T *, int);
 352  MP_T *sinh_mp (NODE_T *, MP_T *, MP_T *, int);
 353  MP_T *sin_mp (NODE_T *, MP_T *, MP_T *, int);
 354  MP_T *sinpi_mp (NODE_T *, MP_T *, MP_T *, int);
 355  MP_T *sqrt_mp (NODE_T *, MP_T *, MP_T *, int);
 356  MP_T *strtomp (NODE_T *, MP_T *, char *, int);
 357  MP_T *sub_mp (NODE_T *, MP_T *, MP_T *, MP_T *, int);
 358  MP_T *tandg_mp (NODE_T *, MP_T *, MP_T *, int);
 359  MP_T *tanh_mp (NODE_T *, MP_T *, MP_T *, int);
 360  MP_T *tan_mp (NODE_T *, MP_T *, MP_T *, int);
 361  MP_T *tanpi_mp (NODE_T *, MP_T *, MP_T *, int);
 362  MP_T *tenth_mp (NODE_T *, MP_T *, MP_T *, int);
 363  MP_T *trunc_mp (NODE_T *, MP_T *, MP_T *, int);
 364  MP_T *unt_to_mp (NODE_T *, MP_T *, UNSIGNED_T, int);
 365  REAL_T mp_to_real (NODE_T *, MP_T *, int);
 366  void eq_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 367  void ge_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 368  void genie_pi_mp (NODE_T *);
 369  void gt_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 370  void le_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 371  void lt_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 372  void ne_mp (NODE_T *, A68_BOOL *, MP_T *, MP_T *, int);
 373  void raw_write_mp (char *, MP_T *, int);
 374  void set_long_mp_digits (int);
 375  void test_mp_int_range (NODE_T *, MP_T *, MOID_T *);
 376  
 377  GPROC genie_infinity_mp;
 378  GPROC genie_minus_infinity_mp;
 379  GPROC genie_beta_inc_mp;
 380  GPROC genie_gamma_inc_mp;
 381  GPROC genie_gamma_inc_f_mp;
 382  GPROC genie_gamma_inc_g_mp;
 383  GPROC genie_gamma_inc_h_mp;
 384  GPROC genie_gamma_inc_gf_mp;
 385  GPROC genie_abs_mp;
 386  GPROC genie_abs_mp_complex;
 387  GPROC genie_acosdg_mp;
 388  GPROC genie_acosdg_mp;
 389  GPROC genie_acosh_mp;
 390  GPROC genie_acosh_mp_complex;
 391  GPROC genie_acos_mp;
 392  GPROC genie_acos_mp_complex;
 393  GPROC genie_acotdg_mp;
 394  GPROC genie_acot_mp;
 395  GPROC genie_asec_mp;
 396  GPROC genie_asecdg_mp;
 397  GPROC genie_acsc_mp;
 398  GPROC genie_acscdg_mp;
 399  GPROC genie_add_mp;
 400  GPROC genie_add_mp_complex;
 401  GPROC genie_and_mp;
 402  GPROC genie_arg_mp_complex;
 403  GPROC genie_asindg_mp;
 404  GPROC genie_asindg_mp;
 405  GPROC genie_asinh_mp;
 406  GPROC genie_asinh_mp_complex;
 407  GPROC genie_asin_mp;
 408  GPROC genie_asin_mp_complex;
 409  GPROC genie_atan2_mp;
 410  GPROC genie_atandg_mp;
 411  GPROC genie_atan2dg_mp;
 412  GPROC genie_atanh_mp;
 413  GPROC genie_atanh_mp_complex;
 414  GPROC genie_atan_mp;
 415  GPROC genie_atan_mp_complex;
 416  GPROC genie_bin_mp;
 417  GPROC genie_clear_long_mp_bits;
 418  GPROC genie_conj_mp_complex;
 419  GPROC genie_cosdg_mp;
 420  GPROC genie_cosh_mp;
 421  GPROC genie_cosh_mp_complex;
 422  GPROC genie_cas_mp;
 423  GPROC genie_cos_mp;
 424  GPROC genie_cos_mp_complex;
 425  GPROC genie_cospi_mp;
 426  GPROC genie_cotdg_mp;
 427  GPROC genie_cot_mp;
 428  GPROC genie_sec_mp;
 429  GPROC genie_secdg_mp;
 430  GPROC genie_csc_mp;
 431  GPROC genie_cscdg_mp;
 432  GPROC genie_cotpi_mp;
 433  GPROC genie_curt_mp;
 434  GPROC genie_divab_mp;
 435  GPROC genie_divab_mp_complex;
 436  GPROC genie_div_mp;
 437  GPROC genie_div_mp_complex;
 438  GPROC genie_elem_long_mp_bits;
 439  GPROC genie_elem_long_mp_bits;
 440  GPROC genie_entier_mp;
 441  GPROC genie_eq_mp;
 442  GPROC genie_eq_mp_complex;
 443  GPROC genie_erfc_mp;
 444  GPROC genie_erf_mp;
 445  GPROC genie_exp_mp;
 446  GPROC genie_exp_mp_complex;
 447  GPROC genie_gamma_mp;
 448  GPROC genie_lngamma_mp;
 449  GPROC genie_beta_mp;
 450  GPROC genie_lnbeta_mp;
 451  GPROC genie_ge_mp;
 452  GPROC genie_get_long_mp_bits;
 453  GPROC genie_get_long_mp_complex;
 454  GPROC genie_get_long_mp_int;
 455  GPROC genie_get_long_mp_real;
 456  GPROC genie_get_mp_complex;
 457  GPROC genie_gt_mp;
 458  GPROC genie_im_mp_complex;
 459  GPROC genie_inverfc_mp;
 460  GPROC genie_inverf_mp;
 461  GPROC genie_le_mp;
 462  GPROC genie_lengthen_complex_to_mp_complex;
 463  GPROC genie_lengthen_int_to_mp;
 464  GPROC genie_lengthen_mp_complex_to_long_mp_complex;
 465  GPROC genie_lengthen_mp_to_long_mp;
 466  GPROC genie_lengthen_real_to_mp;
 467  GPROC genie_lengthen_unt_to_mp;
 468  GPROC genie_ln_mp;
 469  GPROC genie_ln_mp_complex;
 470  GPROC genie_log_mp;
 471  GPROC genie_long_mp_bits_width;
 472  GPROC genie_long_mp_exp_width;
 473  GPROC genie_long_mp_int_width;
 474  GPROC genie_long_mp_max_bits;
 475  GPROC genie_long_mp_max_int;
 476  GPROC genie_long_mp_max_real;
 477  GPROC genie_long_mp_min_real;
 478  GPROC genie_long_mp_real_width;
 479  GPROC genie_long_mp_small_real;
 480  GPROC genie_lt_mp;
 481  GPROC genie_minusab_mp;
 482  GPROC genie_minusab_mp_complex;
 483  GPROC genie_minus_mp;
 484  GPROC genie_minus_mp_complex;
 485  GPROC genie_modab_mp;
 486  GPROC genie_mod_mp;
 487  GPROC genie_mul_mp;
 488  GPROC genie_mul_mp_complex;
 489  GPROC genie_ne_mp;
 490  GPROC genie_ne_mp_complex;
 491  GPROC genie_not_mp;
 492  GPROC genie_odd_mp;
 493  GPROC genie_or_mp;
 494  GPROC genie_overab_mp;
 495  GPROC genie_over_mp;
 496  GPROC genie_pi_mp;
 497  GPROC genie_plusab_mp;
 498  GPROC genie_plusab_mp_complex;
 499  GPROC genie_pow_mp;
 500  GPROC genie_pow_mp_complex_int;
 501  GPROC genie_pow_mp_int;
 502  GPROC genie_pow_mp_int_int;
 503  GPROC genie_print_long_mp_bits;
 504  GPROC genie_print_long_mp_complex;
 505  GPROC genie_print_long_mp_int;
 506  GPROC genie_print_long_mp_real;
 507  GPROC genie_print_mp_complex;
 508  GPROC genie_put_long_mp_bits;
 509  GPROC genie_put_long_mp_complex;
 510  GPROC genie_put_long_mp_int;
 511  GPROC genie_put_long_mp_real;
 512  GPROC genie_put_mp_complex;
 513  GPROC genie_read_long_mp_bits;
 514  GPROC genie_read_long_mp_complex;
 515  GPROC genie_read_long_mp_int;
 516  GPROC genie_read_long_mp_real;
 517  GPROC genie_read_mp_complex;
 518  GPROC genie_re_mp_complex;
 519  GPROC genie_round_mp;
 520  GPROC genie_set_long_mp_bits;
 521  GPROC genie_shl_mp;
 522  GPROC genie_shorten_long_mp_complex_to_mp_complex;
 523  GPROC genie_shorten_long_mp_to_mp;
 524  GPROC genie_shorten_mp_complex_to_complex;
 525  GPROC genie_shorten_mp_to_bits;
 526  GPROC genie_shorten_mp_to_int;
 527  GPROC genie_shorten_mp_to_real;
 528  GPROC genie_shr_mp;
 529  GPROC genie_sign_mp;
 530  GPROC genie_sindg_mp;
 531  GPROC genie_sinh_mp;
 532  GPROC genie_sinh_mp_complex;
 533  GPROC genie_sin_mp;
 534  GPROC genie_sin_mp_complex;
 535  GPROC genie_sinpi_mp;
 536  GPROC genie_sqrt_mp;
 537  GPROC genie_sqrt_mp_complex;
 538  GPROC genie_sub_mp;
 539  GPROC genie_sub_mp_complex;
 540  GPROC genie_tandg_mp;
 541  GPROC genie_tanh_mp;
 542  GPROC genie_tanh_mp_complex;
 543  GPROC genie_tan_mp;
 544  GPROC genie_tan_mp_complex;
 545  GPROC genie_tanpi_mp;
 546  GPROC genie_timesab_mp;
 547  GPROC genie_timesab_mp_complex;
 548  GPROC genie_xor_mp;
 549  
 550  #if defined (HAVE_GNU_MPFR)
 551  GPROC genie_beta_inc_mpfr;
 552  GPROC genie_ln_beta_mpfr;
 553  GPROC genie_beta_mpfr;
 554  GPROC genie_gamma_inc_mpfr;
 555  GPROC genie_gamma_inc_real_mpfr;
 556  GPROC genie_gamma_inc_double_mpfr;
 557  GPROC genie_gamma_mpfr;
 558  GPROC genie_lngamma_mpfr;
 559  GPROC genie_mpfr_erfc_mp;
 560  GPROC genie_mpfr_erf_mp;
 561  GPROC genie_mpfr_inverfc_mp;
 562  GPROC genie_mpfr_inverf_mp;
 563  GPROC genie_mpfr_mp;
 564  size_t mpfr_digits (void);
 565  #endif
 566  
 567  #if (A68_LEVEL >= 3)
 568  GPROC genie_quad_mp;
 569  #endif
 570  
 571  #if (A68_LEVEL <= 2)
 572  int get_mp_bits_width (const MOID_T *);
 573  int get_mp_bits_words (const MOID_T *);
 574  MP_BITS_T *stack_mp_bits (NODE_T *, MP_T *, MOID_T *);
 575  #endif
 576  
 577  #endif
     


© 2002-2024 J.M. van der Veer (jmvdveer@xs4all.nl)