#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(- (atan2 (atan2 a c) a) (log a))";

double f_if(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15363 = a;
        float r15364 = c;
        float r15365 = atan2(r15363, r15364);
        float r15366 = atan2(r15365, r15363);
        float r15367 = log(r15363);
        float r15368 = r15366 - r15367;
        return r15368;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15369 = a;
        double r15370 = c;
        double r15371 = atan2(r15369, r15370);
        double r15372 = atan2(r15371, r15369);
        double r15373 = log(r15369);
        double r15374 = r15372 - r15373;
        return r15374;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15375 = a;
        float r15376 = c;
        float r15377 = atan2(r15375, r15376);
        float r15378 = atan2(r15377, r15375);
        float r15379 = exp(r15378);
        float r15380 = r15379 / r15375;
        float r15381 = log(r15380);
        return r15381;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15382 = a;
        double r15383 = c;
        double r15384 = atan2(r15382, r15383);
        double r15385 = atan2(r15384, r15382);
        double r15386 = exp(r15385);
        double r15387 = r15386 / r15382;
        double r15388 = log(r15387);
        return r15388;
}

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 r15389, r15390, r15391, r15392, r15393, r15394;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
        mpfr_init(r15394);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15389, a, MPFR_RNDN);
        mpfr_set_d(r15390, c, MPFR_RNDN);
        mpfr_atan2(r15391, r15389, r15390, MPFR_RNDN);
        mpfr_atan2(r15392, r15391, r15389, MPFR_RNDN);
        mpfr_log(r15393, r15389, MPFR_RNDN);
        mpfr_sub(r15394, r15392, r15393, MPFR_RNDN);
        return mpfr_get_d(r15394, MPFR_RNDN);
}

static mpfr_t r15395, r15396, r15397, r15398, r15399, r15400, r15401;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15395, a, MPFR_RNDN);
        mpfr_set_d(r15396, c, MPFR_RNDN);
        mpfr_atan2(r15397, r15395, r15396, MPFR_RNDN);
        mpfr_atan2(r15398, r15397, r15395, MPFR_RNDN);
        mpfr_exp(r15399, r15398, MPFR_RNDN);
        mpfr_div(r15400, r15399, r15395, MPFR_RNDN);
        mpfr_log(r15401, r15400, MPFR_RNDN);
        return mpfr_get_d(r15401, MPFR_RNDN);
}

static mpfr_t r15402, r15403, r15404, r15405, r15406, r15407, r15408;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15402);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15402, a, MPFR_RNDN);
        mpfr_set_d(r15403, c, MPFR_RNDN);
        mpfr_atan2(r15404, r15402, r15403, MPFR_RNDN);
        mpfr_atan2(r15405, r15404, r15402, MPFR_RNDN);
        mpfr_exp(r15406, r15405, MPFR_RNDN);
        mpfr_div(r15407, r15406, r15402, MPFR_RNDN);
        mpfr_log(r15408, r15407, MPFR_RNDN);
        return mpfr_get_d(r15408, MPFR_RNDN);
}

