#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 r15492 = a;
        float r15493 = c;
        float r15494 = atan2(r15492, r15493);
        float r15495 = atan2(r15494, r15492);
        float r15496 = log(r15492);
        float r15497 = r15495 - r15496;
        return r15497;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15498 = a;
        double r15499 = c;
        double r15500 = atan2(r15498, r15499);
        double r15501 = atan2(r15500, r15498);
        double r15502 = log(r15498);
        double r15503 = r15501 - r15502;
        return r15503;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15504 = a;
        float r15505 = c;
        float r15506 = atan2(r15504, r15505);
        float r15507 = atan2(r15506, r15504);
        float r15508 = exp(r15507);
        float r15509 = r15508 / r15504;
        float r15510 = log(r15509);
        return r15510;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15511 = a;
        double r15512 = c;
        double r15513 = atan2(r15511, r15512);
        double r15514 = atan2(r15513, r15511);
        double r15515 = exp(r15514);
        double r15516 = r15515 / r15511;
        double r15517 = log(r15516);
        return r15517;
}

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 r15518, r15519, r15520, r15521, r15522, r15523;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15518);
        mpfr_init(r15519);
        mpfr_init(r15520);
        mpfr_init(r15521);
        mpfr_init(r15522);
        mpfr_init(r15523);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15518, a, MPFR_RNDN);
        mpfr_set_d(r15519, c, MPFR_RNDN);
        mpfr_atan2(r15520, r15518, r15519, MPFR_RNDN);
        mpfr_atan2(r15521, r15520, r15518, MPFR_RNDN);
        mpfr_log(r15522, r15518, MPFR_RNDN);
        mpfr_sub(r15523, r15521, r15522, MPFR_RNDN);
        return mpfr_get_d(r15523, MPFR_RNDN);
}

static mpfr_t r15524, r15525, r15526, r15527, r15528, r15529, r15530;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15524);
        mpfr_init(r15525);
        mpfr_init(r15526);
        mpfr_init(r15527);
        mpfr_init(r15528);
        mpfr_init(r15529);
        mpfr_init(r15530);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15524, a, MPFR_RNDN);
        mpfr_set_d(r15525, c, MPFR_RNDN);
        mpfr_atan2(r15526, r15524, r15525, MPFR_RNDN);
        mpfr_atan2(r15527, r15526, r15524, MPFR_RNDN);
        mpfr_exp(r15528, r15527, MPFR_RNDN);
        mpfr_div(r15529, r15528, r15524, MPFR_RNDN);
        mpfr_log(r15530, r15529, MPFR_RNDN);
        return mpfr_get_d(r15530, MPFR_RNDN);
}

static mpfr_t r15531, r15532, r15533, r15534, r15535, r15536, r15537;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15531);
        mpfr_init(r15532);
        mpfr_init(r15533);
        mpfr_init(r15534);
        mpfr_init(r15535);
        mpfr_init(r15536);
        mpfr_init(r15537);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15531, a, MPFR_RNDN);
        mpfr_set_d(r15532, c, MPFR_RNDN);
        mpfr_atan2(r15533, r15531, r15532, MPFR_RNDN);
        mpfr_atan2(r15534, r15533, r15531, MPFR_RNDN);
        mpfr_exp(r15535, r15534, MPFR_RNDN);
        mpfr_div(r15536, r15535, r15531, MPFR_RNDN);
        mpfr_log(r15537, r15536, MPFR_RNDN);
        return mpfr_get_d(r15537, MPFR_RNDN);
}

