exception handling complex elementary functions (fwd)

Andrew Binkley abinkley@cs.toronto.edu
Fri Jan 23 00:23:00 GMT 2004


Brian,
I have changed the format.  However, I ran into a small difficulty.  To
test the code fully, it is necc. to run cases where the machine overflows.
Subsquent tests behave in a strange fashion -- not entering the correct
blocks in gcov for instance (hence my earlier gcov question).

To get the correct results and, to fully test the code, the tests need to
be run one by one.  Assume that test.out is the executable that excersises
the code.  If test.out tests multiple cases, the results may be incorrect.
Instead what is required is that test.out only tests one result each time
it is run.

I think that this may pose a problem for the GSL testing system (not
sure).  If you get different results from the ones in my file when you
test, or the coverage in gcov is not complete, I think this is the most
likely explanation.  I had to do the tests one by one.  The composite gcov
covers all the code.

Hope this helps,
Andrew




On Fri, 16 Jan 2004, Brian Gough wrote:

> Andrew Binkley writes:
>  > Here are the test cases.  They should excercise all portions of the code.
>  > I had to redo the log ones -- thus the delay in my reply.  I am not
>  > familiar with the test suite so I have just included the cases in plain
>  > text.
>
> Hello,
>
> To add tests by hand to the test suite what you need to do is make a
> file results_eh.h containing lines like
>
>   {FN (sqrt), ARG(0.0e+00,0.0e+00), RES(0e0, 0.0)},
>
> where FN is the function (without the gsl_complex prefix), ARG is the
> argument and RES is the result.  Then #include this file in test.c
> immediately after the line where the existing results.h file is
> included.
>
> --
> Brian
>
-------------- next part --------------
{FN (abs), ARG(1.00000000000000000718e+155, 2.99999999999999976329e+250), RES(2.99999999999999976329e+250, 0)},
{FN (abs), ARG(1.00000000000000000718e+155, 0), RES(1.00000000000000000718e+155, 0)},
{FN (abs), ARG(9.99999999999999921097e+249, 2.99999999999999976329e+250), RES(3.16227766016837922087e+250, 0)},
{FN (abs), ARG(0, 9.999999999999999821e-201), RES(9.999999999999999821e-201, 0)},
{FN (abs), ARG(10, 9.99999999999999969733e+199), RES(9.99999999999999969733e+199, 0)},
{FN (abs), ARG(1.69999999999999993883e+308, 1.69999999999999993883e+308), RES(inf, 0)},
{FN (sqrt), ARG(0, 9.999999999999999821e-201), RES(7.07106781186547506272e-101, 7.07106781186547506272e-101)},
{FN (sqrt), ARG(0, 9.99999999999999969733e+199), RES(7.07106781186547513571e+99, 7.07106781186547513571e+99)},
{FN (sqrt), ARG(-9.99999999999999969733e+199, 0), RES(0, 1.0000000000000000159e+100)},
{FN (sqrt), ARG(9.999999999999999821e-201, 0), RES(1.00000000000000001999e-100, 0)},
{FN (sqrt), ARG(10, 9.99999999999999996437e+219), RES(7.07106781186547563475e+109, 7.07106781186547480038e+109)},
{FN (sqrt), ARG(9.99999999999999996437e+219, 3000000000000000), RES(1.00000000000000002357e+110, 1.50000000000000006735e-95)},
{FN (sqrt), ARG(1.99999999999999984219e+250, 2.99999999999999976329e+250), RES(1.67414922803553996849e+125, 8.95977476129838072532e+124)},
{FN (sqrt), ARG(-1.99999999999999984219e+250, 2.99999999999999976329e+250), RES(8.95977476129838072532e+124, 1.67414922803553996849e+125)},
{FN (exp), ARG(2, 2), RES(-3.0749323206393590624, 6.7188496974282498897)},
{FN (exp), ARG(999, 0), RES(inf, nan)},
{FN (exp), ARG(-999, 0), RES(0, 0)},
{FN (exp), ARG(-708.396409999999946194, 0.785000000000000031086), RES(1.57400457530412411305e-308, 1.57275165208747413144e-308)},
{FN (exp), ARG(-708.396409999999946194, 0), RES(2.22509284350613005464e-308, 0)},
{FN (exp), ARG(-708.396409999999946194, 1.57079632679489633595), RES(4.94065645841246544177e-324, 2.22509284350613005464e-308)},
{FN (log), ARG(0, 0), RES(0, 0)},
{FN (log), ARG(1.000000000000000054e-250, 1.000000000000000054e-250), RES(-575.299699658231475041, 0.785398163397448278999)},
{FN (log), ARG(9.99999999999999921097e+249, 1.10000000000000007218e+250), RES(576.042769506276272296, 0.832981266674431730657)},
{FN (log), ARG(9, 0), RES(2.19722457733621956422, 0)},
{FN (log), ARG(0.5, 0.100000000000000005551), RES(-0.673536823983304611119, 0.197395559849880775083)},
{FN (log), ARG(9.99999999999999988453e+254, 0.100000000000000005551), RES(587.159198713481600862, 1.00000000000000012521e-256)},
{FN (log), ARG(4.9999999999999995624e-199, 1), RES(0, 1.570796326794896558)},
{FN (log), ARG(5.00000000000000015064e+256, 5.00000000000000031846e-254), RES(591.071221718909782794, 0)},
{FN (sin), ARG(1, 1), RES(1.29845758141597733548, 0.63496391478473601655)},
{FN (sin), ARG(0, 999), RES(nan, inf)},
{FN (sin), ARG(1.57079631999999991265, 9.99999999999999909327e-308), RES(1, 6.79489668483016391198e-316)},
{FN (cos), ARG(0, 0), RES(1, -0)},
{FN (cos), ARG(0, 999), RES(inf, nan)},
{FN (cos), ARG(1.00000000000000002506e-300, 1.0000000000000000279e-306), RES(1, -0)},


More information about the Gsl-discuss mailing list