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

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


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

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

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

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

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

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

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

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

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

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

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

