List of mathematical $functions: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (minor formatting)
 
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<div class="showVisit">
<div class="showVisit">
As of version 6.9, the <var class="product>Sirius Mods</var> contains
As of Model&nbsp;204 7.5, a set of high-performance, high-precision versions of the IBM mathematical $functions are built in to SOUL. These $functions, shown in the [[#funTable|table below]], eliminate the need to use external math libraries.
the following high-performance, high-precision
<blockquote class="note"><b>Note: Prior to version 7.5 of Model&nbsp;204:</b>
versions of the IBM mathematical functions available in <var class="product>User Language</var>.
<ul>
<li>Your site could choose to use an external library instead of these integrated $functions. In such a case, these $functions would result in calls to the external library. For information on setting up an external math library for Model 204 version 7.4 or earlier, see your Model&nbsp;204 [[Model 204 documentation#Still in PDF format|installation guide]] for that version.</li>
 
<li>The high-performance, high-precision versions of these $functions were available as part of the <var class="product">Sirius Mods</var>, and would be used if the [[SIRFUNC parameter]] has the X'01' bit turned on.</li>
</ul>
</blockquote>
 
See [[Notation conventions for methods]] for information
See [[Notation conventions for methods]] for information
about the conventions followed in the method descriptions.
about the conventions followed in the $function descriptions.
 
==<b id="mathFunConsid"></b>Mathematical $function considerations==
<!--Caution: referenced from m204int: http://m204int.rocketsoftware.com/index.php/Model_204_7.5_installation_design#oldMathErr-->
<ul>
<li><b>Error handling</b>
<p>If invalid numerical values are passed to the mathematical functions 
(for example, a negative number to <var>$Sqrt</var>), an error message is printed at the user's terminal, and 0 is returned as the function's value.</p>
</ul>
 
==<b id="funTable"></b>Table of mathematical $functions==
<table class="wikitable">
<table class="wikitable">
<tr><th>$Function</th><th>Description</th></tr>
<tr class="head"><th>$Function</th><th>Description</th></tr>
<!-- Note that FUNSCHECK.WIKI depends on the format of the function name/description rows - *** SO DON'T MUCK WITH IT!!! *** -->
<tr><td>[[$Abs|$Abs(x)]]<td>Absolute value</td></tr>
<tr><td>[[$Abs|$Abs(x)]]<td>Absolute value</td></tr>
<tr><td>[[$ArcCos|$ArcCos(x)]]<td>Inverse cosine</td></tr>
<tr><td>[[$ArcCos|$ArcCos(x)]]<td>Inverse cosine</td></tr>
Line 18: Line 34:
<tr><td>[[$Erf|$Erf(x)]]<td>Error function</td></tr>
<tr><td>[[$Erf|$Erf(x)]]<td>Error function</td></tr>
<tr><td>[[$ErfC|$ErfC(x)]]<td>Complement error function</td></tr>
<tr><td>[[$ErfC|$ErfC(x)]]<td>Complement error function</td></tr>
<tr><td>[[$Exp|$Exp(x)]], [[$Exp_e|$Exp_e(x)]]<td>Get natural exponent of a number</td></tr>
<tr><td>[[$Exp or $Exp_e|$Exp(x), $Exp_e(x)]]<td>Get natural exponent of a number</td></tr>
<tr><td>[[$Exp2|$Exp2(x)]], [[$Exp_2|$Exp_2(x)]]<td>Get 2's exponent of a number</td></tr>
<tr><td>[[$Exp2 or $Exp_2|$Exp2(x), $Exp_2(x)]]<td>Get 2's exponent of a number</td></tr>
<tr><td>[[$Exp10|$Exp10(x)]], [[$Exp_10|$Exp_10(x)]]<td>Get 10's exponent of a number</td></tr>
<tr><td>[[$Exp10 or $Exp_10|$Exp10(x), $Exp_10(x)]]<td>Get 10's exponent of a number</td></tr>
<tr><td>[[$Gamma|$Gamma(x)]]<td>Gamma function</td></tr>
<tr><td>[[$Gamma|$Gamma(x)]]<td>Gamma function</td></tr>
<tr><td>[[$IxpI|$IxpI(x)]]<td>Integer base, integer exponent</td></tr>
<tr><td>[[$IxpI|$IxpI(x,y)]]<td>Integer base, integer exponent</td></tr>
<tr><td>[[$LGamma|$LGamma(x)]]<td>Log gamma function</td></tr>
<tr><td>[[$LGamma|$LGamma(x)]]<td>Log gamma function</td></tr>
<tr><td>[[$Log|$Log(x)]], [[$Log_e|$Log_e(x)]]<td>Get natural log of a number</td></tr>
<tr><td>[[$Log or $Log_e|$Log(x), $Log_e(x)]]<td>Get natural log of a number</td></tr>
<tr><td>[[$Log2|$Log2(x)]], [[$Log_2|$Log_2(x)]]<td>Get log base 2 of a number</td></tr>
<tr><td>[[$Log2 or $Log_2|$Log2(x), $Log_2(x)]]<td>Get log base 2 of a number</td></tr>
<tr><td>[[$Log10|$Log10(x)]], [[$Log_10|$Log_10(x)]]<td>Get log base 10 of a number</td></tr>
<tr><td>[[$Log10 or $Log_10|$Log10(x), $Log_10(x)]]<td>Get log base 10 of a number</td></tr>
<tr><td>[[$Max|$Max(x1,x2,x3,x4,x5,x6,x7,x8)]]<td>Return maximum of specified arguments</td></tr>
<tr><td>[[$Max|$Max(x1,x2,x3,x4,x5,x6,x7,x8)]]<td>Return maximum of specified arguments</td></tr>
<tr><td>[[$Min|$Min(x1,x2,x3,x4,x5,x6,x7,x8)]]<td>Return minimum of specified arguments</td></tr>
<tr><td>[[$Min|$Min(x1,x2,x3,x4,x5,x6,x7,x8)]]<td>Return minimum of specified arguments</td></tr>
<tr><td>[[$Pi|$Pi]]<td>Value of pi</td></tr>
<tr><td>[[$Pi|$Pi]]<td>Value of pi</td></tr>
<tr><td>[[$RxpI|$RxpI(x)]]<td>Real base, integer exponent</td></tr>
<tr><td>[[$RxpI|$RxpI(x,y)]]<td>Real base, integer exponent</td></tr>
<tr><td>[[$RxpR|$RxpR(x)]]<td>Real base, real exponent</td></tr>
<tr><td>[[$RxpR|$RxpR(x,y)]]<td>Real base, real exponent</td></tr>
<tr><td>[[$Sin|$Sin(x)]]<td>Sine of radian argument</td></tr>
<tr><td>[[$Sin|$Sin(x)]]<td>Sine of radian argument</td></tr>
<tr><td>[[$SinH|$SinH(x)]]<td>Hyperbolic sine</td></tr>
<tr><td>[[$SinH|$SinH(x)]]<td>Hyperbolic sine</td></tr>
Line 38: Line 54:
<tr><td>[[$TanH|$TanH(x)]]<td>Hyperbolic tangent</td></tr>
<tr><td>[[$TanH|$TanH(x)]]<td>Hyperbolic tangent</td></tr>
</table>
</table>
[[Category:$Functions| "Math" functions]]
[[Category:SOUL]]

Latest revision as of 19:06, 26 January 2018

As of Model 204 7.5, a set of high-performance, high-precision versions of the IBM mathematical $functions are built in to SOUL. These $functions, shown in the table below, eliminate the need to use external math libraries.

Note: Prior to version 7.5 of Model 204:

  • Your site could choose to use an external library instead of these integrated $functions. In such a case, these $functions would result in calls to the external library. For information on setting up an external math library for Model 204 version 7.4 or earlier, see your Model 204 installation guide for that version.
  • The high-performance, high-precision versions of these $functions were available as part of the Sirius Mods, and would be used if the SIRFUNC parameter has the X'01' bit turned on.

See Notation conventions for methods for information about the conventions followed in the $function descriptions.

Mathematical $function considerations

  • Error handling

    If invalid numerical values are passed to the mathematical functions (for example, a negative number to $Sqrt), an error message is printed at the user's terminal, and 0 is returned as the function's value.

Table of mathematical $functions

$FunctionDescription
$Abs(x)Absolute value
$ArcCos(x)Inverse cosine
$ArcSin(x)Inverse sine
$ArcTan(x)Arctangent
$ArcTan2(x,y)Arctangent of x/y
$Cos(x)Cosine of radian argument
$CosH(x)Hyperbolic cosine
$Cotan(x)Cotangent
$Erf(x)Error function
$ErfC(x)Complement error function
$Exp(x), $Exp_e(x)Get natural exponent of a number
$Exp2(x), $Exp_2(x)Get 2's exponent of a number
$Exp10(x), $Exp_10(x)Get 10's exponent of a number
$Gamma(x)Gamma function
$IxpI(x,y)Integer base, integer exponent
$LGamma(x)Log gamma function
$Log(x), $Log_e(x)Get natural log of a number
$Log2(x), $Log_2(x)Get log base 2 of a number
$Log10(x), $Log_10(x)Get log base 10 of a number
$Max(x1,x2,x3,x4,x5,x6,x7,x8)Return maximum of specified arguments
$Min(x1,x2,x3,x4,x5,x6,x7,x8)Return minimum of specified arguments
$PiValue of pi
$RxpI(x,y)Real base, integer exponent
$RxpR(x,y)Real base, real exponent
$Sin(x)Sine of radian argument
$SinH(x)Hyperbolic sine
$Sqrt(x)Square root of positive argument
$Tan(x)Tangent
$TanH(x)Hyperbolic tangent