home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / sfit110.zip / SFITHELP.HLP < prev   
Text File  |  1994-11-24  |  29KB  |  857 lines

  1. <index>
  2. general
  3. C library
  4. compiled functions
  5. configuration
  6. fitting
  7. interpreted func
  8. mouse
  9. objective
  10. output
  11. parameters
  12. scale
  13.  
  14. <compiled functions>
  15. DLLs
  16. DLL info block
  17. loading a DLL
  18. making a DLL
  19.  
  20. <configuration>
  21. colours
  22. connect points
  23. graph update
  24. max iterations
  25. status update
  26. tolerance
  27.  
  28. <fitting> 
  29. auto scale y axis
  30. exclude regions
  31. include regions
  32. fit status
  33. fit undo
  34. starting a fit
  35. show current
  36.  
  37. <general>
  38. product info
  39. demo version
  40. demo directory
  41. algorithm
  42. bugs
  43. caveats
  44. data files
  45.  
  46. <interpreted func>
  47. C interpreter
  48. editing functions
  49. error list
  50. function library
  51. output list
  52. template function
  53. vector loops
  54.  
  55. <mouse>
  56. boxes
  57. cursor
  58.  
  59. <objective>
  60. chisquare
  61. summed squares
  62. summed absolutes
  63.  
  64. <output>
  65. splot file
  66. tabular file
  67. .ini
  68.  
  69. <parameters>
  70. adding
  71. changing
  72. deleting
  73. cloning
  74. increments
  75. initial choices
  76. limits
  77. marking
  78.  
  79. <scale>
  80. auto scale
  81. box zoom
  82. enter limits
  83. undo zoom
  84.  
  85. <C library>
  86. abs
  87. acos
  88. asin
  89. atan
  90. atan2
  91. atoi
  92. atof
  93. ceil
  94. cos
  95. exit
  96. exp
  97. fabs
  98. floor
  99. fmod
  100. free
  101. log
  102. log10
  103. malloc
  104. pow
  105. puts
  106. printf
  107. print
  108. sin
  109. sqrt
  110. sizeof
  111. sprintf
  112. strcat
  113. strcpy
  114. strlen
  115.  
  116.  
  117. <product info>
  118.  This is Sfit version 1.0.1
  119.  
  120.  THIS PROGRAM WAS WRITTEN BY THOMAS W. STEINER
  121.  COPYRIGHT 1992 - 1994, ALL RIGHTS RESERVED
  122.  THERE IS NO WARRANTY OF ANY KIND. 
  123.  USE AT YOUR OWN RISK.
  124.  THIS IS NOT FREEWARE. 
  125.  TO REGISTER YOUR COPY SEND $35 TO 
  126.  
  127.        T.W. Steiner
  128.     312 - 1230 Haro St.
  129.      Vancouver, BC, V6E - 4J9  
  130.           Canada
  131.        e-mail steiner@sfu.ca
  132.  
  133.  Registered users will receive upgrades
  134.  as they become available
  135.  
  136. <demo version>
  137.  The demo version is identical to the full version except 
  138.  in output capability. The demo version will not output 
  139.  the result of a fit to a file nor will it update the 
  140.  current *.ini file with the latest parameters. 
  141.  These restrictions are designed in order to allow 
  142.  evaluation of the program but make it sufficiently 
  143.  inconvenient to use the results that there is some 
  144.  motivation for people to register. Note that it is still 
  145.  possible to use the full fitting capabilities of the 
  146.  program. 
  147.  
  148. <demo directory>
  149.  The demo sub directory contains a number of *.ini files
  150.  which contain the saved state of some demonstration fits.
  151.  To load one of these demo fits select 'Restore Saved State'
  152.  from the 'File' menu. The cubic.ini is a simple cubic
  153.  fit. The ndens.ini calculates the electron density as a 
  154.  function of impurity concentrations and illustrates the
  155.  use of additional data columns to read in more data. The
  156.  swansl.ini is a magnetization transfer calculation on 
  157.  several tissues and illustrates a multi-valued function.
  158.  The above fit also does a numerical integral as part of
  159.  the fitting process and thus runs much slower. The 
  160.  interp.ini demo is the same as the cubic demo except that
  161.  it uses an interpreted function rather than a compiled
  162.  function.
  163.  
  164. <algorithm>
  165.  This program is a general purpose non-linear fitting 
  166.  program capable of fitting any computable function to 
  167.  data. It uses the Simplex algorithm (not to be confused 
  168.  with the linear programming Simplex) which has been shown 
  169.  to be almost as efficient as the method of steepest 
  170.  descent but is much easier to use and more general. In 
  171.  particular, the calculated function need not be 
  172.  differentiable. Also limits on parameter values are 
  173.  easily applied. The program attempts to minimize the 
  174.  objective function, which is the summed function of the 
  175.  difference between the calculated function and read in 
  176.  data over all data points, by varying the marked 
  177.  parameters. 
  178.  
  179. <bugs>
  180.  In the vast majority of cases trouble with sfit can be
  181.  traced back to a problem with the user created DLL. In
  182.  particular overwriting the ends of the global data array
  183.  will cause unpredictable results. Thus if problems arise
  184.  during or after doing a fit or showing the current result 
  185.  then have a good hard look at your function and compare it
  186.  to the ones in the demo and dll directories. If you do find
  187.  a bug that appears to be associated with sfit itself then
  188.  send the DLL source along with any data files and parameter
  189.  lists to steiner@sfu.ca. Then if I can reproduce your problem
  190.  it will be fixed. Also feel free to submit suggestions on 
  191.  possible improvements to the program. If your suggestions 
  192.  make sense to me and do not conflict with what other people
  193.  want then they will probably be implemented.
  194.  
  195. <caveats>
  196.  The results of a non-linear fit cannot be assumed to be 
  197.  the best possible fit. Restarting the fitting procedure 
  198.  with different parameters might produce a better fit. 
  199.  There is no way of knowing if one is stuck in a local 
  200.  minimum of the objective function. It is best if the 
  201.  parameters can be made as orthogonal (decoupled) as 
  202.  possible since this simplifies the "surface" of the 
  203.  objective function. It is also important to start the fit 
  204.  with reasonable starting parameters to insure convergence 
  205.  to a good fit. If the fit does not converge to something 
  206.  reasonable It might be necessary to tweak the parameters 
  207.  by "hand" using the parameter edit function until the 
  208.  function has at least the right general shape. 
  209.  
  210. <data files>
  211.  The data to which a function is to be fit must be read in 
  212.  from an ASCII file. The format should be as follows: The 
  213.  first column should be the x or independent axis values. 
  214.  The second column should be the dependent or y axis 
  215.  values. The number of data points in the data set are 
  216.  taken to be the same as the number of rows of tabular 
  217.  data in the data file. Blank lines are ignored. Lines not 
  218.  starting with a number are considered comment lines and 
  219.  are ignored. WARNING be sure comment lines do not start 
  220.  with a number. There may be additional columns in the 
  221.  data set. One use for additional columns is to enter a 
  222.  standard deviation for each point to be used in 
  223.  conjunction with the chisquare objective function. 
  224.  Additional columns may also be used to supply additional 
  225.  values needed by the fitting function in order to 
  226.  calculate the function. Note however that if there are 
  227.  additional column they must contain a value for each data 
  228.  point. Columns may be separated by a comma or spaces. 
  229.  
  230. <DLLs>
  231.  Compiled fitting functions are contained in Dynamic Link 
  232.  Libraries or DLLs. These are linked in while the program 
  233.  is running and thus only the currently used function is 
  234.  loaded in. Furthermore, DLLs can be added to the list of 
  235.  available DLLs by anyone who has an appropriate C 
  236.  compiler. The source code for this program is not 
  237.  required since a DLL can be compiled on its own. The 
  238.  function in the DLL can be arbitrarily complicated. All 
  239.  that is required is that it calculate a function based on 
  240.  the parameters to be compared with the read in data. 
  241.  
  242. <DLL info block>
  243.  All DLLs should contain a built in information block 
  244.  which describes the fitting function. Part of this 
  245.  description should include a list of required parameters 
  246.  descriptions. 
  247.  
  248. <loading a DLL>
  249.  Once a DLL has been written and compiled it can be loaded 
  250.  in simply by selecting "DLL load" in the "compiled" sub 
  251.  menu of the "function" menu. This will open up a file 
  252.  selection dialog box. 
  253.  
  254. <making a DLL>
  255.  In order to make a DLL one should start with an 
  256.  existing DLL and edit it in order to customize it for 
  257.  the new application. In particular, the demo DLL 
  258.  custfunc.c contains comments indicating areas that may 
  259.  need to be modified. When the modifications are 
  260.  complete compile the function as a DLL. For users of 
  261.  the Borland (IBM) compiler a supplied bordll.mak 
  262.  (ibmdll.mak) makefile is included. To use this edit 
  263.  the source name in bordll.mak (ibmdll.mak) and then 
  264.  type make -fmakedll (nmake /f ibmdll.mak) to start the 
  265.  compiler. Note that the file custfunc.def is also 
  266.  required. Note that DLLs may not be renamed after 
  267.  making thus the makefile should be edited so that the 
  268.  generated DLL has the desired final name. If you make 
  269.  a DLL that you believe may be of use to other people
  270.  send it to me by e-mail and I will include it in 
  271.  future releases.
  272.  
  273. <colours>
  274.  There are three selectable colours. One for the read in 
  275.  data, one for the generated fit and one for the 
  276.  calculated function in the excluded regions. The colours 
  277.  can be set using the "config" menu item in the "file" 
  278.  menu. 
  279.  
  280. <connect points>
  281.  It is possible to have the data and fitted points drawn 
  282.  as connected or as isolated data points. The later choice 
  283.  is appropriate for multi valued functions. The drawing 
  284.  style is set using the "config" menu item in the "file" 
  285.  menu. 
  286.  
  287. <graph update>
  288.  The graph update count is how often, in terms of 
  289.  iterations of the fitting loop, the current best fit 
  290.  should be displayed. It can be set using the "config" 
  291.  menu item in the "file" menu. 
  292.  
  293. <status update> 
  294.  The status update count is how often, in terms of 
  295.  iterations of the fitting loop, the current best values 
  296.  should be updated in the status dialog (if open). It can 
  297.  be set using the "config" menu item in the "file" menu. 
  298.  
  299. <tolerance> 
  300.  The fitting loop terminates once the difference in 
  301.  objective function values between the best and worst 
  302.  vertex is less than the value of the tolerance parameter 
  303.  field or the number of iterations is greater than the 
  304.  value specified in in the max iterations field. These 
  305.  values can be set using the "config" menu item in the 
  306.  "file" menu. 
  307.  
  308. <max iterations> 
  309.  The fitting loop terminates once the difference in 
  310.  objective function values between the best and worst 
  311.  vertex is less than the value of the tolerance parameter 
  312.  field or the number of iterations is greater than the 
  313.  value specified in in the max iterations field. These 
  314.  values can be set using the "config" menu item in the 
  315.  "file" menu. 
  316.  
  317. <exclude regions>
  318.  One or more portion of the data set may be excluded from 
  319.  the fitting procedure by using the right mouse button to 
  320.  draw a box around the region to be excluded and then 
  321.  selecting the "exclude region" menu item in the "fit" 
  322.  menu. The fit will still be calculated in the excluded 
  323.  region but the result will not contribute to the 
  324.  objective function. The fit in excluded regions will be 
  325.  drawn in a different colour if set up properly in the 
  326.  configuration. If the first specified region is an 
  327.  exclude region then all outside points are included.
  328.  
  329. <include regions>
  330.  One or more portion of the data set may be explicitly 
  331.  included in the fitting procedure by using the right 
  332.  mouse button to draw a box around the region to be 
  333.  excluded and then selecting the "include region" menu 
  334.  item in the "fit" menu. The fit will still be 
  335.  calculated outside the included region but the result 
  336.  will not contribute to the objective function. The fit 
  337.  outside the included regions will be drawn in a 
  338.  different colour if set up properly in the 
  339.  configuration. If the first specified region is an 
  340.  include region then all outside points are excluded. 
  341.  If no regions at all are specified then all points are 
  342.  included by default. 
  343.  
  344.  
  345. <adding>
  346.  Parameters are added by selecting the "Add" menu item of 
  347.  the "param" menu. This will open a dialog box in which 
  348.  the parameter's ordinal number, label, initial value, 
  349.  initial increment, and limits can be entered.
  350.  
  351. <changing>
  352.  A parameter's value or limits can be changed by 
  353.  selecting the "edit" menu item of the "param" menu.
  354.  This opens a dialog in which one parameter can be 
  355.  selected and its values edited. Hitting return or the
  356.  "update" push button will cause the function to be 
  357.  evaluated with the changed parameters. Upon completing 
  358.  the modifications select the "accept" push button which 
  359.  will save the parameter changes. Alternatively selecting 
  360.  the "cancel" push button causes the changes to be 
  361.  undone.
  362.  
  363. <deleting>
  364.  A parameter is deleted by choosing the "delete" menu 
  365.  item in the "param" menu. This opens a dialog box in 
  366.  which the parameter(s) to be deleted can be marked.
  367.  
  368. <cloning>
  369.  A parameter is cloned by choosing the "clone" menu 
  370.  item in the "param" menu. This opens a dialog box in 
  371.  which the parameter(s) to be cloned can be marked. If
  372.  the parameter name contains a number then that number
  373.  is incremented by one in the cloning process. This 
  374.  function is useful for duplicating a list of parameters 
  375.  for a second similar object.
  376.  
  377. <increments>
  378.  The increment value associated with a parameter is the
  379.  initial size of the variation to be tried. This will 
  380.  expand or shrink as needed to zero in on a good fit. If 
  381.  it is initially chosen too small or large convergence 
  382.  will take considerably longer. Also if it is too small 
  383.  it may not be able to "climb" out of a local minimum.
  384.  An initial value 1/3 of the parameter value is usually
  385.  a reasonable increment value. If the increment is zero 
  386.  the parameter will not be varied.
  387.  
  388. <initial choices>
  389.  It is important that the initial choices for the 
  390.  parameters be reasonable in order that the fit can 
  391.  converge to a reasonable solution. It is usually best
  392.  to edit the parameters manually or to fit with only a 
  393.  sub set of the parameters marked until the function has 
  394.  at least the right general shape before marking all the 
  395.  parameters and fitting.
  396.  
  397. <limits>
  398.  The parameters can be constrained to a region by setting 
  399.  the upper and lower limits accordingly. If for 
  400.  example a parameter should not be negative then set 
  401.  the lower limit to 0.0.
  402.  
  403. <marking>
  404.  Only marked parameters are varied by the fitting 
  405.  program. Parameters are marked by holding down the
  406.  left mouse button and moving the mouse over the 
  407.  parameters to be marked and then releasing the left 
  408.  mouse button. This works for continuous ranges of 
  409.  parameters. Parameters can also be marked individually 
  410.  by holding down the <ctrl> key and clicking the left 
  411.  mouse button on the parameters to be marked.
  412.  
  413. <box zoom>
  414.  It is possible to zoom in on a region by first drawing a box around 
  415.  the region of interest by holding down the right mouse 
  416.  button and then selecting the "box zoom" menu item in 
  417.  the "scale" menu.
  418.  
  419. <enter limits>
  420.  Display limits can also be entered numerically by 
  421.  selecting the "limits" menu item in the "scale" menu.
  422.  
  423. <auto scale y axis>
  424.  If autoscale is on as indicated by the check mark next 
  425.  to the "autoscale" menu item in the "fit" menu then 
  426.  while fitting the y scale is adjusted so that both the 
  427.  data and the calculated function are visible. If 
  428.  autoscale is not on the y scale is not adjusted. This 
  429.  means that the calculated function may not even be 
  430.  visible if it is far off. 
  431.  
  432. <auto scale>
  433.  Selecting the "auto scale" menu item in the "scale"
  434.  menu causes the scale to be set to the limits of the
  435.  data or fit which ever is larger.
  436.  
  437. <undo zoom>
  438.  Previous box zooms or limit sets can be undone by 
  439.  selecting the "undo zoom" menu item from the "scale" 
  440.  menu. Several levels of undo are possible.
  441.  
  442. <fit status>
  443.  While the fit is in progress the current status may be 
  444.  displayed by selecting the "status" menu item of the 
  445.  "fit" menu. The status dialog displays the number of 
  446.  iterations completed, the best and worst values of the 
  447.  objective function and the values of the parameters 
  448.  corresponding to the current best vertex. 
  449.  
  450. <fit undo>
  451.  The parameters can be restored to their values before the 
  452.  last fit by selecting the "undo fit" menu item in the 
  453.  "fit" menu. 
  454.  
  455. <starting a fit>
  456.  In order to do a fit first mark the parameters to be 
  457.  adjusted using the "param" menu and then select the 
  458.  "start fit" menu item of the "fit" menu. 
  459.  
  460. <show current>
  461.  The "show current" menu item of the fit menu calculates 
  462.  and displays the fit using the current value of the 
  463.  parameters. 
  464.  
  465. <chisquare>
  466.  Choosing "chisqr" as the objective function requires that 
  467.  the uncertainty in each data point be specified as a 
  468.  standard deviation. There are three choices for this. The 
  469.  first is taking the std. dev. to equal the square root of 
  470.  the data value. This is appropriate for the data 
  471.  corresponding to counting random events. The second 
  472.  choice is entering a known std. dev. to be applied to all 
  473.  data points and the last choice is entering a column 
  474.  number which contains the standard deviation for each 
  475.  data value and is to be read in along with the data. 
  476.  
  477. <summed squares>
  478.  The objective function is the sum of the squared 
  479.  differences between the data points and the calculated 
  480.  points divided by the number of points. Only data points 
  481.  not in an exclude region are used in the objective 
  482.  function. 
  483.  
  484. <summed absolutes>
  485.  The objective function is the sum of the absolute 
  486.  differences between the data points and the calculated 
  487.  points divided by the number of points. Only data points 
  488.  not in an exclude region are used in the objective 
  489.  function. 
  490.  
  491. <boxes>
  492.  Boxes for the exclude region or box zoom are drawn
  493.  by pushing the right mouse button at one corner and then 
  494.  dragging the mouse to the opposite corner holding down 
  495.  the right button. Releasing the right button sets the 
  496.  second corner.
  497.  
  498. <cursor>
  499.  Moving the mouse while holding down the left mouse 
  500.  button causes a cross hair cursor to be drawn at the x 
  501.  position of the mouse and y position corresponding to 
  502.  the y data value at that x value. The coordinates are 
  503.  written in the title bar. If calculated data is also 
  504.  present the calculated value and error are also 
  505.  displayed.
  506.  
  507. <splot file>
  508.  The results of a fit may be saved in a splot file i.e. an 
  509.  ASCII file which can be read in by the Splot program 
  510.  (available separately) in order to turn it into a 
  511.  publication quality figure. Select "Gen splot file" in 
  512.  the "file" menu to generate a splot file. This feature 
  513.  has been disabled in the demo version. 
  514.  
  515. <tabular file>
  516.  The results of a fit may be saved in a tabular ASCII 
  517.  file. This file will consist of the data as read in along 
  518.  with an additional column for the corresponding best 
  519.  generated fit. Select "File result as" in the "file" menu 
  520.  to generate a tab file. This feature has been disabled in 
  521.  the demo version. 
  522.  
  523. <.ini> 
  524.  The currently chosen values of the configuration, data 
  525.  file name, fitting function file name, objective 
  526.  function, parameter values etc. is all saved in the file 
  527.  sfit.ini upon exiting the program and the state is 
  528.  automatically restored upon restarting the program. It is 
  529.  possible to start the program using a different .ini file 
  530.  by specifying the name on the command line. A previously 
  531.  saved state may also be loaded from the "file" menu. The 
  532.  current state of the fitting program may be saved at any 
  533.  time by save state from the "file" menu. It is 
  534.  advantageous to have separate *.ini files for each 
  535.  different fitting function as then the number,approximate 
  536.  value and label of each parameter need not be edited when 
  537.  switching from one function to another. The demo version 
  538.  deliberately does not update the parameters stored in the 
  539.  initialization files. 
  540.  
  541. <C interpreter>
  542.  Sfit has a built in vector C interpreter that allows fits 
  543.  with relatively simple functions to be done without 
  544.  building a DLL. In order to do interpreted fits no 
  545.  compiler is required. The interpreter understands a large 
  546.  sub set of C. In particular, it can only handle up to two 
  547.  dimensional arrays and it does not have structures or 
  548.  unions. It has only four data types: char, int, float an 
  549.  double. It does contain most of the standard C math 
  550.  library. Fitting is far from an ideal application for 
  551.  interpreters since fitting involves calculating the same 
  552.  function over and over again incurring the interpreter 
  553.  overhead each time. Nevertheless this interpreter has 
  554.  been optimized for vector calculations and is hence quite 
  555.  usable for relatively simple functions. It will run 
  556.  approximately one order of magnitude slower than the 
  557.  equivalent compiled function. 
  558.  
  559. <editing functions>
  560.  A function to be interpreted must have the same standard 
  561.  structure as the example interpreted function interp.c.
  562.  Comments indicate which areas of the code may be 
  563.  modified for your function. The function can be edited 
  564.  from within the Sfit program by selecting the "edit" 
  565.  menu item in the "interpret" sub menu. This will open  
  566.  an edit dialog box with the current function displayed.
  567.  The dialog box editor is however rudimentary and most
  568.  people will probably prefer to edit the function with
  569.  an external editor and then loading it in using the
  570.  "load function" menu item in the "interpret" menu.
  571.  
  572. <error list>
  573.  If an error occurred interpreting the function an error
  574.  message is returned and put into the error list. The 
  575.  last error list can be viewed by selecting the "last 
  576.  error" menu item in the "interpret" menu. The error
  577.  list is deleted after viewing it once.
  578.  
  579. <function library>
  580.  The built in C interpreter contains a selection 
  581.  of standard functions. Consult the C library
  582.  help item for details.
  583.  
  584. <output list>
  585.  If interpreting the function generated any output
  586.  using say the printf() library function then it will
  587.  put into the  output list. The 
  588.  last output list can be viewed by selecting the  
  589.  "output" menu item in the "interpret" menu. The
  590.  output list is deleted after viewing it once.
  591.  
  592. <template function>
  593.  In order to make the development of a function
  594.  to be interpreted as simple and the least error prone 
  595.  as  possible there is the "Gen template" menu item of 
  596.  the "interpret" menu. This menu choice will generate 
  597.  a shell file including definitions of all the currently
  598.  defined parameters leaving only the actual function 
  599.  unspecified. Thus the recommended approach when starting
  600.  a new interpreted fit is to load in the data, define all the needed 
  601.  parameters using the "Add" menu item in the "param" 
  602.  menu then select "Gen template" to generate the function 
  603.  outline and lastly edit the function to fill in the 
  604.  computational details. 
  605.  
  606. <vector loops>
  607.  In order to make interpreted fitting a realistic 
  608.  endeavour the interpreter has been optimized to 
  609.  "vectorize" the most common fitting loops. In particular
  610.  loops such as:
  611.  
  612.    double x[Ndat];
  613.    for (i = 0;i < Ndat;i++)
  614.       {
  615.       x[i] = datx[i] - *P1;
  616.       datt[i] = x[i] * (x[i] * (x[i] * *P5 + *P4) + *P3) + *P2;
  617.       }
  618.  
  619.  can be evaluated without having to loop through Ndat 
  620.  times. Instead in the first line x[i] is evaluated for
  621.  all values before moving to the second line. Only 
  622.  certain loops can be vectorized. The rules are:
  623.  
  624.   - Only standard incrementing or decrementing for loops.
  625.   - Start and stop limits must be constants and known at
  626.     the start of the loop execution.
  627.   - May not contain any conditional expressions
  628.     such as if (i > 10) break;
  629.   - Must not contain any assignments to scalars. Note 
  630.     that in the example above the temporary variable x 
  631.     was defined as a vector rather than a scalar.
  632.   - Inclusion of math function library elements is 
  633.     allowed as in x[i] = sin(daty[i]); 
  634.   - Limited index math is allowed such as in 
  635.     x[i] = y[i - 2] + z[i + 2]; but only additive 
  636.     constants. 
  637.   - Using index shifts is potentially dangerous.
  638.     Remember that each line is only executed once so it 
  639.     is possible to build in data dependencies which will
  640.     result in incorrect operation. Consider the 
  641.     following:
  642.     for (i = 1;i <= 10;i++)
  643.     x[i] = x[i - 1];
  644.     Serial execution results in all x values equal to 
  645.     x[0] but vector execution results in new x equal to
  646.     old x with all values shifted over one slot.
  647.   - When using index shifts the start and end of a loop
  648.     are troublesome since the array limits could be 
  649.     exceeded. Instead of using conditionals which would
  650.     cause vectorization failure do the first and/or last
  651.     iterations outside of the loop.
  652.  
  653.  Vectorization failure causes the loop to be evaluated 
  654.  serially with MUCH slower execution.
  655.  
  656.  
  657. <abs>
  658.  int abs(int i);
  659.  
  660.  Returns the absolute value of i;
  661.  
  662. <acos>
  663.  double acos(double x);
  664.  
  665.  Returns the arc cosine of the value x. x must be 
  666.  between -1 and 1. Returns a value between 0 and pi. 
  667.  
  668. <asin>
  669.  double asin(double x);
  670.  
  671.  Returns the arc sine of the value x. x must be between 
  672.  -1 and 1. Returns a value between -pi/2 and pi/2. 
  673.  
  674. <atan>
  675.  double atan(double x);
  676.  
  677.  Returns the arc tangent of the value x. Returns a value 
  678.  between -pi/2 and pi/2. 
  679.  
  680. <atan2>
  681.  double atan2(double y,double x);
  682.  
  683.  Returns the arc tangent of the value y/x. Returns a value 
  684.  between -pi and pi. 
  685.  
  686. <atoi>
  687.  int atoi(char *str);
  688.  
  689.  Converts a string to an integer. The string must contain 
  690.  only digits. 
  691.  
  692. <atof>
  693.  double atof(char *str);
  694.  
  695.  Converts a string to a double. The string must contain only 
  696.  digits and 'e', 'E', '.', '-' and '+' . 
  697.  
  698. <ceil>
  699.  double ceil(double x);
  700.  
  701.  Rounds up x to nearest integer value. 
  702.  
  703. <cos>
  704.  double cos(double x);
  705.  
  706.  Returns the cosine of x. x is specified in degrees. 
  707.  
  708. <exit>
  709.  void exit(int status);
  710.  
  711.  Terminates the execution of the program. If the status is 0 
  712.  then it will be considered a normal exit otherwise an error 
  713.  induced exit. 
  714.  
  715. <exp>
  716.  double exp(double x);
  717.  
  718.  Calculates the exponential function e^x. 
  719.  
  720. <fabs>
  721.  double fabs(double x); 
  722.  
  723.  Returns the absolute value of x. It is like abs() but works 
  724.  with floating point numbers rather than integers. 
  725.  
  726. <floor>
  727.  double floor(double x);
  728.  
  729.  Rounds down x to the nearest integer. 
  730.  
  731. <fmod>
  732.  double fmod(double x,double y);
  733.  
  734.  Returns the remainder of x/y. 
  735.  
  736. <free>
  737.  void free(char *ptr);
  738.  
  739.  Frees the block of memory pointed to by ptr. The memory 
  740.  must have been previously allocated using malloc(). 
  741.  
  742. <log>
  743.  double log(double x);
  744.  
  745.  Returns the natural log of x. 
  746.  
  747. <log10>
  748.  double log10(double x);
  749.  
  750.  Returns the log base 10 of x.
  751.  
  752. <malloc>
  753.  char *malloc(int size);
  754.  
  755.  Allocates a block of memory of size bytes and returns a 
  756.  pointer to the block. malloc returns NULL if there is 
  757.  insufficient free memory. 
  758.  
  759. <pow>
  760.  double pow(double x,double y);
  761.  
  762.  Calculates x to the power y.
  763.  
  764. <puts>
  765.  int puts(char *str);
  766.  
  767.  This routine writes the string str to the output file and 
  768.  starts a new line. 
  769.  
  770. <printf>
  771.  int printf(char *format,...);
  772.  
  773.  Prints the formatted data to the output file. The format 
  774.  string specifies the type and number of values to print. 
  775.  Some common examples include: 
  776.  
  777.  printf("i = %d",i); prints the 
  778.  integer value i. 
  779.  
  780.  printf("x = %g",x); prints the 
  781.  floating point value x. 
  782.  
  783.  printf("text = %s",str); prints the 
  784.  string str. 
  785.  
  786.  Multiple values can be printed as in 
  787.  printf("%d %d %g %s",i,j,x,str); 
  788.  
  789.  The format specifiers can also include field width 
  790.  information and justification etc. Consult a standard C 
  791.  text for more details. 
  792.  
  793. <print>
  794.  void print(v,...);
  795.  
  796.  Prints the value v which can be of any scalar type. i.e 
  797.  int, char, float, double or a pointer. This is not a 
  798.  function found in the standard C library. 
  799.  
  800. <sin>
  801.  double sin(double x);
  802.  
  803.  Returns the sine of x. x must be specified in degrees. 
  804.  
  805. <sqrt>
  806.  double sqrt(double x);
  807.  
  808.  Calculates the square root of x. x must be a positive 
  809.  number. 
  810.  
  811. <sizeof>
  812.  int sizeof(t);
  813.  
  814.  Returns the number of bytes required to store the value of 
  815.  type t. 
  816.  
  817. <sprintf>
  818.  int sprintf(char str,char 
  819.      *format,...); 
  820.  
  821.  Prints the formatted data to the string str. The format 
  822.  string specifies the type and number of values to print. 
  823.  Some common examples include: 
  824.  
  825.  printf("i = %d",i); prints the 
  826.  integer value i. 
  827.  
  828.  printf("x = %g",x); prints the 
  829.  floating point value x. 
  830.  
  831.  printf("text = %s",str); prints the 
  832.  string str. 
  833.  
  834.  Multiple values can be printed as in 
  835.  printf("%d %d %g %s",i,j,x,str); 
  836.  
  837.  The format specifiers can also include field width 
  838.  information and justification etc. Consult a standard C 
  839.  text for more details. 
  840.  
  841. <strcat>
  842.  void strcat(char *dest, char 
  843.       *source); 
  844.  
  845.  Concatenates the string source to the string dest. 
  846.  
  847. <strcpy>
  848.  void strcpy(char *dest, char 
  849.       *source); 
  850.  
  851.  Copies the string source to the string dest. 
  852.  
  853. <strlen>
  854.  int strlen(char *str);
  855.  
  856.  Returns the length of the string str. 
  857.