You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question. In the ulp program, we formulate the data interval [-0.5, 1.0] for the program, but the value of the data in the program will exceed this interval, as shown below:
#./ulp -e 0.5 -r n -f atan2 -0.5 1.0 x -0.5 1.0 1000 atan2(-758032640005901072196627021490030084817733292767880968699295757878579464642193680699563542925245279209783296.0000000000000000, -98853056707272881102131689990518198269559039123449359701054226822449015051621586121797799515563919741145680595210207232.0000000000000000) got -98853056707272881102131689990518198269559039123449359701054226822449015051621586121797799515563919741145680595210207232.0000000000000000, want -3.1415926535821250 tail = +0.149384, ulp err -2.22597e+134
Because g->len = b-a gets a very large number, g->start + randn(g->len) is an uncontrolled number.
This is no problem in the interval [0.5, 1.0], because b-a gets the number of machines in [a, b]. But it is not applicable for the interval [-0.5, 1.0].
The text was updated successfully, but these errors were encountered:
the ulp program has several limitations, one is that the intervals you pass to it must be in representation order (e.g. -1.0 -2.0 is a valid interval, but -2.0 -1.0 is not, even though as real number interval the latter makes more sense, i think i should change the code to print an error message for wrong order, i will keep this bug open until i fix that).
note that the sampling is done based on representation i.e. 0.5 -0.5 interval means
this is important to keep in mind when using the tool, e.g. 0 0.5 interval does not mean uniform sampling of the real number interval but uniform sampling of all float numbers in that interval so it will sample just as many numbers between 0x1p-100 and 0x1p-99 as between 0.25 and 0.5.
this is not exactly intuitive, but originally the tool was only working with representations as input (i.e. 0 0xffffffff meant all numers for single precision floats and 0x7f800001 0x7fffffff meant all nans with positive sign, this still works and useful for testing nans).
and yes this can be annoying when you want to sample both positive and negative numbers, currently you have to use separate calls for that i.e.
#./ulp -e 0.5 -r n -f atan2 -0x1p-20 -0.5 x -0x1p-20 -0.5 1000
#./ulp -e 0.5 -r n -f atan2 -0x1p-20 -0.5 x +0x1p-20 +1.0 1000
#./ulp -e 0.5 -r n -f atan2 +0x1p-20 +1.0 x -0x1p-20 -0.5 1000
#./ulp -e 0.5 -r n -f atan2 +0x1p-20 +1.0 x +0x1p-20 +1.0 1000
if you have an idea how to usefully do sampling of real intervals (preferred syntax and semantics) let me know.
I have a question. In the ulp program, we formulate the data interval [-0.5, 1.0] for the program, but the value of the data in the program will exceed this interval, as shown below:
#
./ulp -e 0.5 -r n -f atan2 -0.5 1.0 x -0.5 1.0 1000
atan2(-758032640005901072196627021490030084817733292767880968699295757878579464642193680699563542925245279209783296.0000000000000000, -98853056707272881102131689990518198269559039123449359701054226822449015051621586121797799515563919741145680595210207232.0000000000000000) got -98853056707272881102131689990518198269559039123449359701054226822449015051621586121797799515563919741145680595210207232.0000000000000000, want -3.1415926535821250 tail = +0.149384, ulp err -2.22597e+134
Because
g->len = b-a
gets a very large number,g->start + randn(g->len)
is an uncontrolled number.This is no problem in the interval [0.5, 1.0], because b-a gets the number of machines in [a, b]. But it is not applicable for the interval [-0.5, 1.0].
The text was updated successfully, but these errors were encountered: