#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 r15020 = d;
        float r15021 = expm1(r15020);
        float r15022 = c;
        float r15023 = r15021 * r15022;
        float r15024 = 8.61318337292339e-131f;
        float r15025 = atan2(r15024, r15020);
        float r15026 = fmod(r15023, r15025);
        return r15026;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15027 = d;
        double r15028 = expm1(r15027);
        double r15029 = c;
        double r15030 = r15028 * r15029;
        double r15031 = 8.61318337292339e-131;
        double r15032 = atan2(r15031, r15027);
        double r15033 = fmod(r15030, r15032);
        return r15033;
}


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

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15043 = d;
        double r15044 = expm1(r15043);
        double r15045 = c;
        double r15046 = r15044 * r15045;
        double r15047 = sqrt(r15046);
        double r15048 = r15047 * r15047;
        double r15049 = 8.61318337292339e-131;
        double r15050 = atan2(r15049, r15043);
        double r15051 = fmod(r15048, r15050);
        return r15051;
}

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 r15052, r15053, r15054, r15055, r15056, r15057, r15058;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15052);
        mpfr_init(r15053);
        mpfr_init(r15054);
        mpfr_init(r15055);
        mpfr_init_set_str(r15056, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15057);
        mpfr_init(r15058);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15052, d, MPFR_RNDN);
        mpfr_expm1(r15053, r15052, MPFR_RNDN);
        mpfr_set_d(r15054, c, MPFR_RNDN);
        mpfr_mul(r15055, r15053, r15054, MPFR_RNDN);
        ;
        mpfr_atan2(r15057, r15056, r15052, MPFR_RNDN);
        mpfr_fmod(r15058, r15055, r15057, MPFR_RNDN);
        return mpfr_get_d(r15058, MPFR_RNDN);
}

static mpfr_t r15059, r15060, r15061, r15062, r15063, r15064, r15065, r15066, r15067;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15059);
        mpfr_init(r15060);
        mpfr_init(r15061);
        mpfr_init(r15062);
        mpfr_init(r15063);
        mpfr_init(r15064);
        mpfr_init_set_str(r15065, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15066);
        mpfr_init(r15067);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15059, d, MPFR_RNDN);
        mpfr_expm1(r15060, r15059, MPFR_RNDN);
        mpfr_set_d(r15061, c, MPFR_RNDN);
        mpfr_mul(r15062, r15060, r15061, MPFR_RNDN);
        mpfr_sqrt(r15063, r15062, MPFR_RNDN);
        mpfr_sqr(r15064, r15063, MPFR_RNDN);
        ;
        mpfr_atan2(r15066, r15065, r15059, MPFR_RNDN);
        mpfr_fmod(r15067, r15064, r15066, MPFR_RNDN);
        return mpfr_get_d(r15067, MPFR_RNDN);
}

static mpfr_t r15068, r15069, r15070, r15071, r15072, r15073, r15074, r15075, r15076;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15068);
        mpfr_init(r15069);
        mpfr_init(r15070);
        mpfr_init(r15071);
        mpfr_init(r15072);
        mpfr_init(r15073);
        mpfr_init_set_str(r15074, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15075);
        mpfr_init(r15076);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15068, d, MPFR_RNDN);
        mpfr_expm1(r15069, r15068, MPFR_RNDN);
        mpfr_set_d(r15070, c, MPFR_RNDN);
        mpfr_mul(r15071, r15069, r15070, MPFR_RNDN);
        mpfr_sqrt(r15072, r15071, MPFR_RNDN);
        mpfr_sqr(r15073, r15072, MPFR_RNDN);
        ;
        mpfr_atan2(r15075, r15074, r15068, MPFR_RNDN);
        mpfr_fmod(r15076, r15073, r15075, MPFR_RNDN);
        return mpfr_get_d(r15076, MPFR_RNDN);
}

