|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 4096 (0x1000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, function Arcsinh, seg_0130c0, separate Generic_Elementary_Functions
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
separate (Generic_Elementary_Functions)
function Arcsinh (X : Float_Type) return Float_Type is
-- On input, X is a floating-point value in Float_Type;
-- On output, the value of Arcsinh(X) (the inverse hyperbolic sin of X)
-- is returned.
-- The definition of Arcsinh(Y) is log( Y + sqrt(Y*Y + 1) )
-- For symmetry, we return sign(Y)*Arcsinh(|Y|). The discussions below
-- therefore assume Y >= 0.
-- To obtain good accuracy, we consider several cases:
-- 1) Y <= epsilon, simply return Y.
-- 2) epsilon < Y <= 0.5,
-- Y + sqrt(Y*Y+1) = 1 + ( Y + Y*Y/[1 + sqrt(Y*Y+1)] )
-- = 1 + ( Y + Y / [ (1/Y) + sqrt(1 + [1/Y*Y]) ] )
-- A formula best suited for the kernel function L1p.
-- 3) 0.5 < Y < 10/epsilon,
-- Y + sqrt(Y*Y+1) = 2( Y + 0.5/[ sqrt(Y*Y+1) + Y ] ).
-- 4) 10/epsilon <= Y, then
-- Y + sqrt(Y*Y+1) = 2Y for practical purposes.
-- Note that (3) and (4) are suited for invoking the kernel procedure
-- KP_Log(Input) which returns M, Z1, and Z2 where
-- log(Input) = M * log(2) + Z1 + Z2.
--
Y, Sign_X, V, M, Z1, Z2, Result : Common_Float;
One : constant := 1.0;
Half : constant := 0.5;
Small_Threshold : constant Common_Float := Common_Float'Base'Epsilon;
Large_Threshold : constant Common_Float := 10.0 / Common_Float'Base'Epsilon;
Log2_Lead : constant Common_Float := 16#0.B17#;
Log2_Trail : constant Common_Float :=
16#0.000217F7D1CF79ABC9E3B39803F2F6AF40#;
begin
Y := Common_Float (X);
Sign_X := Copy_Sign (One, Y);
Y := abs (Y);
if (Y <= Half) then
if (Y < Small_Threshold) then
return (Float_Type (Copy_Sign (Y, Sign_X)));
else
V := Y + Y / ((One / Y) + Kf_Sqrt (One + (One / (Y * Y))));
Result := Kf_L1p (V);
end if;
else
if (Y < Large_Threshold) then
Y := Y + Half / (Y + Kf_Sqrt (One + Y * Y));
end if;
Kp_Log (Y, M, Z1, Z2);
M := M + One;
Result := M * Log2_Lead + (Z1 + (Z2 + M * Log2_Trail));
end if;
return (Float_Type (Copy_Sign (Result, Sign_X)));
end Arcsinh;
nblk1=3
nid=0
hdr6=6
[0x00] rec0=18 rec1=00 rec2=01 rec3=01c
[0x01] rec0=24 rec1=00 rec2=02 rec3=01a
[0x02] rec0=0a rec1=00 rec2=03 rec3=000
tail 0x2150db4e282b1516dcfb9 0x42a00066462061e03