Go to the documentation of this file.
76 #define ETHRESH 1.0e-12
78 #define MAX_ITERATIONS 10000
83 static double hyp2f1ra(
double a,
double b,
double c,
double x,
double *loss);
87 static double hys2f1(
double a,
double b,
double c,
double x,
double *loss) {
88 double f,
g,
h, k,
m,
s, u, umax;
131 u = u * ((
f + k) * (
g + k) *
x / ((
h + k) *
m));
134 if (k > umax) umax = k;
149 static double hyt2f1(
double a,
double b,
double c,
double x,
double *loss) {
150 double p,
q, r,
s,
t,
y,
w,
d, err, err1;
154 int ia, ib, neg_int_a = 0, neg_int_b = 0;
169 if (
x < -0.5 && !(neg_int_a || neg_int_b)) {
182 if (
x > 0.9 && !(neg_int_a || neg_int_b)) {
214 err += err1 + (
MACHEP * r) /
y;
248 psi(
b +
t + d1) - ax;
251 p *=
s * (
a +
t + d1) / (
t + 1.0);
252 p *= (
b +
t + d1) / (
t + 1.0 +
e);
268 if (aid == 1)
goto nosum;
272 for (
i = 1;
i < aid;
i++) {
284 if ((aid & 1) != 0)
y = -
y;
311 double collector = 1;
313 double collector_max = 1;
315 if (!(
fabs(
b) < 1e5)) {
319 for (k = 1; k <= -
b; k++) {
320 collector *= (
a + k - 1) *
x / k;
321 collector_max =
fmax(
fabs(collector), collector_max);
325 if (1
e-16 * (1 + collector_max /
fabs(sum)) > 1
e-7) {
334 double p,
q, r,
s,
y, ax;
335 double ia, ib, ic,
id, err;
338 int neg_int_a = 0, neg_int_b = 0;
339 int neg_int_ca_or_cb = 0;
354 if ((
a == 0 ||
b == 0) &&
c != 0) {
366 if (
d <= -1 && !(
fabs(
d -
id) >
EPS &&
s < 0) && !(neg_int_a || neg_int_b)) {
369 if (
d <= 0 &&
x == 1 && !(neg_int_a || neg_int_b))
goto hypdiv;
371 if (ax < 1.0 ||
x == -1.0) {
391 if (neg_int_a && (ia > ic))
goto hypok;
392 if (neg_int_b && (ib > ic))
goto hypok;
397 if (neg_int_a || neg_int_b)
412 return s *
p +
y *
q;
413 }
else if (
x < -1.0) {
426 if ((ia <= 0.0) && (
fabs(
p - ia) <
EPS))
427 neg_int_ca_or_cb = 1;
431 if ((ib <= 0.0) && (
fabs(r - ib) <
EPS))
432 neg_int_ca_or_cb = 1;
441 if (neg_int_ca_or_cb) {
447 if (
d <= 0.0)
goto hypdiv;
451 if (
d <= -1.0)
goto hypdiv;
460 if (err <
ETHRESH)
goto hypdon;
468 for (
i = 0;
i < aid;
i++) {
470 y = (
e * (r - (2.0 *
e -
q) *
x) *
d2 + (
e -
a) * (
e -
b) *
x * d1) /
479 if (neg_int_ca_or_cb)
goto hypf;
513 static double hyp2f1ra(
double a,
double b,
double c,
double x,
double *loss) {
519 if ((
c < 0 &&
a <=
c) || (
c >= 0 &&
a >=
c)) {
545 for (
n = 1;
n < -da; ++
n) {
549 t * (
x - 1) / (
c -
t) *
f2;
560 for (
n = 1;
n < da; ++
n) {
static double hyp2f1_neg_c_equal_bc(double a, double b, double x)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
static double hyp2f1ra(double a, double b, double c, double x, double *loss)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
const EIGEN_DEVICE_FUNC SignReturnType sign() const
double f2(const Vector2 &x)
const EIGEN_DEVICE_FUNC LogReturnType log() const
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
double lgam_sgn(double x, int *sign)
static const Similarity3 id
EIGEN_DEVICE_FUNC const Scalar & q
static double hys2f1(double a, double b, double c, double x, double *loss)
double hyp2f1(double a, double b, double c, double x)
static double hyt2f1(double a, double b, double c, double x, double *loss)
void g(const string &key, int i)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmax(const bfloat16 &a, const bfloat16 &b)
void sf_error(const char *func_name, sf_error_t code, const char *fmt,...)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:26