With numpy/i386 we don't fix any of the currently broken tests and
surprisingly one new regression is introduced:

-13 failed, 10900 passed, 88 skipped, 108 deselected, 19 xfailed, 2
xpassed, 5 warnings in 206.14 seconds
+14 failed, 10899 passed, 88 skipped, 108 deselected, 19 xfailed, 2
xpassed, 5 warnings in 205.49 seconds

The new breakage is due to a test that checks for errors that <= 2
ulps using sin on 32-bit floats vs sin on 64-bit floats (shown below).

Still, it may be worth committing the proposed change and then
separately seeing if we can improve the C versions of these functions.

_______________ TestAVXFloat32Transcendental.test_sincos_float32 _______________

self = <numpy.core.tests.test_umath.TestAVXFloat32Transcendental
object at 0x67afe550>

    def test_sincos_float32(self):
        np.random.seed(42)
        N = 1000000
        M = np.int_(N/20)
        index = np.random.randint(low=0, high=N, size=M)
        x_f32 = np.float32(np.random.uniform(low=-100.,high=100.,size=N))
        # test coverage for elements > 117435.992f for which glibc is used
        x_f32[index] = np.float32(10E+10*np.random.rand(M))
        x_f64 = np.float64(x_f32)
>       assert_array_max_ulp(np.sin(x_f32), np.float32(np.sin(x_f64)), maxulp=2)
E       AssertionError: Arrays are not almost equal up to 2 ULP (max
difference is 65 ULP)

M          = 50000
N          = 1000000
index      = array([121958, 671155, 131932, ..., 738271, 310195, 233966])
self       = <numpy.core.tests.test_umath.TestAVXFloat32Transcendental
object at 0x67afe550>
x_f32      = array([-10.577719, -35.353283, -97.29114 , ..., -80.99214
, -42.875526,
       -87.8052  ], dtype=float32)
x_f64      = array([-10.57771873, -35.35328293, -97.2911377 , ..., -80.99214172,
       -42.87552643, -87.80519867])

On Sun, Jan 9, 2022 at 4:57 PM Greg Steuck <[email protected]> wrote:
>
> Daniel Dickman <[email protected]> writes:
>
> > Here's the link to the commit Mark referenced:
> > https://github.com/NetBSD/src/commit/4f9e11b0dddf04640fe0553a9133a471af613627
> >
> > And then the actual implementations were removed in this commit:
> > https://github.com/NetBSD/src/commit/870f792ccadb412e522f37caec6028b0076a871b
> >
> > So I guess this is the list of functions to remove, Mark?
> >
> > I'm testing this on i386 with numpy to see if regress tests improve.
> >
> > s_cos.S
> > s_cosf.S
> > s_sin.S
> > s_sinf.S
> > s_tan.S
> > s_tanf.S
>
> This improves one of the regress tests mbuhl@ added. This one now
> passes:
>
> modified   regress/lib/libm/msun/Makefile
> @@ -58,7 +58,6 @@ FAILING+=     run-ctrig_test-1
>  FAILING+=      run-exponential_test-1
>  FAILING+=      run-invtrig_test-7
>  FAILING+=      run-next_test-{1,2,4}
> -FAILING+=      run-trig_test-3
>  . elif ${MACHINE} == arm64
>  FAILING+=      run-cexp_test-{1,7}
>  FAILING+=      run-ctrig_test-{1,5}
>
> But one new test is reported broken:
>
> ==== run-trig_test-2 ====
> 2 tests the accuracy of these functions over the primary range
> ./trig_test -r 2
>
> trig_test.c:257: 'fpequal_cs(_x, _y, 1)' evaluated to false
> *** Error 1 in . (Makefile:143 'run-trig_test-2')
> FAILED
>
> So, some attention is needed in this area.
>
> Thanks
> Greg

Reply via email to