1987-05-27 10:05:01 +00:00
|
|
|
DEFINITION MODULE Mathlib;
|
1988-02-19 15:54:01 +00:00
|
|
|
(*
|
|
|
|
Module: Mathematical functions
|
|
|
|
Author: Ceriel J.H. Jacobs
|
|
|
|
Version: $Header$
|
|
|
|
*)
|
1987-05-27 10:05:01 +00:00
|
|
|
|
|
|
|
(* Some mathematical constants: *)
|
|
|
|
|
|
|
|
CONST
|
1988-07-25 16:41:51 +00:00
|
|
|
(* From: Computer Approximations
|
|
|
|
Hart, Cheney, e.a.
|
|
|
|
The SIAM Series in Applied Mathematics
|
|
|
|
John Wiley & Sons, INC. New York London Sydney, 1968
|
1987-05-27 10:05:01 +00:00
|
|
|
*)
|
|
|
|
|
1988-07-25 16:41:51 +00:00
|
|
|
pi = 3.14159265358979323846264338327950288;
|
|
|
|
twicepi = 6.28318530717958647692528676655900576;
|
|
|
|
halfpi = 1.57079632679489661923132169163975144;
|
|
|
|
quartpi = 0.78539816339744830961566084581987572;
|
|
|
|
e = 2.71828182845904523536028747135266250;
|
|
|
|
ln2 = 0.69314718055994530941723212145817657;
|
|
|
|
ln10 = 2.30258509299404568401799145468436421;
|
|
|
|
|
|
|
|
longpi = 3.14159265358979323846264338327950288D;
|
|
|
|
longtwicepi = 6.28318530717958647692528676655900576D;
|
|
|
|
longhalfpi = 1.57079632679489661923132169163975144D;
|
|
|
|
longquartpi = 0.78539816339744830961566084581987572D;
|
|
|
|
longe = 2.71828182845904523536028747135266250D;
|
|
|
|
longln2 = 0.69314718055994530941723212145817657D;
|
|
|
|
longln10 = 2.30258509299404568401799145468436421D;
|
1987-05-27 10:05:01 +00:00
|
|
|
|
|
|
|
(* basic functions *)
|
|
|
|
|
|
|
|
PROCEDURE pow(x: REAL; i: INTEGER): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longpow(x: LONGREAL; i: INTEGER): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE sqrt(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longsqrt(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE exp(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longexp(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE ln(x: REAL): REAL; (* natural log *)
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longln(x: LONGREAL): LONGREAL; (* natural log *)
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE log(x: REAL): REAL; (* log with base 10 *)
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longlog(x: LONGREAL): LONGREAL; (* log with base 10 *)
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
(* trigonometric functions; arguments in radians *)
|
|
|
|
|
|
|
|
PROCEDURE sin(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longsin(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE cos(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longcos(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE tan(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longtan(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arcsin(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarcsin(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arccos(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarccos(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arctan(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarctan(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
(* hyperbolic functions *)
|
|
|
|
|
|
|
|
PROCEDURE sinh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longsinh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE cosh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longcosh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE tanh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longtanh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arcsinh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarcsinh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arccosh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarccosh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE arctanh(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longarctanh(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
(* conversions *)
|
|
|
|
|
|
|
|
PROCEDURE RadianToDegree(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longRadianToDegree(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
PROCEDURE DegreeToRadian(x: REAL): REAL;
|
|
|
|
|
1988-06-30 16:32:54 +00:00
|
|
|
PROCEDURE longDegreeToRadian(x: LONGREAL): LONGREAL;
|
|
|
|
|
1987-05-27 10:05:01 +00:00
|
|
|
END Mathlib.
|