#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 r15533 = a;
        float r15534 = c;
        float r15535 = atan2(r15533, r15534);
        float r15536 = atan2(r15535, r15533);
        float r15537 = log(r15533);
        float r15538 = r15536 - r15537;
        return r15538;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15539 = a;
        double r15540 = c;
        double r15541 = atan2(r15539, r15540);
        double r15542 = atan2(r15541, r15539);
        double r15543 = log(r15539);
        double r15544 = r15542 - r15543;
        return r15544;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15545 = a;
        float r15546 = c;
        float r15547 = atan2(r15545, r15546);
        float r15548 = atan2(r15547, r15545);
        float r15549 = exp(r15548);
        float r15550 = r15549 / r15545;
        float r15551 = log(r15550);
        return r15551;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15552 = a;
        double r15553 = c;
        double r15554 = atan2(r15552, r15553);
        double r15555 = atan2(r15554, r15552);
        double r15556 = exp(r15555);
        double r15557 = r15556 / r15552;
        double r15558 = log(r15557);
        return r15558;
}

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 r15559, r15560, r15561, r15562, r15563, r15564;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15559);
        mpfr_init(r15560);
        mpfr_init(r15561);
        mpfr_init(r15562);
        mpfr_init(r15563);
        mpfr_init(r15564);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15559, a, MPFR_RNDN);
        mpfr_set_d(r15560, c, MPFR_RNDN);
        mpfr_atan2(r15561, r15559, r15560, MPFR_RNDN);
        mpfr_atan2(r15562, r15561, r15559, MPFR_RNDN);
        mpfr_log(r15563, r15559, MPFR_RNDN);
        mpfr_sub(r15564, r15562, r15563, MPFR_RNDN);
        return mpfr_get_d(r15564, MPFR_RNDN);
}

static mpfr_t r15565, r15566, r15567, r15568, r15569, r15570, r15571;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15565);
        mpfr_init(r15566);
        mpfr_init(r15567);
        mpfr_init(r15568);
        mpfr_init(r15569);
        mpfr_init(r15570);
        mpfr_init(r15571);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15565, a, MPFR_RNDN);
        mpfr_set_d(r15566, c, MPFR_RNDN);
        mpfr_atan2(r15567, r15565, r15566, MPFR_RNDN);
        mpfr_atan2(r15568, r15567, r15565, MPFR_RNDN);
        mpfr_exp(r15569, r15568, MPFR_RNDN);
        mpfr_div(r15570, r15569, r15565, MPFR_RNDN);
        mpfr_log(r15571, r15570, MPFR_RNDN);
        return mpfr_get_d(r15571, MPFR_RNDN);
}

static mpfr_t r15572, r15573, r15574, r15575, r15576, r15577, r15578;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15572);
        mpfr_init(r15573);
        mpfr_init(r15574);
        mpfr_init(r15575);
        mpfr_init(r15576);
        mpfr_init(r15577);
        mpfr_init(r15578);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15572, a, MPFR_RNDN);
        mpfr_set_d(r15573, c, MPFR_RNDN);
        mpfr_atan2(r15574, r15572, r15573, MPFR_RNDN);
        mpfr_atan2(r15575, r15574, r15572, MPFR_RNDN);
        mpfr_exp(r15576, r15575, MPFR_RNDN);
        mpfr_div(r15577, r15576, r15572, MPFR_RNDN);
        mpfr_log(r15578, r15577, MPFR_RNDN);
        return mpfr_get_d(r15578, MPFR_RNDN);
}

