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

char *name = "(fmod (* (expm1 d) c) (atan2 8.61318337292339e-131 d))";

double f_if(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15000 = d;
        float r15001 = expm1(r15000);
        float r15002 = c;
        float r15003 = r15001 * r15002;
        float r15004 = 8.61318337292339e-131f;
        float r15005 = atan2(r15004, r15000);
        float r15006 = fmod(r15003, r15005);
        return r15006;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15007 = d;
        double r15008 = expm1(r15007);
        double r15009 = c;
        double r15010 = r15008 * r15009;
        double r15011 = 8.61318337292339e-131;
        double r15012 = atan2(r15011, r15007);
        double r15013 = fmod(r15010, r15012);
        return r15013;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15014 = d;
        float r15015 = expm1(r15014);
        float r15016 = c;
        float r15017 = r15015 * r15016;
        float r15018 = sqrt(r15017);
        float r15019 = r15018 * r15018;
        float r15020 = 8.61318337292339e-131f;
        float r15021 = atan2(r15020, r15014);
        float r15022 = fmod(r15019, r15021);
        return r15022;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15023 = d;
        double r15024 = expm1(r15023);
        double r15025 = c;
        double r15026 = r15024 * r15025;
        double r15027 = sqrt(r15026);
        double r15028 = r15027 * r15027;
        double r15029 = 8.61318337292339e-131;
        double r15030 = atan2(r15029, r15023);
        double r15031 = fmod(r15028, r15030);
        return r15031;
}

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 r15032, r15033, r15034, r15035, r15036, r15037, r15038;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15032);
        mpfr_init(r15033);
        mpfr_init(r15034);
        mpfr_init(r15035);
        mpfr_init_set_str(r15036, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15037);
        mpfr_init(r15038);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15032, d, MPFR_RNDN);
        mpfr_expm1(r15033, r15032, MPFR_RNDN);
        mpfr_set_d(r15034, c, MPFR_RNDN);
        mpfr_mul(r15035, r15033, r15034, MPFR_RNDN);
        ;
        mpfr_atan2(r15037, r15036, r15032, MPFR_RNDN);
        mpfr_fmod(r15038, r15035, r15037, MPFR_RNDN);
        return mpfr_get_d(r15038, MPFR_RNDN);
}

static mpfr_t r15039, r15040, r15041, r15042, r15043, r15044, r15045, r15046, r15047;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15039);
        mpfr_init(r15040);
        mpfr_init(r15041);
        mpfr_init(r15042);
        mpfr_init(r15043);
        mpfr_init(r15044);
        mpfr_init_set_str(r15045, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15046);
        mpfr_init(r15047);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15039, d, MPFR_RNDN);
        mpfr_expm1(r15040, r15039, MPFR_RNDN);
        mpfr_set_d(r15041, c, MPFR_RNDN);
        mpfr_mul(r15042, r15040, r15041, MPFR_RNDN);
        mpfr_sqrt(r15043, r15042, MPFR_RNDN);
        mpfr_sqr(r15044, r15043, MPFR_RNDN);
        ;
        mpfr_atan2(r15046, r15045, r15039, MPFR_RNDN);
        mpfr_fmod(r15047, r15044, r15046, MPFR_RNDN);
        return mpfr_get_d(r15047, MPFR_RNDN);
}

static mpfr_t r15048, r15049, r15050, r15051, r15052, r15053, r15054, r15055, r15056;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15048);
        mpfr_init(r15049);
        mpfr_init(r15050);
        mpfr_init(r15051);
        mpfr_init(r15052);
        mpfr_init(r15053);
        mpfr_init_set_str(r15054, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15055);
        mpfr_init(r15056);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15048, d, MPFR_RNDN);
        mpfr_expm1(r15049, r15048, MPFR_RNDN);
        mpfr_set_d(r15050, c, MPFR_RNDN);
        mpfr_mul(r15051, r15049, r15050, MPFR_RNDN);
        mpfr_sqrt(r15052, r15051, MPFR_RNDN);
        mpfr_sqr(r15053, r15052, MPFR_RNDN);
        ;
        mpfr_atan2(r15055, r15054, r15048, MPFR_RNDN);
        mpfr_fmod(r15056, r15053, r15055, MPFR_RNDN);
        return mpfr_get_d(r15056, MPFR_RNDN);
}

