#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 r15452 = a;
        float r15453 = c;
        float r15454 = atan2(r15452, r15453);
        float r15455 = atan2(r15454, r15452);
        float r15456 = log(r15452);
        float r15457 = r15455 - r15456;
        return r15457;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15458 = a;
        double r15459 = c;
        double r15460 = atan2(r15458, r15459);
        double r15461 = atan2(r15460, r15458);
        double r15462 = log(r15458);
        double r15463 = r15461 - r15462;
        return r15463;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15464 = a;
        float r15465 = c;
        float r15466 = atan2(r15464, r15465);
        float r15467 = atan2(r15466, r15464);
        float r15468 = exp(r15467);
        float r15469 = r15468 / r15464;
        float r15470 = log(r15469);
        return r15470;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15471 = a;
        double r15472 = c;
        double r15473 = atan2(r15471, r15472);
        double r15474 = atan2(r15473, r15471);
        double r15475 = exp(r15474);
        double r15476 = r15475 / r15471;
        double r15477 = log(r15476);
        return r15477;
}

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 r15478, r15479, r15480, r15481, r15482, r15483;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
        mpfr_init(r15481);
        mpfr_init(r15482);
        mpfr_init(r15483);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15478, a, MPFR_RNDN);
        mpfr_set_d(r15479, c, MPFR_RNDN);
        mpfr_atan2(r15480, r15478, r15479, MPFR_RNDN);
        mpfr_atan2(r15481, r15480, r15478, MPFR_RNDN);
        mpfr_log(r15482, r15478, MPFR_RNDN);
        mpfr_sub(r15483, r15481, r15482, MPFR_RNDN);
        return mpfr_get_d(r15483, MPFR_RNDN);
}

static mpfr_t r15484, r15485, r15486, r15487, r15488, r15489, r15490;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
        mpfr_init(r15487);
        mpfr_init(r15488);
        mpfr_init(r15489);
        mpfr_init(r15490);
}

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

static mpfr_t r15491, r15492, r15493, r15494, r15495, r15496, r15497;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15491);
        mpfr_init(r15492);
        mpfr_init(r15493);
        mpfr_init(r15494);
        mpfr_init(r15495);
        mpfr_init(r15496);
        mpfr_init(r15497);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15491, a, MPFR_RNDN);
        mpfr_set_d(r15492, c, MPFR_RNDN);
        mpfr_atan2(r15493, r15491, r15492, MPFR_RNDN);
        mpfr_atan2(r15494, r15493, r15491, MPFR_RNDN);
        mpfr_exp(r15495, r15494, MPFR_RNDN);
        mpfr_div(r15496, r15495, r15491, MPFR_RNDN);
        mpfr_log(r15497, r15496, MPFR_RNDN);
        return mpfr_get_d(r15497, MPFR_RNDN);
}

