#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 r14988 = d;
        float r14989 = expm1(r14988);
        float r14990 = c;
        float r14991 = r14989 * r14990;
        float r14992 = 8.61318337292339e-131f;
        float r14993 = atan2(r14992, r14988);
        float r14994 = fmod(r14991, r14993);
        return r14994;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r14995 = d;
        double r14996 = expm1(r14995);
        double r14997 = c;
        double r14998 = r14996 * r14997;
        double r14999 = 8.61318337292339e-131;
        double r15000 = atan2(r14999, r14995);
        double r15001 = fmod(r14998, r15000);
        return r15001;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15002 = d;
        float r15003 = expm1(r15002);
        float r15004 = c;
        float r15005 = r15003 * r15004;
        float r15006 = sqrt(r15005);
        float r15007 = r15006 * r15006;
        float r15008 = 8.61318337292339e-131f;
        float r15009 = atan2(r15008, r15002);
        float r15010 = fmod(r15007, r15009);
        return r15010;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15011 = d;
        double r15012 = expm1(r15011);
        double r15013 = c;
        double r15014 = r15012 * r15013;
        double r15015 = sqrt(r15014);
        double r15016 = r15015 * r15015;
        double r15017 = 8.61318337292339e-131;
        double r15018 = atan2(r15017, r15011);
        double r15019 = fmod(r15016, r15018);
        return r15019;
}

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 r15020, r15021, r15022, r15023, r15024, r15025, r15026;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15020);
        mpfr_init(r15021);
        mpfr_init(r15022);
        mpfr_init(r15023);
        mpfr_init_set_str(r15024, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15025);
        mpfr_init(r15026);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15020, d, MPFR_RNDN);
        mpfr_expm1(r15021, r15020, MPFR_RNDN);
        mpfr_set_d(r15022, c, MPFR_RNDN);
        mpfr_mul(r15023, r15021, r15022, MPFR_RNDN);
        ;
        mpfr_atan2(r15025, r15024, r15020, MPFR_RNDN);
        mpfr_fmod(r15026, r15023, r15025, MPFR_RNDN);
        return mpfr_get_d(r15026, MPFR_RNDN);
}

static mpfr_t r15027, r15028, r15029, r15030, r15031, r15032, r15033, r15034, r15035;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15027);
        mpfr_init(r15028);
        mpfr_init(r15029);
        mpfr_init(r15030);
        mpfr_init(r15031);
        mpfr_init(r15032);
        mpfr_init_set_str(r15033, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15034);
        mpfr_init(r15035);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15027, d, MPFR_RNDN);
        mpfr_expm1(r15028, r15027, MPFR_RNDN);
        mpfr_set_d(r15029, c, MPFR_RNDN);
        mpfr_mul(r15030, r15028, r15029, MPFR_RNDN);
        mpfr_sqrt(r15031, r15030, MPFR_RNDN);
        mpfr_sqr(r15032, r15031, MPFR_RNDN);
        ;
        mpfr_atan2(r15034, r15033, r15027, MPFR_RNDN);
        mpfr_fmod(r15035, r15032, r15034, MPFR_RNDN);
        return mpfr_get_d(r15035, MPFR_RNDN);
}

static mpfr_t r15036, r15037, r15038, r15039, r15040, r15041, r15042, r15043, r15044;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15036);
        mpfr_init(r15037);
        mpfr_init(r15038);
        mpfr_init(r15039);
        mpfr_init(r15040);
        mpfr_init(r15041);
        mpfr_init_set_str(r15042, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15043);
        mpfr_init(r15044);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15036, d, MPFR_RNDN);
        mpfr_expm1(r15037, r15036, MPFR_RNDN);
        mpfr_set_d(r15038, c, MPFR_RNDN);
        mpfr_mul(r15039, r15037, r15038, MPFR_RNDN);
        mpfr_sqrt(r15040, r15039, MPFR_RNDN);
        mpfr_sqr(r15041, r15040, MPFR_RNDN);
        ;
        mpfr_atan2(r15043, r15042, r15036, MPFR_RNDN);
        mpfr_fmod(r15044, r15041, r15043, MPFR_RNDN);
        return mpfr_get_d(r15044, MPFR_RNDN);
}

