#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 r15684 = a;
        float r15685 = c;
        float r15686 = atan2(r15684, r15685);
        float r15687 = atan2(r15686, r15684);
        float r15688 = log(r15684);
        float r15689 = r15687 - r15688;
        return r15689;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15690 = a;
        double r15691 = c;
        double r15692 = atan2(r15690, r15691);
        double r15693 = atan2(r15692, r15690);
        double r15694 = log(r15690);
        double r15695 = r15693 - r15694;
        return r15695;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15696 = a;
        float r15697 = c;
        float r15698 = atan2(r15696, r15697);
        float r15699 = atan2(r15698, r15696);
        float r15700 = exp(r15699);
        float r15701 = r15700 / r15696;
        float r15702 = log(r15701);
        return r15702;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15703 = a;
        double r15704 = c;
        double r15705 = atan2(r15703, r15704);
        double r15706 = atan2(r15705, r15703);
        double r15707 = exp(r15706);
        double r15708 = r15707 / r15703;
        double r15709 = log(r15708);
        return r15709;
}

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 r15710, r15711, r15712, r15713, r15714, r15715;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15710);
        mpfr_init(r15711);
        mpfr_init(r15712);
        mpfr_init(r15713);
        mpfr_init(r15714);
        mpfr_init(r15715);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15710, a, MPFR_RNDN);
        mpfr_set_d(r15711, c, MPFR_RNDN);
        mpfr_atan2(r15712, r15710, r15711, MPFR_RNDN);
        mpfr_atan2(r15713, r15712, r15710, MPFR_RNDN);
        mpfr_log(r15714, r15710, MPFR_RNDN);
        mpfr_sub(r15715, r15713, r15714, MPFR_RNDN);
        return mpfr_get_d(r15715, MPFR_RNDN);
}

static mpfr_t r15716, r15717, r15718, r15719, r15720, r15721, r15722;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15716);
        mpfr_init(r15717);
        mpfr_init(r15718);
        mpfr_init(r15719);
        mpfr_init(r15720);
        mpfr_init(r15721);
        mpfr_init(r15722);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15716, a, MPFR_RNDN);
        mpfr_set_d(r15717, c, MPFR_RNDN);
        mpfr_atan2(r15718, r15716, r15717, MPFR_RNDN);
        mpfr_atan2(r15719, r15718, r15716, MPFR_RNDN);
        mpfr_exp(r15720, r15719, MPFR_RNDN);
        mpfr_div(r15721, r15720, r15716, MPFR_RNDN);
        mpfr_log(r15722, r15721, MPFR_RNDN);
        return mpfr_get_d(r15722, MPFR_RNDN);
}

static mpfr_t r15723, r15724, r15725, r15726, r15727, r15728, r15729;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15723);
        mpfr_init(r15724);
        mpfr_init(r15725);
        mpfr_init(r15726);
        mpfr_init(r15727);
        mpfr_init(r15728);
        mpfr_init(r15729);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15723, a, MPFR_RNDN);
        mpfr_set_d(r15724, c, MPFR_RNDN);
        mpfr_atan2(r15725, r15723, r15724, MPFR_RNDN);
        mpfr_atan2(r15726, r15725, r15723, MPFR_RNDN);
        mpfr_exp(r15727, r15726, MPFR_RNDN);
        mpfr_div(r15728, r15727, r15723, MPFR_RNDN);
        mpfr_log(r15729, r15728, MPFR_RNDN);
        return mpfr_get_d(r15729, MPFR_RNDN);
}

