#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 r15549 = a;
        float r15550 = c;
        float r15551 = atan2(r15549, r15550);
        float r15552 = atan2(r15551, r15549);
        float r15553 = log(r15549);
        float r15554 = r15552 - r15553;
        return r15554;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15555 = a;
        double r15556 = c;
        double r15557 = atan2(r15555, r15556);
        double r15558 = atan2(r15557, r15555);
        double r15559 = log(r15555);
        double r15560 = r15558 - r15559;
        return r15560;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15561 = a;
        float r15562 = c;
        float r15563 = atan2(r15561, r15562);
        float r15564 = atan2(r15563, r15561);
        float r15565 = exp(r15564);
        float r15566 = r15565 / r15561;
        float r15567 = log(r15566);
        return r15567;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15568 = a;
        double r15569 = c;
        double r15570 = atan2(r15568, r15569);
        double r15571 = atan2(r15570, r15568);
        double r15572 = exp(r15571);
        double r15573 = r15572 / r15568;
        double r15574 = log(r15573);
        return r15574;
}

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 r15575, r15576, r15577, r15578, r15579, r15580;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15575);
        mpfr_init(r15576);
        mpfr_init(r15577);
        mpfr_init(r15578);
        mpfr_init(r15579);
        mpfr_init(r15580);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15575, a, MPFR_RNDN);
        mpfr_set_d(r15576, c, MPFR_RNDN);
        mpfr_atan2(r15577, r15575, r15576, MPFR_RNDN);
        mpfr_atan2(r15578, r15577, r15575, MPFR_RNDN);
        mpfr_log(r15579, r15575, MPFR_RNDN);
        mpfr_sub(r15580, r15578, r15579, MPFR_RNDN);
        return mpfr_get_d(r15580, MPFR_RNDN);
}

static mpfr_t r15581, r15582, r15583, r15584, r15585, r15586, r15587;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15581);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
        mpfr_init(r15587);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15581, a, MPFR_RNDN);
        mpfr_set_d(r15582, c, MPFR_RNDN);
        mpfr_atan2(r15583, r15581, r15582, MPFR_RNDN);
        mpfr_atan2(r15584, r15583, r15581, MPFR_RNDN);
        mpfr_exp(r15585, r15584, MPFR_RNDN);
        mpfr_div(r15586, r15585, r15581, MPFR_RNDN);
        mpfr_log(r15587, r15586, MPFR_RNDN);
        return mpfr_get_d(r15587, MPFR_RNDN);
}

static mpfr_t r15588, r15589, r15590, r15591, r15592, r15593, r15594;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15588);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
        mpfr_init(r15593);
        mpfr_init(r15594);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15588, a, MPFR_RNDN);
        mpfr_set_d(r15589, c, MPFR_RNDN);
        mpfr_atan2(r15590, r15588, r15589, MPFR_RNDN);
        mpfr_atan2(r15591, r15590, r15588, MPFR_RNDN);
        mpfr_exp(r15592, r15591, MPFR_RNDN);
        mpfr_div(r15593, r15592, r15588, MPFR_RNDN);
        mpfr_log(r15594, r15593, MPFR_RNDN);
        return mpfr_get_d(r15594, MPFR_RNDN);
}

