#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 r15419 = a;
        float r15420 = c;
        float r15421 = atan2(r15419, r15420);
        float r15422 = atan2(r15421, r15419);
        float r15423 = log(r15419);
        float r15424 = r15422 - r15423;
        return r15424;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15425 = a;
        double r15426 = c;
        double r15427 = atan2(r15425, r15426);
        double r15428 = atan2(r15427, r15425);
        double r15429 = log(r15425);
        double r15430 = r15428 - r15429;
        return r15430;
}


double f_of(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 = exp(r15434);
        float r15436 = r15435 / r15431;
        float r15437 = log(r15436);
        return r15437;
}

double f_od(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 = exp(r15441);
        double r15443 = r15442 / r15438;
        double r15444 = log(r15443);
        return r15444;
}

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 r15445, r15446, r15447, r15448, r15449, r15450;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15445);
        mpfr_init(r15446);
        mpfr_init(r15447);
        mpfr_init(r15448);
        mpfr_init(r15449);
        mpfr_init(r15450);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15445, a, MPFR_RNDN);
        mpfr_set_d(r15446, c, MPFR_RNDN);
        mpfr_atan2(r15447, r15445, r15446, MPFR_RNDN);
        mpfr_atan2(r15448, r15447, r15445, MPFR_RNDN);
        mpfr_log(r15449, r15445, MPFR_RNDN);
        mpfr_sub(r15450, r15448, r15449, MPFR_RNDN);
        return mpfr_get_d(r15450, MPFR_RNDN);
}

static mpfr_t r15451, r15452, r15453, r15454, r15455, r15456, r15457;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15451);
        mpfr_init(r15452);
        mpfr_init(r15453);
        mpfr_init(r15454);
        mpfr_init(r15455);
        mpfr_init(r15456);
        mpfr_init(r15457);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15451, a, MPFR_RNDN);
        mpfr_set_d(r15452, c, MPFR_RNDN);
        mpfr_atan2(r15453, r15451, r15452, MPFR_RNDN);
        mpfr_atan2(r15454, r15453, r15451, MPFR_RNDN);
        mpfr_exp(r15455, r15454, MPFR_RNDN);
        mpfr_div(r15456, r15455, r15451, MPFR_RNDN);
        mpfr_log(r15457, r15456, MPFR_RNDN);
        return mpfr_get_d(r15457, MPFR_RNDN);
}

static mpfr_t r15458, r15459, r15460, r15461, r15462, r15463, r15464;

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

double f_dm(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_exp(r15462, r15461, MPFR_RNDN);
        mpfr_div(r15463, r15462, r15458, MPFR_RNDN);
        mpfr_log(r15464, r15463, MPFR_RNDN);
        return mpfr_get_d(r15464, MPFR_RNDN);
}

