#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 r14996 = d;
        float r14997 = expm1(r14996);
        float r14998 = c;
        float r14999 = r14997 * r14998;
        float r15000 = 8.61318337292339e-131f;
        float r15001 = atan2(r15000, r14996);
        float r15002 = fmod(r14999, r15001);
        return r15002;
}

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


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

double f_od(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 = sqrt(r15022);
        double r15024 = r15023 * r15023;
        double r15025 = 8.61318337292339e-131;
        double r15026 = atan2(r15025, r15019);
        double r15027 = fmod(r15024, r15026);
        return r15027;
}

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 r15028, r15029, r15030, r15031, r15032, r15033, r15034;

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

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

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

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

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

static mpfr_t r15044, r15045, r15046, r15047, r15048, r15049, r15050, r15051, r15052;

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

double f_dm(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_sqrt(r15048, r15047, MPFR_RNDN);
        mpfr_sqr(r15049, r15048, MPFR_RNDN);
        ;
        mpfr_atan2(r15051, r15050, r15044, MPFR_RNDN);
        mpfr_fmod(r15052, r15049, r15051, MPFR_RNDN);
        return mpfr_get_d(r15052, MPFR_RNDN);
}

