home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Utilities / Calc / lib / README < prev    next >
Encoding:
Text File  |  1993-10-12  |  4.5 KB  |  239 lines  |  [TEXT/????]

  1.  
  2. # Copyright (c) 1992 David I. Bell and Landon Curt Noll
  3. # Permission is granted to use, distribute, or modify this source,
  4. # provided that this copyright notice remains intact.
  5.  
  6. The following calc library files are provided because they serve as 
  7. examples of how use the calc language, and because the authors thought 
  8. them to be useful!
  9.  
  10. If you write something that you think is useful, please send it to:
  11.  
  12.     dbell@pdact.pd.necisa.oz.au     {uunet,pyramid}!pdact.pd.necisa.oz.au!dbell
  13.     chongo@toad.com                 {uunet,pyramid,sun}!hoptoad!chongo
  14.  
  15. By convention, a lib file just defines functions, objects and variales.
  16. (The regression test is an exception.)  Also by convention,  a usage
  17. message regarding each important object and function is printed at
  18. the time of the read.  This message printing may be disabled by assigning
  19. the global value  lib_debug  to a numeric value > 0.
  20.  
  21.  
  22. bernoulli.cal
  23.  
  24.     B(n)
  25.     Calculate the nth Bernoulli number.
  26.  
  27.  
  28. bigprime.cal
  29.  
  30.     bigprime(a, m, p) 
  31.  
  32.     A prime test, base a, on p*2^x+1 for even x>m.
  33.  
  34.  
  35. deg.cal        
  36.  
  37.     dms(deg, min, sec)
  38.     dms_add(a, b)
  39.     dms_neg(a)
  40.     dms_sub(a, b)
  41.     dms_mul(a, b)
  42.     dms_print(a)
  43.  
  44.     Calculate in degrees, minutes, and seconds.
  45.  
  46.  
  47. ellip.cal    
  48.  
  49.     factor(iN, ia, B, force)
  50.  
  51.     Attempt to factor using the elliptic functions: y^2 = x^3 + a*x + b.
  52.  
  53.  
  54. lucas.cal
  55.  
  56.     lucas(h, n)
  57.  
  58.     Perform a primality test of h*2^n-1, with 1<=h<2*n.
  59.  
  60.  
  61. lucas_chk.cal
  62.  
  63.     lucas_chk(high_n)
  64.  
  65.     Test all primes of the form h*2^n-1, with 1<=h<200 and n <= high_n.
  66.     Requires lucas.cal to be loaded.  The highest useful high_n is 1000.
  67.  
  68.  
  69. lucas_tbl.cal
  70.  
  71.     Lucasian criteria for primality tables.
  72.  
  73.  
  74. mersenne.cal
  75.  
  76.     mersenne(p)
  77.  
  78.     Perform a primality test of 2^p-1, for prime p>1.
  79.  
  80.  
  81. mod.cal    
  82.  
  83.     mod(a)
  84.     mod_print(a)
  85.     mod_one()
  86.     mod_cmp(a, b)
  87.     mod_rel(a, b)
  88.     mod_add(a, b)
  89.     mod_sub(a, b)
  90.     mod_neg(a)
  91.     mod_mul(a, b)
  92.     mod_square(a)
  93.     mod_inc(a)
  94.     mod_dec(a)
  95.     mod_inv(a)
  96.     mod_div(a, b)
  97.     mod_pow(a, b)
  98.  
  99.     Routines to handle numbers modulo a specified number.
  100.  
  101.  
  102. nextprim.cal
  103.  
  104.     nextprime(n, tries)
  105.  
  106.     Function to find the next prime (probably).
  107.  
  108.  
  109. pell.cal
  110.  
  111.     pellx(D)
  112.     pell(D)
  113.  
  114.     Solve Pell's equation; Returns the solution X to: X^2 - D * Y^2 = 1.
  115.     Type the solution to pells equation for a particular D.
  116.  
  117.  
  118. pi.cal
  119.  
  120.     qpi(epsilon)
  121.  
  122.     Calculate pi within the specified epsilon using the quartic convergence
  123.     iteration.
  124.  
  125.  
  126. pollard.cal
  127.  
  128.     factor(N, N, ai, af)
  129.  
  130.     Factor using Pollard's p-1 method.
  131.  
  132.  
  133. poly.cal    
  134.  
  135.     pol()
  136.     poly_print(a)
  137.     poly_add(a, b)
  138.     poly_neg(a)
  139.     poly_sub(a, b)
  140.     poly_mul(a, b)
  141.     poly_div(a, b)
  142.     ev(a, x)
  143.  
  144.     Calculate with polynomials of one variable
  145.  
  146.  
  147. psqrt.cal    
  148.  
  149.     psqrt(u, p)
  150.  
  151.     Calculate square roots modulo a prime
  152.  
  153.  
  154. quat.cal
  155.  
  156.     quat(a, b, c, d)
  157.     quat_print(a)
  158.     quat_norm(a)
  159.     quat_abs(a, e)
  160.     quat_conj(a)
  161.     quat_add(a, b)
  162.     quat_sub(a, b)
  163.     quat_inc(a)
  164.     quat_dec(a)
  165.     quat_neg(a)
  166.     quat_mul(a, b)
  167.     quat_div(a, b)
  168.     quat_inv(a)
  169.     quat_scale(a, b)
  170.     quat_shift(a, b)
  171.  
  172.     Calculate using quaternions of the form: a + bi + cj + dk.  In these
  173.     functions, quaternians are manipulated in the form: s + v, where
  174.     s is a scalar and v is a vector of size 3.
  175.  
  176.  
  177. regress.cal    
  178.  
  179.     Test the correct execution of the calculator by reading this library file.
  180.     Errors are reported with '****' mssages, or worse.  :-)
  181.  
  182.  
  183. solve.cal    
  184.  
  185.     solve(low, high, epsilon)
  186.  
  187.     Solve the equation f(x) = 0 to within the desired error value for x.
  188.     The function 'f' must be defined outside of this routine, and the low
  189.     and high values are guesses which must produce values with opposite signs.
  190.  
  191.  
  192. sumsq.cal    
  193.  
  194.     ss(p)
  195.  
  196.     Determine the unique two positive integers whose squares sum to the
  197.     specified prime.  This is always possible for all primes of the form
  198.     4N+1, and always impossible for primes of the form 4N-1.
  199.  
  200.  
  201. surd.cal    
  202.  
  203.     surd(a, b)
  204.     surd_print(a)
  205.     surd_conj(a)
  206.     surd_norm(a)
  207.     surd_value(a, xepsilon)
  208.     surd_add(a, b)
  209.     surd_sub(a, b)
  210.     surd_inc(a)
  211.     surd_dec(a)
  212.     surd_neg(a)
  213.     surd_mul(a, b)
  214.     surd_square(a)
  215.     surd_scale(a, b)
  216.     surd_shift(a, b)
  217.     surd_div(a, b)
  218.     surd_inv(a)
  219.     surd_sgn(a)
  220.     surd_cmp(a, b)
  221.     surd_rel(a, b)
  222.  
  223.     Calculate using quadratic surds of the form: a + b * sqrt(D).
  224.  
  225.  
  226. unitfrac.cal
  227.  
  228.     unitfrac(x)
  229.  
  230.     Represent a fraction as sum of distinct unit fractions.
  231.  
  232.  
  233. varargs.cal
  234.  
  235.     sc(a, b, ...)
  236.  
  237.     Example program to use 'varargs'.  Program to sum the cubes of all 
  238.     the specified numbers.
  239.