#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 r15435 = a;
        float r15436 = c;
        float r15437 = atan2(r15435, r15436);
        float r15438 = atan2(r15437, r15435);
        float r15439 = log(r15435);
        float r15440 = r15438 - r15439;
        return r15440;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15441 = a;
        double r15442 = c;
        double r15443 = atan2(r15441, r15442);
        double r15444 = atan2(r15443, r15441);
        double r15445 = log(r15441);
        double r15446 = r15444 - r15445;
        return r15446;
}


double f_of(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 = exp(r15450);
        float r15452 = r15451 / r15447;
        float r15453 = log(r15452);
        return r15453;
}

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

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 r15461, r15462, r15463, r15464, r15465, r15466;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15461);
        mpfr_init(r15462);
        mpfr_init(r15463);
        mpfr_init(r15464);
        mpfr_init(r15465);
        mpfr_init(r15466);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15461, a, MPFR_RNDN);
        mpfr_set_d(r15462, c, MPFR_RNDN);
        mpfr_atan2(r15463, r15461, r15462, MPFR_RNDN);
        mpfr_atan2(r15464, r15463, r15461, MPFR_RNDN);
        mpfr_log(r15465, r15461, MPFR_RNDN);
        mpfr_sub(r15466, r15464, r15465, MPFR_RNDN);
        return mpfr_get_d(r15466, MPFR_RNDN);
}

static mpfr_t r15467, r15468, r15469, r15470, r15471, r15472, r15473;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15467);
        mpfr_init(r15468);
        mpfr_init(r15469);
        mpfr_init(r15470);
        mpfr_init(r15471);
        mpfr_init(r15472);
        mpfr_init(r15473);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15467, a, MPFR_RNDN);
        mpfr_set_d(r15468, c, MPFR_RNDN);
        mpfr_atan2(r15469, r15467, r15468, MPFR_RNDN);
        mpfr_atan2(r15470, r15469, r15467, MPFR_RNDN);
        mpfr_exp(r15471, r15470, MPFR_RNDN);
        mpfr_div(r15472, r15471, r15467, MPFR_RNDN);
        mpfr_log(r15473, r15472, MPFR_RNDN);
        return mpfr_get_d(r15473, MPFR_RNDN);
}

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15474);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
}

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

