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

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15422 = a;
        double r15423 = c;
        double r15424 = atan2(r15422, r15423);
        double r15425 = atan2(r15424, r15422);
        double r15426 = log(r15422);
        double r15427 = r15425 - r15426;
        return r15427;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15428 = a;
        float r15429 = c;
        float r15430 = atan2(r15428, r15429);
        float r15431 = atan2(r15430, r15428);
        float r15432 = exp(r15431);
        float r15433 = r15432 / r15428;
        float r15434 = log(r15433);
        return r15434;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15435 = a;
        double r15436 = c;
        double r15437 = atan2(r15435, r15436);
        double r15438 = atan2(r15437, r15435);
        double r15439 = exp(r15438);
        double r15440 = r15439 / r15435;
        double r15441 = log(r15440);
        return r15441;
}

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 r15442, r15443, r15444, r15445, r15446, r15447;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15442);
        mpfr_init(r15443);
        mpfr_init(r15444);
        mpfr_init(r15445);
        mpfr_init(r15446);
        mpfr_init(r15447);
}

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

static mpfr_t r15448, r15449, r15450, r15451, r15452, r15453, r15454;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15448);
        mpfr_init(r15449);
        mpfr_init(r15450);
        mpfr_init(r15451);
        mpfr_init(r15452);
        mpfr_init(r15453);
        mpfr_init(r15454);
}

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

static mpfr_t r15455, r15456, r15457, r15458, r15459, r15460, r15461;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15455);
        mpfr_init(r15456);
        mpfr_init(r15457);
        mpfr_init(r15458);
        mpfr_init(r15459);
        mpfr_init(r15460);
        mpfr_init(r15461);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15455, a, MPFR_RNDN);
        mpfr_set_d(r15456, c, MPFR_RNDN);
        mpfr_atan2(r15457, r15455, r15456, MPFR_RNDN);
        mpfr_atan2(r15458, r15457, r15455, MPFR_RNDN);
        mpfr_exp(r15459, r15458, MPFR_RNDN);
        mpfr_div(r15460, r15459, r15455, MPFR_RNDN);
        mpfr_log(r15461, r15460, MPFR_RNDN);
        return mpfr_get_d(r15461, MPFR_RNDN);
}

