#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 r15448 = a;
        float r15449 = c;
        float r15450 = atan2(r15448, r15449);
        float r15451 = atan2(r15450, r15448);
        float r15452 = log(r15448);
        float r15453 = r15451 - r15452;
        return r15453;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15454 = a;
        double r15455 = c;
        double r15456 = atan2(r15454, r15455);
        double r15457 = atan2(r15456, r15454);
        double r15458 = log(r15454);
        double r15459 = r15457 - r15458;
        return r15459;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15460 = a;
        float r15461 = c;
        float r15462 = atan2(r15460, r15461);
        float r15463 = atan2(r15462, r15460);
        float r15464 = exp(r15463);
        float r15465 = r15464 / r15460;
        float r15466 = log(r15465);
        return r15466;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15467 = a;
        double r15468 = c;
        double r15469 = atan2(r15467, r15468);
        double r15470 = atan2(r15469, r15467);
        double r15471 = exp(r15470);
        double r15472 = r15471 / r15467;
        double r15473 = log(r15472);
        return r15473;
}

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 r15474, r15475, r15476, r15477, r15478, r15479;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15474);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15474, a, MPFR_RNDN);
        mpfr_set_d(r15475, c, MPFR_RNDN);
        mpfr_atan2(r15476, r15474, r15475, MPFR_RNDN);
        mpfr_atan2(r15477, r15476, r15474, MPFR_RNDN);
        mpfr_log(r15478, r15474, MPFR_RNDN);
        mpfr_sub(r15479, r15477, r15478, MPFR_RNDN);
        return mpfr_get_d(r15479, MPFR_RNDN);
}

static mpfr_t r15480, r15481, r15482, r15483, r15484, r15485, r15486;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15480);
        mpfr_init(r15481);
        mpfr_init(r15482);
        mpfr_init(r15483);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15480, a, MPFR_RNDN);
        mpfr_set_d(r15481, c, MPFR_RNDN);
        mpfr_atan2(r15482, r15480, r15481, MPFR_RNDN);
        mpfr_atan2(r15483, r15482, r15480, MPFR_RNDN);
        mpfr_exp(r15484, r15483, MPFR_RNDN);
        mpfr_div(r15485, r15484, r15480, MPFR_RNDN);
        mpfr_log(r15486, r15485, MPFR_RNDN);
        return mpfr_get_d(r15486, MPFR_RNDN);
}

static mpfr_t r15487, r15488, r15489, r15490, r15491, r15492, r15493;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15487);
        mpfr_init(r15488);
        mpfr_init(r15489);
        mpfr_init(r15490);
        mpfr_init(r15491);
        mpfr_init(r15492);
        mpfr_init(r15493);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15487, a, MPFR_RNDN);
        mpfr_set_d(r15488, c, MPFR_RNDN);
        mpfr_atan2(r15489, r15487, r15488, MPFR_RNDN);
        mpfr_atan2(r15490, r15489, r15487, MPFR_RNDN);
        mpfr_exp(r15491, r15490, MPFR_RNDN);
        mpfr_div(r15492, r15491, r15487, MPFR_RNDN);
        mpfr_log(r15493, r15492, MPFR_RNDN);
        return mpfr_get_d(r15493, MPFR_RNDN);
}

