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

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


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

double f_od(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 = exp(r15453);
        double r15455 = r15454 / r15450;
        double r15456 = log(r15455);
        return r15456;
}

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

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

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

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

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

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

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

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

double f_dm(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_exp(r15474, r15473, MPFR_RNDN);
        mpfr_div(r15475, r15474, r15470, MPFR_RNDN);
        mpfr_log(r15476, r15475, MPFR_RNDN);
        return mpfr_get_d(r15476, MPFR_RNDN);
}

