#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2";

double f_if(float x, float y, float z, float t, float a, float b) {
        float r16194 = x;
        float r16195 = y;
        float r16196 = z;
        float r16197 = log(r16196);
        float r16198 = r16195 * r16197;
        float r16199 = t;
        float r16200 = 1.0f;
        float r16201 = r16199 - r16200;
        float r16202 = a;
        float r16203 = log(r16202);
        float r16204 = r16201 * r16203;
        float r16205 = r16198 + r16204;
        float r16206 = b;
        float r16207 = r16205 - r16206;
        float r16208 = exp(r16207);
        float r16209 = r16194 * r16208;
        float r16210 = r16209 / r16195;
        return r16210;
}

double f_id(double x, double y, double z, double t, double a, double b) {
        double r16211 = x;
        double r16212 = y;
        double r16213 = z;
        double r16214 = log(r16213);
        double r16215 = r16212 * r16214;
        double r16216 = t;
        double r16217 = 1.0;
        double r16218 = r16216 - r16217;
        double r16219 = a;
        double r16220 = log(r16219);
        double r16221 = r16218 * r16220;
        double r16222 = r16215 + r16221;
        double r16223 = b;
        double r16224 = r16222 - r16223;
        double r16225 = exp(r16224);
        double r16226 = r16211 * r16225;
        double r16227 = r16226 / r16212;
        return r16227;
}


double f_of(float __attribute__((unused)) x, float __attribute__((unused)) y, float __attribute__((unused)) z, float __attribute__((unused)) t, float __attribute__((unused)) a, float __attribute__((unused)) b) {
        float r16228 = 0.0f;
        float r16229 = r16228 * r16228;
        return r16229;
}

double f_od(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z, double __attribute__((unused)) t, double __attribute__((unused)) a, double __attribute__((unused)) b) {
        double r16230 = 0.0;
        double r16231 = r16230 * r16230;
        return r16231;
}

void mpfr_fmod2(mpfr_t r, mpfr_t n, mpfr_t d, mpfr_rnd_t rmd) {
        mpfr_fmod(r, n, d, rmd);
        if (mpfr_cmp_ui(r, 0) < 0) mpfr_add(r, r, d, rmd);
}


static mpfr_t r16232, r16233, r16234, r16235, r16236, r16237, r16238, r16239, r16240, r16241, r16242, r16243, r16244, r16245, r16246, r16247, r16248;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r16232);
        mpfr_init(r16233);
        mpfr_init(r16234);
        mpfr_init(r16235);
        mpfr_init(r16236);
        mpfr_init(r16237);
        mpfr_init_set_str(r16238, "1.0", 10, MPFR_RNDN);
        mpfr_init(r16239);
        mpfr_init(r16240);
        mpfr_init(r16241);
        mpfr_init(r16242);
        mpfr_init(r16243);
        mpfr_init(r16244);
        mpfr_init(r16245);
        mpfr_init(r16246);
        mpfr_init(r16247);
        mpfr_init(r16248);
}

double f_im(double x, double y, double z, double t, double a, double b) {
        mpfr_set_d(r16232, x, MPFR_RNDN);
        mpfr_set_d(r16233, y, MPFR_RNDN);
        mpfr_set_d(r16234, z, MPFR_RNDN);
        mpfr_log(r16235, r16234, MPFR_RNDN);
        mpfr_mul(r16236, r16233, r16235, MPFR_RNDN);
        mpfr_set_d(r16237, t, MPFR_RNDN);
        ;
        mpfr_sub(r16239, r16237, r16238, MPFR_RNDN);
        mpfr_set_d(r16240, a, MPFR_RNDN);
        mpfr_log(r16241, r16240, MPFR_RNDN);
        mpfr_mul(r16242, r16239, r16241, MPFR_RNDN);
        mpfr_add(r16243, r16236, r16242, MPFR_RNDN);
        mpfr_set_d(r16244, b, MPFR_RNDN);
        mpfr_sub(r16245, r16243, r16244, MPFR_RNDN);
        mpfr_exp(r16246, r16245, MPFR_RNDN);
        mpfr_mul(r16247, r16232, r16246, MPFR_RNDN);
        mpfr_div(r16248, r16247, r16233, MPFR_RNDN);
        return mpfr_get_d(r16248, MPFR_RNDN);
}

static mpfr_t r16249, r16250;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init_set_str(r16249, "0", 10, MPFR_RNDN);
        mpfr_init(r16250);
}

double f_fm(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z, double __attribute__((unused)) t, double __attribute__((unused)) a, double __attribute__((unused)) b) {
        ;
        mpfr_sqr(r16250, r16249, MPFR_RNDN);
        return mpfr_get_d(r16250, MPFR_RNDN);
}

static mpfr_t r16251, r16252;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init_set_str(r16251, "0", 10, MPFR_RNDN);
        mpfr_init(r16252);
}

double f_dm(double __attribute__((unused)) x, double __attribute__((unused)) y, double __attribute__((unused)) z, double __attribute__((unused)) t, double __attribute__((unused)) a, double __attribute__((unused)) b) {
        ;
        mpfr_sqr(r16252, r16251, MPFR_RNDN);
        return mpfr_get_d(r16252, MPFR_RNDN);
}

