def _cached_roots_legendre(n):
 if (n in _cached_roots_legendre.cache):
  return _cached_roots_legendre.cache[n]
 _cached_roots_legendre.cache[n] = roots_legendre(n)
 return _cached_roots_legendre.cache[n]

def _cached_roots_legendre ( n ) : if ( n in _cached_roots_legendre . cache ) : return _cached_roots_legendre . cache [ n ] _cached_roots_legendre . cache [ n ] = roots_legendre ( n ) return _cached_roots_legendre . cache [ n ]
cache roots_legendre results to speed up calls of the fixed_quad function .