#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 r15443 = a;
        float r15444 = c;
        float r15445 = atan2(r15443, r15444);
        float r15446 = atan2(r15445, r15443);
        float r15447 = log(r15443);
        float r15448 = r15446 - r15447;
        return r15448;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15449 = a;
        double r15450 = c;
        double r15451 = atan2(r15449, r15450);
        double r15452 = atan2(r15451, r15449);
        double r15453 = log(r15449);
        double r15454 = r15452 - r15453;
        return r15454;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15455 = a;
        float r15456 = c;
        float r15457 = atan2(r15455, r15456);
        float r15458 = atan2(r15457, r15455);
        float r15459 = exp(r15458);
        float r15460 = r15459 / r15455;
        float r15461 = log(r15460);
        return r15461;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15462 = a;
        double r15463 = c;
        double r15464 = atan2(r15462, r15463);
        double r15465 = atan2(r15464, r15462);
        double r15466 = exp(r15465);
        double r15467 = r15466 / r15462;
        double r15468 = log(r15467);
        return r15468;
}

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 r15469, r15470, r15471, r15472, r15473, r15474;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15469);
        mpfr_init(r15470);
        mpfr_init(r15471);
        mpfr_init(r15472);
        mpfr_init(r15473);
        mpfr_init(r15474);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15469, a, MPFR_RNDN);
        mpfr_set_d(r15470, c, MPFR_RNDN);
        mpfr_atan2(r15471, r15469, r15470, MPFR_RNDN);
        mpfr_atan2(r15472, r15471, r15469, MPFR_RNDN);
        mpfr_log(r15473, r15469, MPFR_RNDN);
        mpfr_sub(r15474, r15472, r15473, MPFR_RNDN);
        return mpfr_get_d(r15474, MPFR_RNDN);
}

static mpfr_t r15475, r15476, r15477, r15478, r15479, r15480, r15481;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
        mpfr_init(r15481);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15475, a, MPFR_RNDN);
        mpfr_set_d(r15476, c, MPFR_RNDN);
        mpfr_atan2(r15477, r15475, r15476, MPFR_RNDN);
        mpfr_atan2(r15478, r15477, r15475, MPFR_RNDN);
        mpfr_exp(r15479, r15478, MPFR_RNDN);
        mpfr_div(r15480, r15479, r15475, MPFR_RNDN);
        mpfr_log(r15481, r15480, MPFR_RNDN);
        return mpfr_get_d(r15481, MPFR_RNDN);
}

static mpfr_t r15482, r15483, r15484, r15485, r15486, r15487, r15488;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15482);
        mpfr_init(r15483);
        mpfr_init(r15484);
        mpfr_init(r15485);
        mpfr_init(r15486);
        mpfr_init(r15487);
        mpfr_init(r15488);
}

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

