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

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


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

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

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

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

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

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

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

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

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

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

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

