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

double f_id(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 = log(r15511);
        double r15516 = r15514 - r15515;
        return r15516;
}


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

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

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

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

double f_im(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_log(r15535, r15531, MPFR_RNDN);
        mpfr_sub(r15536, r15534, r15535, MPFR_RNDN);
        return mpfr_get_d(r15536, MPFR_RNDN);
}

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

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

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

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

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

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

