#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 r15012 = d;
        float r15013 = expm1(r15012);
        float r15014 = c;
        float r15015 = r15013 * r15014;
        float r15016 = 8.61318337292339e-131f;
        float r15017 = atan2(r15016, r15012);
        float r15018 = fmod(r15015, r15017);
        return r15018;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15019 = d;
        double r15020 = expm1(r15019);
        double r15021 = c;
        double r15022 = r15020 * r15021;
        double r15023 = 8.61318337292339e-131;
        double r15024 = atan2(r15023, r15019);
        double r15025 = fmod(r15022, r15024);
        return r15025;
}


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

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

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 r15044, r15045, r15046, r15047, r15048, r15049, r15050;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15044);
        mpfr_init(r15045);
        mpfr_init(r15046);
        mpfr_init(r15047);
        mpfr_init_set_str(r15048, "8.61318337292339e-131", 10, MPFR_RNDN);
        mpfr_init(r15049);
        mpfr_init(r15050);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15044, d, MPFR_RNDN);
        mpfr_expm1(r15045, r15044, MPFR_RNDN);
        mpfr_set_d(r15046, c, MPFR_RNDN);
        mpfr_mul(r15047, r15045, r15046, MPFR_RNDN);
        ;
        mpfr_atan2(r15049, r15048, r15044, MPFR_RNDN);
        mpfr_fmod(r15050, r15047, r15049, MPFR_RNDN);
        return mpfr_get_d(r15050, MPFR_RNDN);
}

static mpfr_t r15051, r15052, r15053, r15054, r15055, r15056, r15057, r15058, r15059;

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

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

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

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

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

