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

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


double f_of(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 = exp(r15508);
        float r15510 = r15509 / r15505;
        float r15511 = log(r15510);
        return r15511;
}

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

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

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

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

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

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

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

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

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

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

