Skip to content

Instantly share code, notes, and snippets.

@bjodah
bjodah / LICENSE.txt
Last active January 4, 2023 16:48
Jenkins-Traub from simbody converted into a class template for float/double/... specializations
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
@bjodah
bjodah / .gitignore
Created December 12, 2022 06:38 — forked from dhermes/.gitignore
Remez Algorithm for log(x)
*.pyc
*.aux
*.log
*.out
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bjodah
bjodah / .gitignore
Last active July 1, 2021 17:35 — forked from jbboehr/qemu-my-ppc64.sh
qemu provisioned virtual host running ubuntu-ppc64
*.img
*.qcow2
cloud.txt
@bjodah
bjodah / CMakeLists.txt
Created November 5, 2020 19:39
cereal & symengine
cmake_minimum_required(VERSION 3.16.2)
enable_language(CXX)
project(serial)
find_package(SymEngine REQUIRED CONFIG PATH_SUFFIXES lib/cmake/symengine)
add_executable(serial3_syme serial3_syme.cpp)
target_link_libraries(serial3_syme ${SYMENGINE_LIBRARIES})
target_include_directories(serial3_syme PRIVATE ${SYMENGINE_INCLUDE_DIRS})
set_target_properties(serial3_syme PROPERTIES
CXX_STANDARD 17
@bjodah
bjodah / gist:bf554c4eb6d75837c00b4ec01991da05
Last active April 11, 2022 11:48
Using emacs under windows
1. Install msys2 from msys2.org
2. run msys2.exe: pacman -Syu, restart, pacman -Su
3. run mingw64.exe: pamcan -S mingw-w64-x86_64-emacs
4. create C:\msys2_64\runemacs_patched_path.bat:
cmd /C "set PATH=C:\msys2_64\mingw64\bin;C:\msys2_64\usr\bin;%PATH% && C:\msys2_64\mingw64\bin\runemacs.exe --daemon"
5. Super-R shell:startup [RET]
6. Create shortcut to runemacs_patched_path.bat, call it e.g. "emacs-daemon"
7. Create a short-cut in Start menu:
C:\msys2_64\mingw64\bin\emacsclientw.exe -c -n -a "C:\msys2_64\mingw64\bin\runemacs.exe"
#!/bin/bash
# This script uses docker to build a specific symengine commit under CentOS6/GCC8/boost1.72
#
# Example usage:
#
# $ sudo ./docker_symengine_cos6.sh e7d7ae55f4fd6740a48acaea0e7e24542ceda6b7
#
if ! which docker; then
2>&1 echo "You need to have docker installed. See e.g. https://www.docker.com/community-edition#/download"
import math
import datetime
from functools import reduce
MÅNADER_PER_ÅR = 12
DAGAR_PER_ÅR = 365.25
DAGAR_PER_MÅNAD = DAGAR_PER_ÅR / MÅNADER_PER_ÅR
def årlig_tillväxt_i_procent_uttryckt_som_faktor_per_månad(x_procent):
# y**12 == 1 + årlig_aktie_avkastning_procent/100
# log(y) = log(1 + årlig_aktie_avkastning_procent/100)/12
@bjodah
bjodah / .gitignore
Last active August 4, 2020 20:04
Script to compile symengine with memory sanitizer enabled.
mount_*/
environment_*/
output.log