#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 r15360 = a;
        float r15361 = c;
        float r15362 = atan2(r15360, r15361);
        float r15363 = atan2(r15362, r15360);
        float r15364 = log(r15360);
        float r15365 = r15363 - r15364;
        return r15365;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15366 = a;
        double r15367 = c;
        double r15368 = atan2(r15366, r15367);
        double r15369 = atan2(r15368, r15366);
        double r15370 = log(r15366);
        double r15371 = r15369 - r15370;
        return r15371;
}


double f_of(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 = exp(r15375);
        float r15377 = r15376 / r15372;
        float r15378 = log(r15377);
        return r15378;
}

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

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 r15386, r15387, r15388, r15389, r15390, r15391;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
}

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

static mpfr_t r15392, r15393, r15394, r15395, r15396, r15397, r15398;

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

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

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

void setup_mpfr_f_dm() {
        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_dm(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);
}

