#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 r15504 = a;
        float r15505 = c;
        float r15506 = atan2(r15504, r15505);
        float r15507 = atan2(r15506, r15504);
        float r15508 = log(r15504);
        float r15509 = r15507 - r15508;
        return r15509;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15510 = a;
        double r15511 = c;
        double r15512 = atan2(r15510, r15511);
        double r15513 = atan2(r15512, r15510);
        double r15514 = log(r15510);
        double r15515 = r15513 - r15514;
        return r15515;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15516 = a;
        float r15517 = c;
        float r15518 = atan2(r15516, r15517);
        float r15519 = atan2(r15518, r15516);
        float r15520 = exp(r15519);
        float r15521 = r15520 / r15516;
        float r15522 = log(r15521);
        return r15522;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15523 = a;
        double r15524 = c;
        double r15525 = atan2(r15523, r15524);
        double r15526 = atan2(r15525, r15523);
        double r15527 = exp(r15526);
        double r15528 = r15527 / r15523;
        double r15529 = log(r15528);
        return r15529;
}

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 r15530, r15531, r15532, r15533, r15534, r15535;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15530);
        mpfr_init(r15531);
        mpfr_init(r15532);
        mpfr_init(r15533);
        mpfr_init(r15534);
        mpfr_init(r15535);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15530, a, MPFR_RNDN);
        mpfr_set_d(r15531, c, MPFR_RNDN);
        mpfr_atan2(r15532, r15530, r15531, MPFR_RNDN);
        mpfr_atan2(r15533, r15532, r15530, MPFR_RNDN);
        mpfr_log(r15534, r15530, MPFR_RNDN);
        mpfr_sub(r15535, r15533, r15534, MPFR_RNDN);
        return mpfr_get_d(r15535, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15536);
        mpfr_init(r15537);
        mpfr_init(r15538);
        mpfr_init(r15539);
        mpfr_init(r15540);
        mpfr_init(r15541);
        mpfr_init(r15542);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15536, a, MPFR_RNDN);
        mpfr_set_d(r15537, c, MPFR_RNDN);
        mpfr_atan2(r15538, r15536, r15537, MPFR_RNDN);
        mpfr_atan2(r15539, r15538, r15536, MPFR_RNDN);
        mpfr_exp(r15540, r15539, MPFR_RNDN);
        mpfr_div(r15541, r15540, r15536, MPFR_RNDN);
        mpfr_log(r15542, r15541, MPFR_RNDN);
        return mpfr_get_d(r15542, MPFR_RNDN);
}

static mpfr_t r15543, r15544, r15545, r15546, r15547, r15548, r15549;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15543);
        mpfr_init(r15544);
        mpfr_init(r15545);
        mpfr_init(r15546);
        mpfr_init(r15547);
        mpfr_init(r15548);
        mpfr_init(r15549);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15543, a, MPFR_RNDN);
        mpfr_set_d(r15544, c, MPFR_RNDN);
        mpfr_atan2(r15545, r15543, r15544, MPFR_RNDN);
        mpfr_atan2(r15546, r15545, r15543, MPFR_RNDN);
        mpfr_exp(r15547, r15546, MPFR_RNDN);
        mpfr_div(r15548, r15547, r15543, MPFR_RNDN);
        mpfr_log(r15549, r15548, MPFR_RNDN);
        return mpfr_get_d(r15549, MPFR_RNDN);
}

