-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
59 lines (41 loc) · 1.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# deformula
<!-- badges: start -->
[![R-CMD-check](https://github.com/okamumu/deformula/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/okamumu/deformula/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/deformula)](https://CRAN.R-project.org/package=deformula)
[![Codecov test coverage](https://codecov.io/gh/okamumu/deformula/branch/master/graph/badge.svg)](https://app.codecov.io/gh/okamumu/deformula?branch=master)
<!-- badges: end -->
Integration of One-Dimensional Functions with Double Exponential Formulas
## Installation
You can install the released version of deformula from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("deformula")
```
## Description
The double exponential formula has been proposed by the following:
- H. Takahasi and M. Mori, Double Exponential Formulas for Numerical Integration, Publications of RIMS, Kyoto University, vol. 9 (1974), pg. 721–741.
which is known as the high precision quadrature. The double exponential formula is also called tanh_sinh, sinh_sinh and exp_sinh quadrature such as in Boost C++.
This package only implements tanh_sinh for a finite interval [lower, upper] and exp_sinh for $[0, \infty$.
## Example
The example shows the integral of the function $y = e^{-a x}$ on $[0, \infty)$:
```{r example1}
library(deformula)
f <- function(x, a) exp(-a*x)
deformula.zeroinf(f, a=0.1)
```
The example shows the integral of the function $y = e^{-a x}$ on $[0, 1]$:
```{r example2}
f <- function(x, a) exp(-a*x)
deformula.moneone(f, 0, 1, a=0.1)
```