#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 r15624 = a;
        float r15625 = c;
        float r15626 = atan2(r15624, r15625);
        float r15627 = atan2(r15626, r15624);
        float r15628 = log(r15624);
        float r15629 = r15627 - r15628;
        return r15629;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15630 = a;
        double r15631 = c;
        double r15632 = atan2(r15630, r15631);
        double r15633 = atan2(r15632, r15630);
        double r15634 = log(r15630);
        double r15635 = r15633 - r15634;
        return r15635;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15636 = a;
        float r15637 = c;
        float r15638 = atan2(r15636, r15637);
        float r15639 = atan2(r15638, r15636);
        float r15640 = exp(r15639);
        float r15641 = r15640 / r15636;
        float r15642 = log(r15641);
        return r15642;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15643 = a;
        double r15644 = c;
        double r15645 = atan2(r15643, r15644);
        double r15646 = atan2(r15645, r15643);
        double r15647 = exp(r15646);
        double r15648 = r15647 / r15643;
        double r15649 = log(r15648);
        return r15649;
}

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 r15650, r15651, r15652, r15653, r15654, r15655;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15650);
        mpfr_init(r15651);
        mpfr_init(r15652);
        mpfr_init(r15653);
        mpfr_init(r15654);
        mpfr_init(r15655);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15650, a, MPFR_RNDN);
        mpfr_set_d(r15651, c, MPFR_RNDN);
        mpfr_atan2(r15652, r15650, r15651, MPFR_RNDN);
        mpfr_atan2(r15653, r15652, r15650, MPFR_RNDN);
        mpfr_log(r15654, r15650, MPFR_RNDN);
        mpfr_sub(r15655, r15653, r15654, MPFR_RNDN);
        return mpfr_get_d(r15655, MPFR_RNDN);
}

static mpfr_t r15656, r15657, r15658, r15659, r15660, r15661, r15662;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15656);
        mpfr_init(r15657);
        mpfr_init(r15658);
        mpfr_init(r15659);
        mpfr_init(r15660);
        mpfr_init(r15661);
        mpfr_init(r15662);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15656, a, MPFR_RNDN);
        mpfr_set_d(r15657, c, MPFR_RNDN);
        mpfr_atan2(r15658, r15656, r15657, MPFR_RNDN);
        mpfr_atan2(r15659, r15658, r15656, MPFR_RNDN);
        mpfr_exp(r15660, r15659, MPFR_RNDN);
        mpfr_div(r15661, r15660, r15656, MPFR_RNDN);
        mpfr_log(r15662, r15661, MPFR_RNDN);
        return mpfr_get_d(r15662, MPFR_RNDN);
}

static mpfr_t r15663, r15664, r15665, r15666, r15667, r15668, r15669;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15663);
        mpfr_init(r15664);
        mpfr_init(r15665);
        mpfr_init(r15666);
        mpfr_init(r15667);
        mpfr_init(r15668);
        mpfr_init(r15669);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15663, a, MPFR_RNDN);
        mpfr_set_d(r15664, c, MPFR_RNDN);
        mpfr_atan2(r15665, r15663, r15664, MPFR_RNDN);
        mpfr_atan2(r15666, r15665, r15663, MPFR_RNDN);
        mpfr_exp(r15667, r15666, MPFR_RNDN);
        mpfr_div(r15668, r15667, r15663, MPFR_RNDN);
        mpfr_log(r15669, r15668, MPFR_RNDN);
        return mpfr_get_d(r15669, MPFR_RNDN);
}

