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

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15373 = a;
        double r15374 = c;
        double r15375 = atan2(r15373, r15374);
        double r15376 = atan2(r15375, r15373);
        double r15377 = log(r15373);
        double r15378 = r15376 - r15377;
        return r15378;
}


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

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

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 r15393, r15394, r15395, r15396, r15397, r15398;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15393);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
}

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

static mpfr_t r15399, r15400, r15401, r15402, r15403, r15404, r15405;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
        mpfr_init(r15402);
        mpfr_init(r15403);
        mpfr_init(r15404);
        mpfr_init(r15405);
}

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

static mpfr_t r15406, r15407, r15408, r15409, r15410, r15411, r15412;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
}

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

