#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 r15545 = a;
        float r15546 = c;
        float r15547 = atan2(r15545, r15546);
        float r15548 = atan2(r15547, r15545);
        float r15549 = log(r15545);
        float r15550 = r15548 - r15549;
        return r15550;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15551 = a;
        double r15552 = c;
        double r15553 = atan2(r15551, r15552);
        double r15554 = atan2(r15553, r15551);
        double r15555 = log(r15551);
        double r15556 = r15554 - r15555;
        return r15556;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15567 = a;
        double r15568 = c;
        double r15569 = atan2(r15567, r15568);
        double r15570 = atan2(r15569, r15567);
        double r15571 = log1p(r15570);
        double r15572 = sqrt(r15571);
        double r15573 = r15572 * r15572;
        double r15574 = expm1(r15573);
        double r15575 = log(r15567);
        double r15576 = r15574 - r15575;
        return r15576;
}

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 r15577, r15578, r15579, r15580, r15581, r15582;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15577);
        mpfr_init(r15578);
        mpfr_init(r15579);
        mpfr_init(r15580);
        mpfr_init(r15581);
        mpfr_init(r15582);
}

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

static mpfr_t r15583, r15584, r15585, r15586, r15587, r15588, r15589, r15590, r15591, r15592;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
        mpfr_init(r15587);
        mpfr_init(r15588);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15583, a, MPFR_RNDN);
        mpfr_set_d(r15584, c, MPFR_RNDN);
        mpfr_atan2(r15585, r15583, r15584, MPFR_RNDN);
        mpfr_atan2(r15586, r15585, r15583, MPFR_RNDN);
        mpfr_log1p(r15587, r15586, MPFR_RNDN);
        mpfr_sqrt(r15588, r15587, MPFR_RNDN);
        mpfr_sqr(r15589, r15588, MPFR_RNDN);
        mpfr_expm1(r15590, r15589, MPFR_RNDN);
        mpfr_log(r15591, r15583, MPFR_RNDN);
        mpfr_sub(r15592, r15590, r15591, MPFR_RNDN);
        return mpfr_get_d(r15592, MPFR_RNDN);
}

static mpfr_t r15593, r15594, r15595, r15596, r15597, r15598, r15599, r15600, r15601, r15602;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15593);
        mpfr_init(r15594);
        mpfr_init(r15595);
        mpfr_init(r15596);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
        mpfr_init(r15600);
        mpfr_init(r15601);
        mpfr_init(r15602);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15593, a, MPFR_RNDN);
        mpfr_set_d(r15594, c, MPFR_RNDN);
        mpfr_atan2(r15595, r15593, r15594, MPFR_RNDN);
        mpfr_atan2(r15596, r15595, r15593, MPFR_RNDN);
        mpfr_log1p(r15597, r15596, MPFR_RNDN);
        mpfr_sqrt(r15598, r15597, MPFR_RNDN);
        mpfr_sqr(r15599, r15598, MPFR_RNDN);
        mpfr_expm1(r15600, r15599, MPFR_RNDN);
        mpfr_log(r15601, r15593, MPFR_RNDN);
        mpfr_sub(r15602, r15600, r15601, MPFR_RNDN);
        return mpfr_get_d(r15602, MPFR_RNDN);
}

