@@ -0,0 +1,1624 @@
+#!/usr/bin/env python%0A%22%22%22Benchmark scipy.special.betainc.%22%22%22%0A%0Afrom __future__ import print_function%0Aimport timeit%0A%0ANAME = %22betainc%22%0AREPEATS = 3%0AITERATIONS = 100000%0A%0A%0Adef print_version():%0A    %22%22%22Print the TAP version.%22%22%22%0A    print(%22TAP version 13%22)%0A%0A%0Adef print_summary(total, passing):%0A    %22%22%22Print the benchmark summary.%0A%0A    # Arguments%0A%0A    * %60total%60: total number of tests%0A    * %60passing%60: number of passing tests%0A%0A    %22%22%22%0A    print(%22#%22)%0A    print(%221..%22 + str(total))  # TAP plan%0A    print(%22# total %22 + str(total))%0A    print(%22# pass  %22 + str(passing))%0A    print(%22#%22)%0A    print(%22# ok%22)%0A%0A%0Adef print_results(elapsed):%0A    %22%22%22Print benchmark results.%0A%0A    # Arguments%0A%0A    * %60elapsed%60: elapsed time (in seconds)%0A%0A    # Examples%0A%0A    %60%60%60 python%0A    python%3E print_results(0.131009101868)%0A    %60%60%60%0A    %22%22%22%0A    rate = ITERATIONS / elapsed%0A%0A    print(%22  ---%22)%0A    print(%22  iterations: %22 + str(ITERATIONS))%0A    print(%22  elapsed: %22 + str(elapsed))%0A    print(%22  rate: %22 + str(rate))%0A    print(%22  ...%22)%0A%0A%0Adef benchmark():%0A    %22%22%22Run the benchmark and print benchmark results.%22%22%22%0A    setup = %22from scipy.special import betainc; from random import random;%22%0A    stmt = %22y = betainc(random(), 1000.0*random() + 0.01, 1000.0*random() + 0.01)%22%0A%0A    t = timeit.Timer(stmt, setup=setup)%0A%0A    print_version()%0A%0A    for i in xrange(REPEATS):%0A        print(%22# python::%22 + NAME)%0A        elapsed = t.timeit(number=ITERATIONS)%0A        print_results(elapsed)%0A        print(%22ok %22 + str(i+1) + %22 benchmark finished%22)%0A%0A    print_summary(REPEATS, REPEATS)%0A%0A%0Adef main():%0A    %22%22%22Run the benchmark.%22%22%22%0A    benchmark()%0A%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

Add SciPy benchmark