#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 r15584 = a;
        float r15585 = c;
        float r15586 = atan2(r15584, r15585);
        float r15587 = atan2(r15586, r15584);
        float r15588 = log(r15584);
        float r15589 = r15587 - r15588;
        return r15589;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15590 = a;
        double r15591 = c;
        double r15592 = atan2(r15590, r15591);
        double r15593 = atan2(r15592, r15590);
        double r15594 = log(r15590);
        double r15595 = r15593 - r15594;
        return r15595;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15596 = a;
        float r15597 = c;
        float r15598 = atan2(r15596, r15597);
        float r15599 = atan2(r15598, r15596);
        float r15600 = exp(r15599);
        float r15601 = r15600 / r15596;
        float r15602 = log(r15601);
        return r15602;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15603 = a;
        double r15604 = c;
        double r15605 = atan2(r15603, r15604);
        double r15606 = atan2(r15605, r15603);
        double r15607 = exp(r15606);
        double r15608 = r15607 / r15603;
        double r15609 = log(r15608);
        return r15609;
}

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 r15610, r15611, r15612, r15613, r15614, r15615;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15610);
        mpfr_init(r15611);
        mpfr_init(r15612);
        mpfr_init(r15613);
        mpfr_init(r15614);
        mpfr_init(r15615);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15610, a, MPFR_RNDN);
        mpfr_set_d(r15611, c, MPFR_RNDN);
        mpfr_atan2(r15612, r15610, r15611, MPFR_RNDN);
        mpfr_atan2(r15613, r15612, r15610, MPFR_RNDN);
        mpfr_log(r15614, r15610, MPFR_RNDN);
        mpfr_sub(r15615, r15613, r15614, MPFR_RNDN);
        return mpfr_get_d(r15615, MPFR_RNDN);
}

static mpfr_t r15616, r15617, r15618, r15619, r15620, r15621, r15622;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15616);
        mpfr_init(r15617);
        mpfr_init(r15618);
        mpfr_init(r15619);
        mpfr_init(r15620);
        mpfr_init(r15621);
        mpfr_init(r15622);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15616, a, MPFR_RNDN);
        mpfr_set_d(r15617, c, MPFR_RNDN);
        mpfr_atan2(r15618, r15616, r15617, MPFR_RNDN);
        mpfr_atan2(r15619, r15618, r15616, MPFR_RNDN);
        mpfr_exp(r15620, r15619, MPFR_RNDN);
        mpfr_div(r15621, r15620, r15616, MPFR_RNDN);
        mpfr_log(r15622, r15621, MPFR_RNDN);
        return mpfr_get_d(r15622, MPFR_RNDN);
}

static mpfr_t r15623, r15624, r15625, r15626, r15627, r15628, r15629;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15623);
        mpfr_init(r15624);
        mpfr_init(r15625);
        mpfr_init(r15626);
        mpfr_init(r15627);
        mpfr_init(r15628);
        mpfr_init(r15629);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15623, a, MPFR_RNDN);
        mpfr_set_d(r15624, c, MPFR_RNDN);
        mpfr_atan2(r15625, r15623, r15624, MPFR_RNDN);
        mpfr_atan2(r15626, r15625, r15623, MPFR_RNDN);
        mpfr_exp(r15627, r15626, MPFR_RNDN);
        mpfr_div(r15628, r15627, r15623, MPFR_RNDN);
        mpfr_log(r15629, r15628, MPFR_RNDN);
        return mpfr_get_d(r15629, MPFR_RNDN);
}

