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

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


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

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

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 r15541, r15542, r15543, r15544, r15545, r15546;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15541);
        mpfr_init(r15542);
        mpfr_init(r15543);
        mpfr_init(r15544);
        mpfr_init(r15545);
        mpfr_init(r15546);
}

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

static mpfr_t r15547, r15548, r15549, r15550, r15551, r15552, r15553, r15554;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15547);
        mpfr_init(r15548);
        mpfr_init(r15549);
        mpfr_init(r15550);
        mpfr_init(r15551);
        mpfr_init(r15552);
        mpfr_init(r15553);
        mpfr_init(r15554);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15547, a, MPFR_RNDN);
        mpfr_set_d(r15548, c, MPFR_RNDN);
        mpfr_atan2(r15549, r15547, r15548, MPFR_RNDN);
        mpfr_atan2(r15550, r15549, r15547, MPFR_RNDN);
        mpfr_exp(r15551, r15550, MPFR_RNDN);
        mpfr_log(r15552, r15551, MPFR_RNDN);
        mpfr_log(r15553, r15547, 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_dm() {
        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_dm(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);
}

