|
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 - download
Length: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, function Arctanh, seg_0130c2, 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 Arctanh (X : Float_Type) return Float_Type is -- On input, X is a floating-point value in Float_Type; -- On output, the value of Arctanh(X) (the inverse hyperbolic tangent of X) -- is returned. -- The definition of Arctanh(Y) is log((1+Y)/(1-Y)) / 2, which is also -- equivalent to the following three formulas: -- 1. ( log(1+Y) - log(1-Y) ) / 2 -- 2. ( log(Y+1) - log(-Y+1) ) / 2. -- 3. log( 1 + ( (2*Y) / (1-Y) ) ) / 2. -- but computationally, the last formula is better. Z, Sign_Y : Common_Float; Y, Abs_Y, Temp : Common_Float; Log2 : constant Common_Float := 16#0.B17217F7D1CF79ABC9E3B39803F2F6AF40#; Log2_Times_2 : constant Common_Float := (2.0 * Log2); begin -- Filter out exceptional cases. if (X = 0.0) then return (X); end if; Y := Common_Float (X); Abs_Y := abs (Y); if (Abs_Y = 1.0) then raise Constraint_Error; end if; if (Abs_Y > 1.0) then raise Argument_Error; end if; -- Calculate Arctanh(Y) by using KF_L1p. if (Y >= 0.0) then Sign_Y := 1.0; else Sign_Y := -1.0; end if; Temp := (2.0 * Abs_Y) / (1.0 - Abs_Y); Temp := Kf_L1p (Temp); Z := Sign_Y * 0.5 * Temp; return (Float_Type (Z)); end Arctanh;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=26 rec1=00 rec2=01 rec3=01e [0x01] rec0=17 rec1=00 rec2=02 rec3=000 tail 0x2150db4f682b151724d22 0x42a00066462061e03