View trapezoid.c
Naive implementation of the trapezoidal rule for integration.
(A non-naive implementation would provide adaptivity, etc.)
WARNING: I have not checked carefully that the code is correct.
Let me know if there is a bug.
#include "arb.h"
#include "arb_poly.h"
View arbmpfr.c
#include "arb.h"
#include "acb_hypgeom.h"
void arb_root_ui_algebraic(arb_t res, const arb_t x, ulong k, slong prec);
_arb_pow(arb_t res, const arb_t x, const arb_t y, slong prec)
slong rootlim;
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
View zoom.c
/* 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"
View doomstat.txt
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)
# -*- coding: utf-8 -*-
import datetime
import matplotlib
import codecs
# history downloaded with
fp ="tracks.txt", "r", "utf8")
albums = {}
View gist:327573e1aa39c6358fcb
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
"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."
View gist:8b9b1f5ac62c58063261
#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;
View gist:37676f396ed74ca804ef
function exp{T <: Ring}(a::T)
a != 0 && error("Exponential of nonzero element")
return one(T)
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")
View gist:80aa4df800f7ee6b87f3
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)