🕵️♂️
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
void _nmod_poly_powmod_mpz_binexp(mp_ptr res, mp_srcptr poly, | |
mpz_srcptr e, mp_srcptr f, | |
slong lenf, nmod_t mod) { | |
mp_ptr T, Q ; | |
slong lenT, lenQ ; | |
slong i ; | |
if (lenf == 2) { | |
res[0] = n_powmod2_mpz(poly[0], e, mod.n, mod.ninv) ; | |
return ;} |
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 "ulong_extras.h" | |
#include "profiler.h" | |
mp_limb_t n_sqrtmod_brute(mp_limb_t a, mp_limb_t p) | |
{ | |
mp_limb_t t, t2; | |
if (a <= 1) | |
{ | |
return a; |
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
function chebyshev_t_pair{S <: Ring}(n::Int, x::S) | |
if n == 0 | |
return one(S), x | |
elseif n == 1 | |
return x, one(S) | |
elseif n < 0 | |
a, b = chebyshev_t_pair(1-n, x) | |
return b, a | |
elseif iseven(n) | |
a, b = chebyshev_t_pair(n>>1, x) |
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
function exp{T <: Ring}(a::T) | |
a != 0 && error("Exponential of nonzero element") | |
return one(T) | |
end | |
function exp{T<: Ring, S}(a::PowerSeries{T, S}) | |
if a == 0 | |
return PowerSeries(PowerSeries{T, S}, [one(T)], a.prec) | |
elseif a.prec == nothing | |
error("Unable to compute exponential of infinite precision power series") |
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 "acb_modular.h" | |
#include "profiler.h" | |
/* HLS algorithm from python's colorsys module */ | |
static double vv(double m1, double m2, double hue) | |
{ | |
hue = hue - floor(hue); | |
if (hue < 1/6.) | |
return m1 + (m2-m1)*hue*6.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
Tyrion thought. Her mother slapped his gloved hands. "The direwolf to her father." | |
"The city," Jon said. "The led had his mother climbed up and always wanted so much even his place and pucked in the shadow of her grave. The dragons lined in the east, and she must in a woman and the cage. | |
"Maybe I should make the promises I shall look until the three-eyed man will be done. She ought to ride in the Summer Isles, and to him, but if the other burned that he had been | |
free of the keep." | |
"He was served to my husband when I was clever on the coat, but no more than her son?" | |
"You will believe a son of | |
Dorne." | |
"This is a time saying that you are four much than the wildling with down a good stones look for her own man." | |
"The dragons?" | |
"No, Your Grace," said Jaime. "A certain day that I would show her the man of us." |
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
# -*- coding: utf-8 -*- | |
import datetime | |
import matplotlib | |
import codecs | |
# history downloaded with lastexport.py https://gist.github.com/bitmorse/5201491 | |
fp = codecs.open("tracks.txt", "r", "utf8") | |
albums = {} |
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
sf2011 2.2148 ( 60136 / 27151.49) | |
sf2012 1.5506 ( 58373 / 37644.64) | |
sod 1.2943 ( 14345 / 11083.45) | |
ksutra 0.8053 ( 10215 / 12685.39) | |
hr2 0.7973 ( 10109 / 12679.42) | |
scythe 0.7924 ( 3379 / 4264.11) | |
av 0.7730 ( 10317 / 13346.92) | |
scythe2 0.7381 ( 6094 / 8256.14) | |
doom2 0.6963 ( 3540 / 5083.80) | |
doom 0.5851 ( 2907 / 4968.16) |
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
/* This file is public domain. Author: Fredrik Johansson. */ | |
/* complex_plot.c, hacked to render animation frames */ | |
/* convert to video with: */ | |
/* avconv -r 32 -i anim%04d.png -r 32 -c:v h264 -crf 1 test.flv */ | |
#include <stdlib.h> | |
#include <string.h> | |
#include "acb.h" | |
#include "acb_hypgeom.h" |
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
""" | |
Animates output of | |
build/examples/real_roots 0 0 50 -verbose > outlog.txt | |
build/examples/real_roots 0 47 50 -verbose > outlog2.txt | |
assuming that the following hack of a patch has been applied to arb: | |
diff --git a/arb_calc/isolate_roots.c b/arb_calc/isolate_roots.c | |
index ac425fb..4981601 100644 |