{{ message }}

Instantly share code, notes, and snippets.

# Mustafa M musm

Created Jul 26, 2020
View compare.jl
 import Base.Math: rem_pio2_kernel, sin_kernel, cos_kernel function nansin(x::T) where T<:Union{Float64} absx = abs(x) if absx < T(pi)/4 #|x| ~<= pi/4, no need for reduction if absx < sqrt(eps(T)) return x end return sin_kernel(x) elseif isnan(x)
Created Jul 26, 2020
View compare.jl
 import Base.Math: rem_pio2_kernel, sin_kernel, cos_kernel function nansin(x::T) where T<:Union{Float64} absx = abs(x) if absx < T(pi)/4 #|x| ~<= pi/4, no need for reduction if absx < sqrt(eps(T)) return x end return sin_kernel(x) elseif isnan(x)
Created Jul 22, 2020
View gist:9671d346eb1e1fccb1bec9b96d5ed87e
 import Base.Math: significand_bits,exponent_bias @inline exp_kernel(x::Float64) = evalpoly(x, (1.0, 1.0, .5, .1666666666666666666)) const J_TABLE = Float64[2^((j-1)/1024) for j in 1:1024] function myexp(x::T) where T<:Float64 # Negation so NaN gets caught if !(abs(x) < 708.3964185322641) x <= -708.3964185322641 && return 0.0
Last active Jul 4, 2020 — forked from nickbudi/README.md
Cygwin git compatibility with VS Code (or other Windows programs) using cygpath

# Cygwin Git + VS Code compatibility

Thanks and credit to mattn and ferreus on GitHub.

Check out `wslpath` if you're using the Windows Subsystem for Linux.

Created Mar 20, 2020
View vs code theme tweaks
 // the following disables italic comments! "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": ["comment"], "settings": { "fontStyle": "" } }
Created Jul 3, 2019
View gist:8f60a31a775a72411f9173637bba0642
 In file included from H5PLint.c:32:0: H5PLint.c: In function ‘H5PL__open’: H5PLpkg.h:97:30: warning: implicit declaration of function ‘dlopen’; did you mean ‘fdopen’? [-Wimplicit-function-declaration] # define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) ^ H5PLint.c:326:27: note: in expansion of macro ‘H5PL_OPEN_DLIB’ if (NULL == (handle = H5PL_OPEN_DLIB(path))) { ^~~~~~~~~~~~~~ H5PLpkg.h:97:40: error: ‘RTLD_LAZY’ undeclared (first use in this function) # define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
Last active Aug 16, 2017
View gist:7b51c83e56bfc1a4de58df23be3db3f0
 julia> versioninfo() Julia Version 0.7.0-DEV.1208 Commit 952dc93489* (2017-08-02 23:54 UTC) Platform Info: OS: Linux (x86_64-linux-gnu) CPU: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell) LAPACK: libopenblas64_ LIBM: libopenlibm
Created Jul 31, 2017
View gist:be8d8b3f9e89d5d1d4b7ae7d3118cb94
Created Jul 14, 2017
View gist:117d2a64cc8dc874455de45283b230df
MD5: `59bab8f71f8c096cd3f72cd73851515d`
Rename it to: `Sublime Text`
Make it executable with: `chmod u+x Sublime\ Text`