#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 r15324 = a;
        float r15325 = c;
        float r15326 = atan2(r15324, r15325);
        float r15327 = atan2(r15326, r15324);
        float r15328 = log(r15324);
        float r15329 = r15327 - r15328;
        return r15329;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15330 = a;
        double r15331 = c;
        double r15332 = atan2(r15330, r15331);
        double r15333 = atan2(r15332, r15330);
        double r15334 = log(r15330);
        double r15335 = r15333 - r15334;
        return r15335;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15336 = a;
        float r15337 = c;
        float r15338 = atan2(r15336, r15337);
        float r15339 = atan2(r15338, r15336);
        float r15340 = exp(r15339);
        float r15341 = r15340 / r15336;
        float r15342 = log(r15341);
        return r15342;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15343 = a;
        double r15344 = c;
        double r15345 = atan2(r15343, r15344);
        double r15346 = atan2(r15345, r15343);
        double r15347 = exp(r15346);
        double r15348 = r15347 / r15343;
        double r15349 = log(r15348);
        return r15349;
}

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 r15350, r15351, r15352, r15353, r15354, r15355;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15350);
        mpfr_init(r15351);
        mpfr_init(r15352);
        mpfr_init(r15353);
        mpfr_init(r15354);
        mpfr_init(r15355);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15350, a, MPFR_RNDN);
        mpfr_set_d(r15351, c, MPFR_RNDN);
        mpfr_atan2(r15352, r15350, r15351, MPFR_RNDN);
        mpfr_atan2(r15353, r15352, r15350, MPFR_RNDN);
        mpfr_log(r15354, r15350, MPFR_RNDN);
        mpfr_sub(r15355, r15353, r15354, MPFR_RNDN);
        return mpfr_get_d(r15355, MPFR_RNDN);
}

static mpfr_t r15356, r15357, r15358, r15359, r15360, r15361, r15362;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15356);
        mpfr_init(r15357);
        mpfr_init(r15358);
        mpfr_init(r15359);
        mpfr_init(r15360);
        mpfr_init(r15361);
        mpfr_init(r15362);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15356, a, MPFR_RNDN);
        mpfr_set_d(r15357, c, MPFR_RNDN);
        mpfr_atan2(r15358, r15356, r15357, MPFR_RNDN);
        mpfr_atan2(r15359, r15358, r15356, MPFR_RNDN);
        mpfr_exp(r15360, r15359, MPFR_RNDN);
        mpfr_div(r15361, r15360, r15356, MPFR_RNDN);
        mpfr_log(r15362, r15361, MPFR_RNDN);
        return mpfr_get_d(r15362, MPFR_RNDN);
}

static mpfr_t r15363, r15364, r15365, r15366, r15367, r15368, r15369;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15363);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15363, a, MPFR_RNDN);
        mpfr_set_d(r15364, c, MPFR_RNDN);
        mpfr_atan2(r15365, r15363, r15364, MPFR_RNDN);
        mpfr_atan2(r15366, r15365, r15363, MPFR_RNDN);
        mpfr_exp(r15367, r15366, MPFR_RNDN);
        mpfr_div(r15368, r15367, r15363, MPFR_RNDN);
        mpfr_log(r15369, r15368, MPFR_RNDN);
        return mpfr_get_d(r15369, MPFR_RNDN);
}

