|
|
@@ -1290,11 +1290,13 @@ function cosh(x : Single) : Single;
|
|
|
var
|
|
|
temp : ValReal;
|
|
|
begin
|
|
|
+ if (x>8.94159862326326216608E+0001) or (x<-8.94159862326326216608E+0001) then
|
|
|
{$push}
|
|
|
{$checkfpuexceptions on}
|
|
|
- if (x>8.94159862326326216608E+0001) or (x<-8.94159862326326216608E+0001) then
|
|
|
exit(huge_single*huge_single);
|
|
|
+{$pop}
|
|
|
temp:=exp(x);
|
|
|
+{$push}
|
|
|
{$safefpuexceptions on}
|
|
|
cosh:=0.5*(temp+1.0/temp);
|
|
|
{$pop}
|
|
|
@@ -1307,11 +1309,13 @@ function cosh(x : Double) : Double;
|
|
|
var
|
|
|
temp : ValReal;
|
|
|
begin
|
|
|
+ if (x>7.10475860073943942030E+0002) or (x<-7.10475860073943942030E+0002) then
|
|
|
{$push}
|
|
|
{$checkfpuexceptions on}
|
|
|
- if (x>7.10475860073943942030E+0002) or (x<-7.10475860073943942030E+0002) then
|
|
|
exit(huge_double*huge_double);
|
|
|
+{$pop}
|
|
|
temp:=exp(x);
|
|
|
+{$push}
|
|
|
{$safefpuexceptions on}
|
|
|
cosh:=0.5*(temp+1.0/temp);
|
|
|
{$pop}
|
|
|
@@ -1335,16 +1339,21 @@ function sinh(x : Single) : Single;
|
|
|
var
|
|
|
temp : ValReal;
|
|
|
begin
|
|
|
+ if x>8.94159862326326216608E+0001 then
|
|
|
{$push}
|
|
|
{$checkfpuexceptions on}
|
|
|
- if x>8.94159862326326216608E+0001 then
|
|
|
exit(huge_single*huge_single);
|
|
|
+{$pop}
|
|
|
if x<-8.94159862326326216608E+0001 then
|
|
|
+{$push}
|
|
|
+{$checkfpuexceptions on}
|
|
|
exit(-(huge_single*huge_single));
|
|
|
+{$pop}
|
|
|
temp:=exp(x);
|
|
|
{ gives better behavior around zero, and in particular ensures that sinh(-0.0)=-0.0 }
|
|
|
if temp=1 then
|
|
|
exit(x);
|
|
|
+{$push}
|
|
|
{$safefpuexceptions on}
|
|
|
sinh:=0.5*(temp-1.0/temp);
|
|
|
{$pop}
|
|
|
@@ -1357,15 +1366,20 @@ function sinh(x : Double) : Double;
|
|
|
var
|
|
|
temp : ValReal;
|
|
|
begin
|
|
|
+ if x>7.10475860073943942030E+0002 then
|
|
|
{$push}
|
|
|
{$checkfpuexceptions on}
|
|
|
- if x>7.10475860073943942030E+0002 then
|
|
|
exit(huge_double*huge_double);
|
|
|
+{$pop}
|
|
|
if x<-7.10475860073943942030E+0002 then
|
|
|
+{$push}
|
|
|
+{$checkfpuexceptions on}
|
|
|
exit(-(huge_double*huge_double));
|
|
|
+{$pop}
|
|
|
temp:=exp(x);
|
|
|
if temp=1 then
|
|
|
exit(x);
|
|
|
+{$push}
|
|
|
{$safefpuexceptions on}
|
|
|
sinh:=0.5*(temp-1.0/temp);
|
|
|
{$pop}
|