#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 r16099 = x;
        float r16100 = y;
        float r16101 = z;
        float r16102 = log(r16101);
        float r16103 = r16100 * r16102;
        float r16104 = t;
        float r16105 = 1.0f;
        float r16106 = r16104 - r16105;
        float r16107 = a;
        float r16108 = log(r16107);
        float r16109 = r16106 * r16108;
        float r16110 = r16103 + r16109;
        float r16111 = b;
        float r16112 = r16110 - r16111;
        float r16113 = exp(r16112);
        float r16114 = r16099 * r16113;
        float r16115 = r16114 / r16100;
        return r16115;
}

double f_id(double x, double y, double z, double t, double a, double b) {
        double r16116 = x;
        double r16117 = y;
        double r16118 = z;
        double r16119 = log(r16118);
        double r16120 = r16117 * r16119;
        double r16121 = t;
        double r16122 = 1.0;
        double r16123 = r16121 - r16122;
        double r16124 = a;
        double r16125 = log(r16124);
        double r16126 = r16123 * r16125;
        double r16127 = r16120 + r16126;
        double r16128 = b;
        double r16129 = r16127 - r16128;
        double r16130 = exp(r16129);
        double r16131 = r16116 * r16130;
        double r16132 = r16131 / r16117;
        return r16132;
}


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 r16133 = 0.0f;
        float r16134 = r16133 * r16133;
        return r16134;
}

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 r16135 = 0.0;
        double r16136 = r16135 * r16135;
        return r16136;
}

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 r16137, r16138, r16139, r16140, r16141, r16142, r16143, r16144, r16145, r16146, r16147, r16148, r16149, r16150, r16151, r16152, r16153;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r16137);
        mpfr_init(r16138);
        mpfr_init(r16139);
        mpfr_init(r16140);
        mpfr_init(r16141);
        mpfr_init(r16142);
        mpfr_init_set_str(r16143, "1.0", 10, MPFR_RNDN);
        mpfr_init(r16144);
        mpfr_init(r16145);
        mpfr_init(r16146);
        mpfr_init(r16147);
        mpfr_init(r16148);
        mpfr_init(r16149);
        mpfr_init(r16150);
        mpfr_init(r16151);
        mpfr_init(r16152);
        mpfr_init(r16153);
}

double f_im(double x, double y, double z, double t, double a, double b) {
        mpfr_set_d(r16137, x, MPFR_RNDN);
        mpfr_set_d(r16138, y, MPFR_RNDN);
        mpfr_set_d(r16139, z, MPFR_RNDN);
        mpfr_log(r16140, r16139, MPFR_RNDN);
        mpfr_mul(r16141, r16138, r16140, MPFR_RNDN);
        mpfr_set_d(r16142, t, MPFR_RNDN);
        ;
        mpfr_sub(r16144, r16142, r16143, MPFR_RNDN);
        mpfr_set_d(r16145, a, MPFR_RNDN);
        mpfr_log(r16146, r16145, MPFR_RNDN);
        mpfr_mul(r16147, r16144, r16146, MPFR_RNDN);
        mpfr_add(r16148, r16141, r16147, MPFR_RNDN);
        mpfr_set_d(r16149, b, MPFR_RNDN);
        mpfr_sub(r16150, r16148, r16149, MPFR_RNDN);
        mpfr_exp(r16151, r16150, MPFR_RNDN);
        mpfr_mul(r16152, r16137, r16151, MPFR_RNDN);
        mpfr_div(r16153, r16152, r16138, MPFR_RNDN);
        return mpfr_get_d(r16153, MPFR_RNDN);
}

static mpfr_t r16154, r16155;

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

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(r16155, r16154, MPFR_RNDN);
        return mpfr_get_d(r16155, MPFR_RNDN);
}

static mpfr_t r16156, r16157;

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

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(r16157, r16156, MPFR_RNDN);
        return mpfr_get_d(r16157, MPFR_RNDN);
}

