#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 r15355 = a;
        float r15356 = c;
        float r15357 = atan2(r15355, r15356);
        float r15358 = atan2(r15357, r15355);
        float r15359 = log(r15355);
        float r15360 = r15358 - r15359;
        return r15360;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15361 = a;
        double r15362 = c;
        double r15363 = atan2(r15361, r15362);
        double r15364 = atan2(r15363, r15361);
        double r15365 = log(r15361);
        double r15366 = r15364 - r15365;
        return r15366;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15367 = a;
        float r15368 = c;
        float r15369 = atan2(r15367, r15368);
        float r15370 = atan2(r15369, r15367);
        float r15371 = exp(r15370);
        float r15372 = r15371 / r15367;
        float r15373 = log(r15372);
        return r15373;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15374 = a;
        double r15375 = c;
        double r15376 = atan2(r15374, r15375);
        double r15377 = atan2(r15376, r15374);
        double r15378 = exp(r15377);
        double r15379 = r15378 / r15374;
        double r15380 = log(r15379);
        return r15380;
}

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 r15381, r15382, r15383, r15384, r15385, r15386;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
        mpfr_init(r15386);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15381, a, MPFR_RNDN);
        mpfr_set_d(r15382, c, MPFR_RNDN);
        mpfr_atan2(r15383, r15381, r15382, MPFR_RNDN);
        mpfr_atan2(r15384, r15383, r15381, MPFR_RNDN);
        mpfr_log(r15385, r15381, MPFR_RNDN);
        mpfr_sub(r15386, r15384, r15385, MPFR_RNDN);
        return mpfr_get_d(r15386, MPFR_RNDN);
}

static mpfr_t r15387, r15388, r15389, r15390, r15391, r15392, r15393;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
        mpfr_init(r15393);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15387, a, MPFR_RNDN);
        mpfr_set_d(r15388, c, MPFR_RNDN);
        mpfr_atan2(r15389, r15387, r15388, MPFR_RNDN);
        mpfr_atan2(r15390, r15389, r15387, MPFR_RNDN);
        mpfr_exp(r15391, r15390, MPFR_RNDN);
        mpfr_div(r15392, r15391, r15387, MPFR_RNDN);
        mpfr_log(r15393, r15392, MPFR_RNDN);
        return mpfr_get_d(r15393, MPFR_RNDN);
}

static mpfr_t r15394, r15395, r15396, r15397, r15398, r15399, r15400;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15394);
        mpfr_init(r15395);
        mpfr_init(r15396);
        mpfr_init(r15397);
        mpfr_init(r15398);
        mpfr_init(r15399);
        mpfr_init(r15400);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15394, a, MPFR_RNDN);
        mpfr_set_d(r15395, c, MPFR_RNDN);
        mpfr_atan2(r15396, r15394, r15395, MPFR_RNDN);
        mpfr_atan2(r15397, r15396, r15394, MPFR_RNDN);
        mpfr_exp(r15398, r15397, MPFR_RNDN);
        mpfr_div(r15399, r15398, r15394, MPFR_RNDN);
        mpfr_log(r15400, r15399, MPFR_RNDN);
        return mpfr_get_d(r15400, MPFR_RNDN);
}

