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

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


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

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

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

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

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

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

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

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

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

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

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

