#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 r15528 = a;
        float r15529 = c;
        float r15530 = atan2(r15528, r15529);
        float r15531 = atan2(r15530, r15528);
        float r15532 = log(r15528);
        float r15533 = r15531 - r15532;
        return r15533;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15534 = a;
        double r15535 = c;
        double r15536 = atan2(r15534, r15535);
        double r15537 = atan2(r15536, r15534);
        double r15538 = log(r15534);
        double r15539 = r15537 - r15538;
        return r15539;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15540 = a;
        float r15541 = c;
        float r15542 = atan2(r15540, r15541);
        float r15543 = atan2(r15542, r15540);
        float r15544 = exp(r15543);
        float r15545 = r15544 / r15540;
        float r15546 = log(r15545);
        return r15546;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15547 = a;
        double r15548 = c;
        double r15549 = atan2(r15547, r15548);
        double r15550 = atan2(r15549, r15547);
        double r15551 = exp(r15550);
        double r15552 = r15551 / r15547;
        double r15553 = log(r15552);
        return r15553;
}

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 r15554, r15555, r15556, r15557, r15558, r15559;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15554);
        mpfr_init(r15555);
        mpfr_init(r15556);
        mpfr_init(r15557);
        mpfr_init(r15558);
        mpfr_init(r15559);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15554, a, MPFR_RNDN);
        mpfr_set_d(r15555, c, MPFR_RNDN);
        mpfr_atan2(r15556, r15554, r15555, MPFR_RNDN);
        mpfr_atan2(r15557, r15556, r15554, MPFR_RNDN);
        mpfr_log(r15558, r15554, MPFR_RNDN);
        mpfr_sub(r15559, r15557, r15558, MPFR_RNDN);
        return mpfr_get_d(r15559, MPFR_RNDN);
}

static mpfr_t r15560, r15561, r15562, r15563, r15564, r15565, r15566;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15560);
        mpfr_init(r15561);
        mpfr_init(r15562);
        mpfr_init(r15563);
        mpfr_init(r15564);
        mpfr_init(r15565);
        mpfr_init(r15566);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15560, a, MPFR_RNDN);
        mpfr_set_d(r15561, c, MPFR_RNDN);
        mpfr_atan2(r15562, r15560, r15561, MPFR_RNDN);
        mpfr_atan2(r15563, r15562, r15560, MPFR_RNDN);
        mpfr_exp(r15564, r15563, MPFR_RNDN);
        mpfr_div(r15565, r15564, r15560, MPFR_RNDN);
        mpfr_log(r15566, r15565, MPFR_RNDN);
        return mpfr_get_d(r15566, MPFR_RNDN);
}

static mpfr_t r15567, r15568, r15569, r15570, r15571, r15572, r15573;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15567);
        mpfr_init(r15568);
        mpfr_init(r15569);
        mpfr_init(r15570);
        mpfr_init(r15571);
        mpfr_init(r15572);
        mpfr_init(r15573);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15567, a, MPFR_RNDN);
        mpfr_set_d(r15568, c, MPFR_RNDN);
        mpfr_atan2(r15569, r15567, r15568, MPFR_RNDN);
        mpfr_atan2(r15570, r15569, r15567, MPFR_RNDN);
        mpfr_exp(r15571, r15570, MPFR_RNDN);
        mpfr_div(r15572, r15571, r15567, MPFR_RNDN);
        mpfr_log(r15573, r15572, MPFR_RNDN);
        return mpfr_get_d(r15573, MPFR_RNDN);
}

