Published
Edited
Sep 16, 2019
1 fork
2 stars
Insert cell
Insert cell
Arbuckle = new Promise((resolve, reject) => {
require('https://gitcdn.link/repo/follymath/arbuckle/master/lib/arbuckle.js').then((boot) => {
// be warned: returning this weird pseudo-promise created by emscripten will make observable runtime go insane
boot().then(Module => {
resolve(Module.lib)
}).catch(reject)
})
})
Insert cell
tex`\operatorname{Si}(1) = ${ℂ_tex(Arbuckle.si([1,0]))} = 0.946083070367183...`
Insert cell
Insert cell
tex`\zeta(2) = ${ℂ_tex(Arbuckle.zeta(2))} = \frac{π^2}{6}`
Insert cell
Insert cell
viewof σ = html`<input type=range min=0 max=3 step=0.001>`
Insert cell
viewof t = html`<input type=range min=0 max=100 step=0.001>`
Insert cell
tex`\zeta(${ℂ_tex(s)}) = ${ℂ_tex(Arbuckle.zeta(s))}`
Insert cell
Insert cell
Insert cell
viewof q = html`<input type=range min=0 max=100 step=0.001>`
Insert cell
viewof r = html`<input type=range min=0.001 max=10 step=0.001 value=0.001>`
Insert cell
tex`\zeta_H(${ℂ_tex(s)},${ℂ_tex(z)}) = ${ℂ_tex(Arbuckle.zeta2(s,z))}`
Insert cell
md`---
### Digamma ${tex`\psi(z)`}
`
Insert cell
// TODO why are we NaNing here?
// tex`\psi(0) = ${ℂ_tex(Arbuckle.digamma(0))} = \gamma`
Insert cell
Insert cell
tex`\psi_3(\frac{1}{2}) = ${ℂ_tex(Arbuckle.polygamma(3,1/2))} = π^4`
Insert cell
tex`\psi_{${ℂ_tex(s)}}(${ℂ_tex(z)}) = ${ℂ_tex(Arbuckle.polygamma(s,z))}`
Insert cell
Insert cell
viewof τ_re = html`<input type=range max=4 step=0.0001>`
Insert cell
viewof τ_im = html`<input type=range max=4 step=0.0001>`
Insert cell
Insert cell
tex`\eta(i) = ${ℂ_tex(Arbuckle.modeta([0,1]))} = \frac{Γ(\frac{1}{4})}{2 π^{\frac{3}{4}}}`
Insert cell
md`---
### Modular j-invariant ${tex`j(\tau)`}
`
Insert cell
// tex`j(i) = ${ℂ_tex(Arbuckle.modj([0,1]))} = 12^3`
Insert cell
// meh, close enough...
// tex`j(e^{2πi/3}) = ${ℂ_tex(Arbuckle.modj([Math.cos(2*Math.PI/3),Math.sin(2*Math.PI/3)]))} = 0`
Insert cell
// tex`j(${ℂ_tex([τ_re,τ_im])}) = ${ℂ_tex(Arbuckle.modj([τ_re,τ_im]))}`
Insert cell
Insert cell
`
TODO: examples for surfaced api...

ac_exp(z) Exponential function
ac_expm1(z) Accurate exp(z)-1
ac_log(z) Natural logarithm
ac_log1p(z) Accurate log(1+z)
ac_sqrt(z) Square root
ac_rsqrt(z) Reciprocal square root
ac_cbrt(z) Cube root
ac_pow(a,b) Power a^b

ac_sin(z) Trigonometric functions
ac_cos(z)
ac_tan(z)
ac_cot(z)
ac_sinpi(z) Trigonometric functions, argument multiplied by pi
ac_cospi(z)
ac_tanpi(z)
ac_cotpi(z)
ac_asin(z) Inverse trigonometric functions
ac_acos(z)
ac_atan(z)
ac_sinh(z) Hyperbolic functions
ac_cosh(z)
ac_tanh(z)
ac_coth(z)
ac_asinh(z) Inverse hyperbolic functions
ac_acosh(z)
ac_atanh(z)

ac_gamma(z) Gamma function
ac_rgamma(z) Reciprocal gamma function
ac_lgamma(z) Logarithmic gamma function
ac_digamma(z) Digamma function
✓ ac_zeta(s) Riemann zeta function
✓ ac_zeta2(s,a) Hurwitz zeta function
✓ ac_polygamma(s,z) Polygamma function
ac_polylog(s,z) Polylogarithm
ac_barnesg(s) Barnes G-function
ac_lbarnesg(s) Logarithmic Barnes G-function

ac_erf(s) Error function
ac_erfc(s) Complementary error function
ac_erfi(s) Imaginary error function
ac_gammaup(s,z) Upper incomplete gamma function
ac_expint(s,z) Generalized exponential integral E
ac_ei(z) Exponential integral Ei
ac_si(z) Sine integral
ac_ci(z) Cosine integral
ac_shi(z) Hyperbolic sine integral
ac_chi(z) Hyperbolic cosine integral
ac_li(z) Logarithmic integral
ac_lioffset(z) Offset logarithmic integral

ac_besselj(v,z) Bessel function J
ac_bessely(v,z) Bessel function Y
ac_besseli(v,z) Bessel function I
ac_besselk(v,z) Bessel function K
ac_ai(z) Airy function Ai
ac_aiprime(z) Airy function derivative Ai'
ac_bi(z) Airy function Bi
ac_biprime(z) Airy function derivative Bi'

ac_hyperu(a,b,z) Confluent hypergeometric function U
ac_hyp0f1(a,z) Confluent hypergeometric function 0F1
ac_hyp0f1r(a,z) Regularized confluent hypergeometric function 0F1
ac_hyp1f1(a,b,z) Confluent hypergeometric function 1F1
ac_hyp1f1r(a,b,z) Regularized confluent hypergeometric function 1F1
ac_hyp2f1(a,b,c,z) Hypergeometric function 2F1
ac_hyp2f1r(a,b,c,z) Regularized hypergeometric function 2F1

ac_chebyt(n,z) Chebyshev polynomial/function T
ac_chebyu(n,z) Chebyshev polynomial/function U
ac_jacobip(n,a,b,z) Jacobi polynomial/function P
ac_gegenbauerc(n,m,z) Gegenbauer polynomial/function C
ac_laguerrel(n,m,z) Laguerre polynomial/function L
ac_hermiteh(n,z) Hermite polynomial/function H
ac_legenp(n,m,z) Associated Legendre polynomial/function P
ac_legenpv(n,m,z) Associated Legendre polynomial/function P (alt. branch)
ac_legenq(n,m,z) Associated Legendre polynomial/function Q
ac_legenqv(n,m,z) Associated Legendre polynomial/function Q (alt. branch)

✓ ac_modeta(tau) Dedekind eta function
✓ ac_modj(tau) Modular j-invariant
ac_modlambda(tau) Modular lambda function
ac_moddelta(tau) Modular delta function
ac_agm1(z) Arithmetic-geometric mean of 1 and z
ac_ellipk(z) Complete elliptic integral K
ac_ellipe(z) Complete elliptic integral E
ac_ellipp(z,tau) Weierstrass elliptic function P
ac_theta1(z,tau) Jacobi theta function theta1
ac_theta2(z,tau) Jacobi theta function theta2
ac_theta3(z,tau) Jacobi theta function theta3
ac_theta4(z,tau) Jacobi theta function theta4
`
Insert cell
ℂ_tex = (a) => {
const [ re, im ] = a.slice(-2)
// TODO handle goofy forms
const format = (n) => String(n).replace(/e(\+|(-))(\d+)$/,'⋅10^{$2$3}')
return `${format(re)}${im < 0 ? '' : '+'}${format(im)}i`
}
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more