This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/time.h> | |
const int n = 160000000; | |
// Print number of milliseconds between timevals | |
void printDuration(timeval a, timeval b, char* message) | |
{ | |
double elapsedTime = (b.tv_sec - a.tv_sec) * 1000.0; | |
elapsedTime += (b.tv_usec - a.tv_usec) / 1000.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import theano | |
import theano.tensor as T | |
def log_gamma_lanczos(z): | |
assert z.dtype.startswith("float") | |
# reflection formula. Normally only used for negative arguments, | |
# but here it's also used for 0 < z < 0.5 to improve accuracy in | |
# this region. |