Skip to content

Commit fc8f5ca

Browse files
committed
libm/test: Add a couple of hypot test cases
These check some corner cases in the computation demonstrating that our hypot can generate up to 1ulp of error. Signed-off-by: Keith Packard <[email protected]>
1 parent 9e3b65d commit fc8f5ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

newlib/libm/test/hypotf_vec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
#include "test.h"
1818
one_line_type hypotf_vec[] = {
19+
{64, 0,123,__LINE__, 0x3eb6a50c, 0xf4058710, 0x3eb00322, 0x40000000, 0x3eb00322, 0x40000000}, /* 0x1.6a50cf405871p-20=f(0x1.003224p-20,0x1.003224p-20)*/
20+
{64, 0,123,__LINE__, 0x3eb00322, 0x2fffffff, 0xbeb00322, 0x20000000, 0xbdf6a2d5, 0x80000000}, /* 0x1.003222p-20=f(-0x1.003222p-20, -0x1.6a2d58p-32) */
1921
{36, 0,123,__LINE__, 0x40085ed7, 0x60000000, 0xbff33333, 0x33333333, 0x40066666, 0x66666666}, /* 3.04631=f(-1.2, 2.8)*/
2022
{35, 0,123,__LINE__, 0x400869a7, 0xe0000000, 0xbff30a3d, 0x70a3d70a, 0x40067ae1, 0x47ae147b}, /* 3.05159=f(-1.19, 2.81)*/
2123
{35, 0,123,__LINE__, 0x40087495, 0xe0000000, 0xbff2e147, 0xae147ae1, 0x40068f5c, 0x28f5c290}, /* 3.05693=f(-1.18, 2.82)*/

0 commit comments

Comments
 (0)