#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 r15496 = a;
        float r15497 = c;
        float r15498 = atan2(r15496, r15497);
        float r15499 = atan2(r15498, r15496);
        float r15500 = log(r15496);
        float r15501 = r15499 - r15500;
        return r15501;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15502 = a;
        double r15503 = c;
        double r15504 = atan2(r15502, r15503);
        double r15505 = atan2(r15504, r15502);
        double r15506 = log(r15502);
        double r15507 = r15505 - r15506;
        return r15507;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15508 = a;
        float r15509 = c;
        float r15510 = atan2(r15508, r15509);
        float r15511 = atan2(r15510, r15508);
        float r15512 = exp(r15511);
        float r15513 = r15512 / r15508;
        float r15514 = log(r15513);
        return r15514;
}

double f_od(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 = exp(r15518);
        double r15520 = r15519 / r15515;
        double r15521 = log(r15520);
        return r15521;
}

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 r15522, r15523, r15524, r15525, r15526, r15527;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15522);
        mpfr_init(r15523);
        mpfr_init(r15524);
        mpfr_init(r15525);
        mpfr_init(r15526);
        mpfr_init(r15527);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15522, a, MPFR_RNDN);
        mpfr_set_d(r15523, c, MPFR_RNDN);
        mpfr_atan2(r15524, r15522, r15523, MPFR_RNDN);
        mpfr_atan2(r15525, r15524, r15522, MPFR_RNDN);
        mpfr_log(r15526, r15522, MPFR_RNDN);
        mpfr_sub(r15527, r15525, r15526, MPFR_RNDN);
        return mpfr_get_d(r15527, MPFR_RNDN);
}

static mpfr_t r15528, r15529, r15530, r15531, r15532, r15533, r15534;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15528);
        mpfr_init(r15529);
        mpfr_init(r15530);
        mpfr_init(r15531);
        mpfr_init(r15532);
        mpfr_init(r15533);
        mpfr_init(r15534);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15528, a, MPFR_RNDN);
        mpfr_set_d(r15529, c, MPFR_RNDN);
        mpfr_atan2(r15530, r15528, r15529, MPFR_RNDN);
        mpfr_atan2(r15531, r15530, r15528, MPFR_RNDN);
        mpfr_exp(r15532, r15531, MPFR_RNDN);
        mpfr_div(r15533, r15532, r15528, MPFR_RNDN);
        mpfr_log(r15534, r15533, MPFR_RNDN);
        return mpfr_get_d(r15534, MPFR_RNDN);
}

static mpfr_t r15535, r15536, r15537, r15538, r15539, r15540, r15541;

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

double f_dm(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_exp(r15539, r15538, MPFR_RNDN);
        mpfr_div(r15540, r15539, r15535, MPFR_RNDN);
        mpfr_log(r15541, r15540, MPFR_RNDN);
        return mpfr_get_d(r15541, MPFR_RNDN);
}

