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

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


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

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

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

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

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

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

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

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

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

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

