#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 r15024 = d;
        float r15025 = expm1(r15024);
        float r15026 = c;
        float r15027 = r15025 * r15026;
        float r15028 = 8.61318337292339e-131f;
        float r15029 = atan2(r15028, r15024);
        float r15030 = fmod(r15027, r15029);
        return r15030;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15031 = d;
        double r15032 = expm1(r15031);
        double r15033 = c;
        double r15034 = r15032 * r15033;
        double r15035 = 8.61318337292339e-131;
        double r15036 = atan2(r15035, r15031);
        double r15037 = fmod(r15034, r15036);
        return r15037;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15038 = d;
        float r15039 = expm1(r15038);
        float r15040 = c;
        float r15041 = r15039 * r15040;
        float r15042 = sqrt(r15041);
        float r15043 = r15042 * r15042;
        float r15044 = 8.61318337292339e-131f;
        float r15045 = atan2(r15044, r15038);
        float r15046 = fmod(r15043, r15045);
        return r15046;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15047 = d;
        double r15048 = expm1(r15047);
        double r15049 = c;
        double r15050 = r15048 * r15049;
        double r15051 = sqrt(r15050);
        double r15052 = r15051 * r15051;
        double r15053 = 8.61318337292339e-131;
        double r15054 = atan2(r15053, r15047);
        double r15055 = fmod(r15052, r15054);
        return r15055;
}

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 r15056, r15057, r15058, r15059, r15060, r15061, r15062;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15056);
        mpfr_init(r15057);
        mpfr_init(r15058);
        mpfr_init(r15059);
        mpfr_init_set_str(r15060, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15061);
        mpfr_init(r15062);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15056, d, MPFR_RNDN);
        mpfr_expm1(r15057, r15056, MPFR_RNDN);
        mpfr_set_d(r15058, c, MPFR_RNDN);
        mpfr_mul(r15059, r15057, r15058, MPFR_RNDN);
        ;
        mpfr_atan2(r15061, r15060, r15056, MPFR_RNDN);
        mpfr_fmod(r15062, r15059, r15061, MPFR_RNDN);
        return mpfr_get_d(r15062, MPFR_RNDN);
}

static mpfr_t r15063, r15064, r15065, r15066, r15067, r15068, r15069, r15070, r15071;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15063);
        mpfr_init(r15064);
        mpfr_init(r15065);
        mpfr_init(r15066);
        mpfr_init(r15067);
        mpfr_init(r15068);
        mpfr_init_set_str(r15069, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15070);
        mpfr_init(r15071);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15063, d, MPFR_RNDN);
        mpfr_expm1(r15064, r15063, MPFR_RNDN);
        mpfr_set_d(r15065, c, MPFR_RNDN);
        mpfr_mul(r15066, r15064, r15065, MPFR_RNDN);
        mpfr_sqrt(r15067, r15066, MPFR_RNDN);
        mpfr_sqr(r15068, r15067, MPFR_RNDN);
        ;
        mpfr_atan2(r15070, r15069, r15063, MPFR_RNDN);
        mpfr_fmod(r15071, r15068, r15070, MPFR_RNDN);
        return mpfr_get_d(r15071, MPFR_RNDN);
}

static mpfr_t r15072, r15073, r15074, r15075, r15076, r15077, r15078, r15079, r15080;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15072);
        mpfr_init(r15073);
        mpfr_init(r15074);
        mpfr_init(r15075);
        mpfr_init(r15076);
        mpfr_init(r15077);
        mpfr_init_set_str(r15078, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15079);
        mpfr_init(r15080);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15072, d, MPFR_RNDN);
        mpfr_expm1(r15073, r15072, MPFR_RNDN);
        mpfr_set_d(r15074, c, MPFR_RNDN);
        mpfr_mul(r15075, r15073, r15074, MPFR_RNDN);
        mpfr_sqrt(r15076, r15075, MPFR_RNDN);
        mpfr_sqr(r15077, r15076, MPFR_RNDN);
        ;
        mpfr_atan2(r15079, r15078, r15072, MPFR_RNDN);
        mpfr_fmod(r15080, r15077, r15079, MPFR_RNDN);
        return mpfr_get_d(r15080, MPFR_RNDN);
}

