#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 r15537 = a;
        float r15538 = c;
        float r15539 = atan2(r15537, r15538);
        float r15540 = atan2(r15539, r15537);
        float r15541 = log(r15537);
        float r15542 = r15540 - r15541;
        return r15542;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15543 = a;
        double r15544 = c;
        double r15545 = atan2(r15543, r15544);
        double r15546 = atan2(r15545, r15543);
        double r15547 = log(r15543);
        double r15548 = r15546 - r15547;
        return r15548;
}


double f_of(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 = log1p(r15552);
        float r15554 = expm1(r15553);
        float r15555 = log(r15549);
        float r15556 = r15554 - r15555;
        return r15556;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15557 = a;
        double r15558 = c;
        double r15559 = atan2(r15557, r15558);
        double r15560 = atan2(r15559, r15557);
        double r15561 = log1p(r15560);
        double r15562 = expm1(r15561);
        double r15563 = log(r15557);
        double r15564 = r15562 - r15563;
        return r15564;
}

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 r15565, r15566, r15567, r15568, r15569, r15570;

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

double f_im(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_log(r15569, r15565, MPFR_RNDN);
        mpfr_sub(r15570, r15568, r15569, MPFR_RNDN);
        return mpfr_get_d(r15570, MPFR_RNDN);
}

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

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

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15571, a, MPFR_RNDN);
        mpfr_set_d(r15572, c, MPFR_RNDN);
        mpfr_atan2(r15573, r15571, r15572, MPFR_RNDN);
        mpfr_atan2(r15574, r15573, r15571, MPFR_RNDN);
        mpfr_log1p(r15575, r15574, MPFR_RNDN);
        mpfr_expm1(r15576, r15575, MPFR_RNDN);
        mpfr_log(r15577, r15571, MPFR_RNDN);
        mpfr_sub(r15578, r15576, r15577, MPFR_RNDN);
        return mpfr_get_d(r15578, MPFR_RNDN);
}

static mpfr_t r15579, r15580, r15581, r15582, r15583, r15584, r15585, r15586;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15579);
        mpfr_init(r15580);
        mpfr_init(r15581);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15579, a, MPFR_RNDN);
        mpfr_set_d(r15580, c, MPFR_RNDN);
        mpfr_atan2(r15581, r15579, r15580, MPFR_RNDN);
        mpfr_atan2(r15582, r15581, r15579, MPFR_RNDN);
        mpfr_log1p(r15583, r15582, MPFR_RNDN);
        mpfr_expm1(r15584, r15583, MPFR_RNDN);
        mpfr_log(r15585, r15579, MPFR_RNDN);
        mpfr_sub(r15586, r15584, r15585, MPFR_RNDN);
        return mpfr_get_d(r15586, MPFR_RNDN);
}

