#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 r15857 = x;
        float r15858 = y;
        float r15859 = z;
        float r15860 = log(r15859);
        float r15861 = r15858 * r15860;
        float r15862 = t;
        float r15863 = 1.0f;
        float r15864 = r15862 - r15863;
        float r15865 = a;
        float r15866 = log(r15865);
        float r15867 = r15864 * r15866;
        float r15868 = r15861 + r15867;
        float r15869 = b;
        float r15870 = r15868 - r15869;
        float r15871 = exp(r15870);
        float r15872 = r15857 * r15871;
        float r15873 = r15872 / r15858;
        return r15873;
}

double f_id(double x, double y, double z, double t, double a, double b) {
        double r15874 = x;
        double r15875 = y;
        double r15876 = z;
        double r15877 = log(r15876);
        double r15878 = r15875 * r15877;
        double r15879 = t;
        double r15880 = 1.0;
        double r15881 = r15879 - r15880;
        double r15882 = a;
        double r15883 = log(r15882);
        double r15884 = r15881 * r15883;
        double r15885 = r15878 + r15884;
        double r15886 = b;
        double r15887 = r15885 - r15886;
        double r15888 = exp(r15887);
        double r15889 = r15874 * r15888;
        double r15890 = r15889 / r15875;
        return r15890;
}


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

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 r15893 = 0.0;
        double r15894 = r15893 * r15893;
        return r15894;
}

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 r15895, r15896, r15897, r15898, r15899, r15900, r15901, r15902, r15903, r15904, r15905, r15906, r15907, r15908, r15909, r15910, r15911;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15895);
        mpfr_init(r15896);
        mpfr_init(r15897);
        mpfr_init(r15898);
        mpfr_init(r15899);
        mpfr_init(r15900);
        mpfr_init_set_str(r15901, "1.0", 10, MPFR_RNDN);
        mpfr_init(r15902);
        mpfr_init(r15903);
        mpfr_init(r15904);
        mpfr_init(r15905);
        mpfr_init(r15906);
        mpfr_init(r15907);
        mpfr_init(r15908);
        mpfr_init(r15909);
        mpfr_init(r15910);
        mpfr_init(r15911);
}

double f_im(double x, double y, double z, double t, double a, double b) {
        mpfr_set_d(r15895, x, MPFR_RNDN);
        mpfr_set_d(r15896, y, MPFR_RNDN);
        mpfr_set_d(r15897, z, MPFR_RNDN);
        mpfr_log(r15898, r15897, MPFR_RNDN);
        mpfr_mul(r15899, r15896, r15898, MPFR_RNDN);
        mpfr_set_d(r15900, t, MPFR_RNDN);
        ;
        mpfr_sub(r15902, r15900, r15901, MPFR_RNDN);
        mpfr_set_d(r15903, a, MPFR_RNDN);
        mpfr_log(r15904, r15903, MPFR_RNDN);
        mpfr_mul(r15905, r15902, r15904, MPFR_RNDN);
        mpfr_add(r15906, r15899, r15905, MPFR_RNDN);
        mpfr_set_d(r15907, b, MPFR_RNDN);
        mpfr_sub(r15908, r15906, r15907, MPFR_RNDN);
        mpfr_exp(r15909, r15908, MPFR_RNDN);
        mpfr_mul(r15910, r15895, r15909, MPFR_RNDN);
        mpfr_div(r15911, r15910, r15896, MPFR_RNDN);
        return mpfr_get_d(r15911, MPFR_RNDN);
}

static mpfr_t r15912, r15913;

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

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

static mpfr_t r15914, r15915;

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

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

