#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 r15372 = a;
        float r15373 = c;
        float r15374 = atan2(r15372, r15373);
        float r15375 = atan2(r15374, r15372);
        float r15376 = log(r15372);
        float r15377 = r15375 - r15376;
        return r15377;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15378 = a;
        double r15379 = c;
        double r15380 = atan2(r15378, r15379);
        double r15381 = atan2(r15380, r15378);
        double r15382 = log(r15378);
        double r15383 = r15381 - r15382;
        return r15383;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15391 = a;
        double r15392 = c;
        double r15393 = atan2(r15391, r15392);
        double r15394 = atan2(r15393, r15391);
        double r15395 = exp(r15394);
        double r15396 = r15395 / r15391;
        double r15397 = log(r15396);
        return r15397;
}

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 r15398, r15399, r15400, r15401, r15402, r15403;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
        mpfr_init(r15401);
        mpfr_init(r15402);
        mpfr_init(r15403);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15398, a, MPFR_RNDN);
        mpfr_set_d(r15399, c, MPFR_RNDN);
        mpfr_atan2(r15400, r15398, r15399, MPFR_RNDN);
        mpfr_atan2(r15401, r15400, r15398, MPFR_RNDN);
        mpfr_log(r15402, r15398, MPFR_RNDN);
        mpfr_sub(r15403, r15401, r15402, MPFR_RNDN);
        return mpfr_get_d(r15403, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
}

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

static mpfr_t r15411, r15412, r15413, r15414, r15415, r15416, r15417;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15411, a, MPFR_RNDN);
        mpfr_set_d(r15412, c, MPFR_RNDN);
        mpfr_atan2(r15413, r15411, r15412, MPFR_RNDN);
        mpfr_atan2(r15414, r15413, r15411, MPFR_RNDN);
        mpfr_exp(r15415, r15414, MPFR_RNDN);
        mpfr_div(r15416, r15415, r15411, MPFR_RNDN);
        mpfr_log(r15417, r15416, MPFR_RNDN);
        return mpfr_get_d(r15417, MPFR_RNDN);
}

