Skip to content

Commit e713a4f

Browse files
committed
Trac #32964: speed up a very slow doctest in functions.orthogonal_polys.
I've got 99 problems, and they're slow. One doctest in this module is repeating a random test 100 times, taking over four minutes on my machine. More tests are better, but in this case, coverage will eventually accrue from the number of testers even if we only repeat the test once within the file. Since this particular test is an EXAMPLE, I've also made it a bit more user-friendly while eliminating the additional runs. message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch u/mjo/ticket/32964 # Changes to be committed: # modified: src/sage/functions/orthogonal_polys.py #
1 parent cc60cfe commit e713a4f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/sage/functions/orthogonal_polys.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,10 +2081,13 @@ class Func_ultraspherical(GinacFunction):
20812081
sage: gegenbauer(3,2,t)
20822082
32*t^3 - 12*t
20832083
sage: _ = var('x')
2084-
sage: for N in range(100):
2085-
....: n = ZZ.random_element(5, 5001)
2086-
....: a = QQ.random_element().abs() + 5
2087-
....: assert ((n+1)*ultraspherical(n+1,a,x) - 2*x*(n+a)*ultraspherical(n,a,x) + (n+2*a-1)*ultraspherical(n-1,a,x)).expand().is_zero()
2084+
sage: n = ZZ.random_element(5, 5001)
2085+
sage: a = QQ.random_element().abs() + 5
2086+
sage: s = ( (n+1)*ultraspherical(n+1,a,x)
2087+
....: - 2*x*(n+a)*ultraspherical(n,a,x)
2088+
....: + (n+2*a-1)*ultraspherical(n-1,a,x) )
2089+
sage: s.expand().is_zero()
2090+
True
20882091
sage: ultraspherical(5,9/10,3.1416)
20892092
6949.55439044240
20902093
sage: ultraspherical(5,9/10,RealField(100)(pi))

0 commit comments

Comments
 (0)