]> Cypherpunks repositories - gostls13.git/commitdiff
math: add more tests for special cases of Bessel functions Y0, Y1, Yn
authorAlexander Döring <email@alexd.ch>
Mon, 20 Feb 2017 19:34:36 +0000 (20:34 +0100)
committerRobert Griesemer <gri@golang.org>
Wed, 22 Feb 2017 17:52:15 +0000 (17:52 +0000)
Test finite negative x with Y0(-1), Y1(-1), Yn(2,-1), Yn(-3,-1).

Also test the special case Yn(0,0).

Fixes #19130.

Change-Id: I95f05a72e1c455ed8ddf202c56f4266f03f370fd
Reviewed-on: https://go-review.googlesource.com/37310
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/all_test.go

index df770a1fe0122cd12f5ae736c95f89c54d3b9e2c..967849c036249295af366c0550d70f4df872ceaa 100644 (file)
@@ -1742,30 +1742,35 @@ var vfy0SC = []float64{
        0,
        Inf(1),
        NaN(),
+       -1,
 }
 var y0SC = []float64{
        NaN(),
        Inf(-1),
        0,
        NaN(),
+       NaN(),
 }
 var y1SC = []float64{
        NaN(),
        Inf(-1),
        0,
        NaN(),
+       NaN(),
 }
 var y2SC = []float64{
        NaN(),
        Inf(-1),
        0,
        NaN(),
+       NaN(),
 }
 var yM3SC = []float64{
        NaN(),
        Inf(1),
        0,
        NaN(),
+       NaN(),
 }
 
 // arguments and expected results for boundary cases
@@ -2716,6 +2721,9 @@ func TestYn(t *testing.T) {
                        t.Errorf("Yn(-3, %g) = %g, want %g", vfy0SC[i], f, yM3SC[i])
                }
        }
+       if f := Yn(0, 0); !alike(Inf(-1), f) {
+               t.Errorf("Yn(0, 0) = %g, want %g", f, Inf(-1))
+       }
 }
 
 // Check that math functions of high angle values