#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 r15521 = a;
        float r15522 = c;
        float r15523 = atan2(r15521, r15522);
        float r15524 = atan2(r15523, r15521);
        float r15525 = log(r15521);
        float r15526 = r15524 - r15525;
        return r15526;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15527 = a;
        double r15528 = c;
        double r15529 = atan2(r15527, r15528);
        double r15530 = atan2(r15529, r15527);
        double r15531 = log(r15527);
        double r15532 = r15530 - r15531;
        return r15532;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15541 = a;
        double r15542 = c;
        double r15543 = atan2(r15541, r15542);
        double r15544 = atan2(r15543, r15541);
        double r15545 = exp(r15544);
        double r15546 = log(r15545);
        double r15547 = log(r15541);
        double r15548 = r15546 - r15547;
        return r15548;
}

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 r15549, r15550, r15551, r15552, r15553, r15554;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15549);
        mpfr_init(r15550);
        mpfr_init(r15551);
        mpfr_init(r15552);
        mpfr_init(r15553);
        mpfr_init(r15554);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15549, a, MPFR_RNDN);
        mpfr_set_d(r15550, c, MPFR_RNDN);
        mpfr_atan2(r15551, r15549, r15550, MPFR_RNDN);
        mpfr_atan2(r15552, r15551, r15549, MPFR_RNDN);
        mpfr_log(r15553, r15549, MPFR_RNDN);
        mpfr_sub(r15554, r15552, r15553, MPFR_RNDN);
        return mpfr_get_d(r15554, MPFR_RNDN);
}

static mpfr_t r15555, r15556, r15557, r15558, r15559, r15560, r15561, r15562;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15555);
        mpfr_init(r15556);
        mpfr_init(r15557);
        mpfr_init(r15558);
        mpfr_init(r15559);
        mpfr_init(r15560);
        mpfr_init(r15561);
        mpfr_init(r15562);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15555, a, MPFR_RNDN);
        mpfr_set_d(r15556, c, MPFR_RNDN);
        mpfr_atan2(r15557, r15555, r15556, MPFR_RNDN);
        mpfr_atan2(r15558, r15557, r15555, MPFR_RNDN);
        mpfr_exp(r15559, r15558, MPFR_RNDN);
        mpfr_log(r15560, r15559, MPFR_RNDN);
        mpfr_log(r15561, r15555, MPFR_RNDN);
        mpfr_sub(r15562, r15560, r15561, MPFR_RNDN);
        return mpfr_get_d(r15562, MPFR_RNDN);
}

static mpfr_t r15563, r15564, r15565, r15566, r15567, r15568, r15569, r15570;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15563);
        mpfr_init(r15564);
        mpfr_init(r15565);
        mpfr_init(r15566);
        mpfr_init(r15567);
        mpfr_init(r15568);
        mpfr_init(r15569);
        mpfr_init(r15570);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15563, a, MPFR_RNDN);
        mpfr_set_d(r15564, c, MPFR_RNDN);
        mpfr_atan2(r15565, r15563, r15564, MPFR_RNDN);
        mpfr_atan2(r15566, r15565, r15563, MPFR_RNDN);
        mpfr_exp(r15567, r15566, MPFR_RNDN);
        mpfr_log(r15568, r15567, MPFR_RNDN);
        mpfr_log(r15569, r15563, MPFR_RNDN);
        mpfr_sub(r15570, r15568, r15569, MPFR_RNDN);
        return mpfr_get_d(r15570, MPFR_RNDN);
}

