package com.imsl.test.example.math; import com.imsl.math.*; /** *

* Calculates various special functions.

* * Various special functions are exercised. Their use in this example typifies * the manner in which other special functions in the Sfun class would be used. * * @see Code * @see Output */ public class SfunEx1 { public static void main(String args[]) { double result; // Log base 10 of x double x = 100.; result = Sfun.log10(x); System.out.println("The log base 10 of 100. is " + result); // Factorial of 10 int n = 10; result = Sfun.fact(n); System.out.println("10 factorial is " + result); // Gamma of 5.0 double x1 = 5.; result = Sfun.gamma(x1); System.out.println("The Gamma function at 5.0 is " + result); // LogGamma of 1.85 double x2 = 1.85; result = Sfun.logGamma(x2); System.out.println("The logarithm of the absolute value of the " + "Gamma function \n at 1.85 is " + result); // Beta of (2.2, 3.7) double a = 2.2; double b = 3.7; result = Sfun.beta(a, b); System.out.println("Beta(2.2, 3.7) is " + result); // LogBeta of (2.2, 3.7) double a1 = 2.2; double b1 = 3.7; result = Sfun.logBeta(a1, b1); System.out.println("logBeta(2.2, 3.7) is " + result); } }