#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 r15347 = a;
        float r15348 = c;
        float r15349 = atan2(r15347, r15348);
        float r15350 = atan2(r15349, r15347);
        float r15351 = log(r15347);
        float r15352 = r15350 - r15351;
        return r15352;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15353 = a;
        double r15354 = c;
        double r15355 = atan2(r15353, r15354);
        double r15356 = atan2(r15355, r15353);
        double r15357 = log(r15353);
        double r15358 = r15356 - r15357;
        return r15358;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15359 = a;
        float r15360 = c;
        float r15361 = atan2(r15359, r15360);
        float r15362 = atan2(r15361, r15359);
        float r15363 = exp(r15362);
        float r15364 = r15363 / r15359;
        float r15365 = log(r15364);
        return r15365;
}

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

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 r15373, r15374, r15375, r15376, r15377, r15378;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
        mpfr_init(r15376);
        mpfr_init(r15377);
        mpfr_init(r15378);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15373, a, MPFR_RNDN);
        mpfr_set_d(r15374, c, MPFR_RNDN);
        mpfr_atan2(r15375, r15373, r15374, MPFR_RNDN);
        mpfr_atan2(r15376, r15375, r15373, MPFR_RNDN);
        mpfr_log(r15377, r15373, MPFR_RNDN);
        mpfr_sub(r15378, r15376, r15377, MPFR_RNDN);
        return mpfr_get_d(r15378, MPFR_RNDN);
}

static mpfr_t r15379, r15380, r15381, r15382, r15383, r15384, r15385;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15379);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15379, a, MPFR_RNDN);
        mpfr_set_d(r15380, c, MPFR_RNDN);
        mpfr_atan2(r15381, r15379, r15380, MPFR_RNDN);
        mpfr_atan2(r15382, r15381, r15379, MPFR_RNDN);
        mpfr_exp(r15383, r15382, MPFR_RNDN);
        mpfr_div(r15384, r15383, r15379, MPFR_RNDN);
        mpfr_log(r15385, r15384, MPFR_RNDN);
        return mpfr_get_d(r15385, MPFR_RNDN);
}

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15386);
        mpfr_init(r15387);
        mpfr_init(r15388);
        mpfr_init(r15389);
        mpfr_init(r15390);
        mpfr_init(r15391);
        mpfr_init(r15392);
}

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

