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

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15438 = a;
        double r15439 = c;
        double r15440 = atan2(r15438, r15439);
        double r15441 = atan2(r15440, r15438);
        double r15442 = log(r15438);
        double r15443 = r15441 - r15442;
        return r15443;
}


double f_of(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 = exp(r15447);
        float r15449 = r15448 / r15444;
        float r15450 = log(r15449);
        return r15450;
}

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

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 r15458, r15459, r15460, r15461, r15462, r15463;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15458);
        mpfr_init(r15459);
        mpfr_init(r15460);
        mpfr_init(r15461);
        mpfr_init(r15462);
        mpfr_init(r15463);
}

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

static mpfr_t r15464, r15465, r15466, r15467, r15468, r15469, r15470;

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

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

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

void setup_mpfr_f_dm() {
        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_dm(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);
}

