#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 r15512 = a;
        float r15513 = c;
        float r15514 = atan2(r15512, r15513);
        float r15515 = atan2(r15514, r15512);
        float r15516 = log(r15512);
        float r15517 = r15515 - r15516;
        return r15517;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15518 = a;
        double r15519 = c;
        double r15520 = atan2(r15518, r15519);
        double r15521 = atan2(r15520, r15518);
        double r15522 = log(r15518);
        double r15523 = r15521 - r15522;
        return r15523;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15524 = a;
        float r15525 = c;
        float r15526 = atan2(r15524, r15525);
        float r15527 = atan2(r15526, r15524);
        float r15528 = exp(r15527);
        float r15529 = r15528 / r15524;
        float r15530 = log(r15529);
        return r15530;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15531 = a;
        double r15532 = c;
        double r15533 = atan2(r15531, r15532);
        double r15534 = atan2(r15533, r15531);
        double r15535 = exp(r15534);
        double r15536 = r15535 / r15531;
        double r15537 = log(r15536);
        return r15537;
}

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 r15538, r15539, r15540, r15541, r15542, r15543;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15538);
        mpfr_init(r15539);
        mpfr_init(r15540);
        mpfr_init(r15541);
        mpfr_init(r15542);
        mpfr_init(r15543);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15538, a, MPFR_RNDN);
        mpfr_set_d(r15539, c, MPFR_RNDN);
        mpfr_atan2(r15540, r15538, r15539, MPFR_RNDN);
        mpfr_atan2(r15541, r15540, r15538, MPFR_RNDN);
        mpfr_log(r15542, r15538, MPFR_RNDN);
        mpfr_sub(r15543, r15541, r15542, MPFR_RNDN);
        return mpfr_get_d(r15543, MPFR_RNDN);
}

static mpfr_t r15544, r15545, r15546, r15547, r15548, r15549, r15550;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15544);
        mpfr_init(r15545);
        mpfr_init(r15546);
        mpfr_init(r15547);
        mpfr_init(r15548);
        mpfr_init(r15549);
        mpfr_init(r15550);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15544, a, MPFR_RNDN);
        mpfr_set_d(r15545, c, MPFR_RNDN);
        mpfr_atan2(r15546, r15544, r15545, MPFR_RNDN);
        mpfr_atan2(r15547, r15546, r15544, MPFR_RNDN);
        mpfr_exp(r15548, r15547, MPFR_RNDN);
        mpfr_div(r15549, r15548, r15544, MPFR_RNDN);
        mpfr_log(r15550, r15549, MPFR_RNDN);
        return mpfr_get_d(r15550, MPFR_RNDN);
}

static mpfr_t r15551, r15552, r15553, r15554, r15555, r15556, r15557;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15551);
        mpfr_init(r15552);
        mpfr_init(r15553);
        mpfr_init(r15554);
        mpfr_init(r15555);
        mpfr_init(r15556);
        mpfr_init(r15557);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15551, a, MPFR_RNDN);
        mpfr_set_d(r15552, c, MPFR_RNDN);
        mpfr_atan2(r15553, r15551, r15552, MPFR_RNDN);
        mpfr_atan2(r15554, r15553, r15551, MPFR_RNDN);
        mpfr_exp(r15555, r15554, MPFR_RNDN);
        mpfr_div(r15556, r15555, r15551, MPFR_RNDN);
        mpfr_log(r15557, r15556, MPFR_RNDN);
        return mpfr_get_d(r15557, MPFR_RNDN);
}

