#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 r15364 = a;
        float r15365 = c;
        float r15366 = atan2(r15364, r15365);
        float r15367 = atan2(r15366, r15364);
        float r15368 = log(r15364);
        float r15369 = r15367 - r15368;
        return r15369;
}

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


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

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

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

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

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

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

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

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

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

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

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

