Rcpp with quad precision computation

后端 未结 2 1109
温柔的废话
温柔的废话 2021-01-17 05:00

What is the best way to numerically compute things like the following within Rcpp?

exp(-1500)/(exp(-1500)+exp(-1501))

In many cases, the computa

2条回答
  •  粉色の甜心
    2021-01-17 05:21

    I fear you may be mostly confused.

    Rcpp is a bridge between R and C++. It is neither a new language, nor a new system.

    And in C++ you use something like GNU gmplib aka The GNU Multiple Precision Arithmetic Library which, of course, has already been wrapped for R as package gmp

    But if you want to write C++ functions, called from R, interfacing the GMP library -- you certainly. It falls back to 'how do I write a C++ function callable from R which accesses an external library' -- and that question has been covered numerous times here too.

提交回复
热议问题