public void ArsinhBorderTest() { MultiPrecision <Pow2.N8>[] borders = new MultiPrecision <Pow2.N8>[] { -1, 0, 1, -MultiPrecision <Pow2.N8> .Ldexp(1, -256), MultiPrecision <Pow2.N8> .Ldexp(1, -256) }; foreach (MultiPrecision <Pow2.N8> b in borders) { List <MultiPrecision <Pow2.N8> > ys = new(); foreach (MultiPrecision <Pow2.N8> x in TestTool.EnumerateNeighbor(b)) { MultiPrecision <Pow2.N8> y = MultiPrecision <Pow2.N8> .Arsinh(x); Console.WriteLine(x); Console.WriteLine(x.ToHexcode()); Console.WriteLine(y); Console.WriteLine(y.ToHexcode()); Console.Write("\n"); TestTool.Tolerance(Math.Asinh((double)x), y); ys.Add(y); } if (b != 0) { TestTool.NearlyNeighbors(ys, 3); } TestTool.SmoothnessSatisfied(ys, 1); TestTool.MonotonicitySatisfied(ys); Console.Write("\n"); } }
public void ArsinhTest() { foreach (MultiPrecision <Pow2.N8> x in TestTool.AllRangeSet <Pow2.N8>()) { MultiPrecision <Pow2.N8> y = MultiPrecision <Pow2.N8> .Arsinh(x); Console.WriteLine(x); Console.WriteLine(y); TestTool.Tolerance(Math.Asinh((double)x), y); } }
public void ArsinhUnnormalValueTest() { MultiPrecision <Pow2.N8> y = MultiPrecision <Pow2.N8> .Arsinh(MultiPrecision <Pow2.N8> .NaN); Assert.IsTrue(y.IsNaN); }