Computation of hypergeometric function in R I'm having tremendous difficulty evaluating $_2F_1(a,b;c;z)$ with the hypergeo package in R. In my case, values of $a$, $b$, $c$ are always positive real numbers. Even so, the hypergeometric function is incredibly sensitive to their values. I am not looking for extreme precision; I can use Excel to get a rough estimation of the Guass hypergeometric that is fine for my purposes. 
Any suggestions for an implementation in R that will give a fast, error-free, if not super accurate Gaussian hypergeometric computation of positive real numbers with a wide range of values?
Edit: it seems there is far more code for this in MATLAB than R. Any thoughts as to why?
 A: Unless you need to evaluate the Gauss hypergeometric function for complex values of the parameters or the variable, it is better to use Robin Hankin's gsl package.
Based on my experience I also recommend to only evaluate the Gauss hypergeometric function for a value of the variable lying in $[0,1]$, and use a transformation formula for values in $]-\infty, 0]$.
library(gsl)
Gauss2F1 <- function(a,b,c,x){
    if(x>=0 & x<1){
        hyperg_2F1(a,b,c,x)
    }else{
            hyperg_2F1(c-a,b,c,1-1/(1-x))/(1-x)^b
        }
}

A: @Stéphane Laurent's's formula above is great. I've noticed that it sometimes produces NaNs when a, b, c are large and z is negative – I haven't been able to pin the precise conditions down. In these cases we can use another hypergeometric transformation starting from Stéphane's alternative expression. It leads to this alternative formula:
library(gsl)
Gauss2F1b <- function(a,b,c,x){
    if(x>=0 & x<1){
        hyperg_2F1(a,b,c,x)
    }else{
        hyperg_2F1(a,c-b,c,1-1/(1-x))/(1-x)^a
    }
}

For example:
> Gauss2F1(80.2,50.1,61.3,-1)
[1] NaN
>
> Gauss2F1b(80.2,50.1,61.3,-1)
[1] 5.498597e-20
>
>
> Gauss2F1(80.2,50.1,61.3,-3)
[1] NaN
> Gauss2F1b(80.2,50.1,61.3,-3)
[1] 5.343807e-38
>
>
> Gauss2F1(80.2,50.1,61.3,-0.4)
[1] NaN
> Gauss2F1b(80.2,50.1,61.3,-0.4)
[1] 3.322785e-10

all three agreeing with Mathematica's Hypergeometric2F1. This formula seems well behaved also for smaller a, b, c. Note that there are cases in which this formula gives NaN and Stéphane's doesn't, though. Best to check case by case.
