#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 r15439 = a;
        float r15440 = c;
        float r15441 = atan2(r15439, r15440);
        float r15442 = atan2(r15441, r15439);
        float r15443 = log(r15439);
        float r15444 = r15442 - r15443;
        return r15444;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15445 = a;
        double r15446 = c;
        double r15447 = atan2(r15445, r15446);
        double r15448 = atan2(r15447, r15445);
        double r15449 = log(r15445);
        double r15450 = r15448 - r15449;
        return r15450;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15451 = a;
        float r15452 = c;
        float r15453 = atan2(r15451, r15452);
        float r15454 = atan2(r15453, r15451);
        float r15455 = exp(r15454);
        float r15456 = r15455 / r15451;
        float r15457 = log(r15456);
        return r15457;
}

double f_od(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 = exp(r15461);
        double r15463 = r15462 / r15458;
        double r15464 = log(r15463);
        return r15464;
}

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 r15465, r15466, r15467, r15468, r15469, r15470;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15465);
        mpfr_init(r15466);
        mpfr_init(r15467);
        mpfr_init(r15468);
        mpfr_init(r15469);
        mpfr_init(r15470);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15465, a, MPFR_RNDN);
        mpfr_set_d(r15466, c, MPFR_RNDN);
        mpfr_atan2(r15467, r15465, r15466, MPFR_RNDN);
        mpfr_atan2(r15468, r15467, r15465, MPFR_RNDN);
        mpfr_log(r15469, r15465, MPFR_RNDN);
        mpfr_sub(r15470, r15468, r15469, MPFR_RNDN);
        return mpfr_get_d(r15470, MPFR_RNDN);
}

static mpfr_t r15471, r15472, r15473, r15474, r15475, r15476, r15477;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15471);
        mpfr_init(r15472);
        mpfr_init(r15473);
        mpfr_init(r15474);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15471, a, MPFR_RNDN);
        mpfr_set_d(r15472, c, MPFR_RNDN);
        mpfr_atan2(r15473, r15471, r15472, MPFR_RNDN);
        mpfr_atan2(r15474, r15473, r15471, MPFR_RNDN);
        mpfr_exp(r15475, r15474, MPFR_RNDN);
        mpfr_div(r15476, r15475, r15471, MPFR_RNDN);
        mpfr_log(r15477, r15476, MPFR_RNDN);
        return mpfr_get_d(r15477, MPFR_RNDN);
}

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

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

double f_dm(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_exp(r15482, r15481, MPFR_RNDN);
        mpfr_div(r15483, r15482, r15478, MPFR_RNDN);
        mpfr_log(r15484, r15483, MPFR_RNDN);
        return mpfr_get_d(r15484, MPFR_RNDN);
}

