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

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


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

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

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

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

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

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

void setup_mpfr_f_fm() {
        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_fm(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);
}

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

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

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

