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

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15515 = a;
        double r15516 = c;
        double r15517 = atan2(r15515, r15516);
        double r15518 = atan2(r15517, r15515);
        double r15519 = log(r15515);
        double r15520 = r15518 - r15519;
        return r15520;
}


double f_of(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 = exp(r15524);
        float r15526 = r15525 / r15521;
        float r15527 = log(r15526);
        return r15527;
}

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

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 r15535, r15536, r15537, r15538, r15539, r15540;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15535);
        mpfr_init(r15536);
        mpfr_init(r15537);
        mpfr_init(r15538);
        mpfr_init(r15539);
        mpfr_init(r15540);
}

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

static mpfr_t r15541, r15542, r15543, r15544, r15545, r15546, r15547;

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

double f_fm(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_exp(r15545, r15544, MPFR_RNDN);
        mpfr_div(r15546, r15545, r15541, MPFR_RNDN);
        mpfr_log(r15547, r15546, MPFR_RNDN);
        return mpfr_get_d(r15547, MPFR_RNDN);
}

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

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

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

