#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 r15391 = a;
        float r15392 = c;
        float r15393 = atan2(r15391, r15392);
        float r15394 = atan2(r15393, r15391);
        float r15395 = log(r15391);
        float r15396 = r15394 - r15395;
        return r15396;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15397 = a;
        double r15398 = c;
        double r15399 = atan2(r15397, r15398);
        double r15400 = atan2(r15399, r15397);
        double r15401 = log(r15397);
        double r15402 = r15400 - r15401;
        return r15402;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15403 = a;
        float r15404 = c;
        float r15405 = atan2(r15403, r15404);
        float r15406 = atan2(r15405, r15403);
        float r15407 = exp(r15406);
        float r15408 = r15407 / r15403;
        float r15409 = log(r15408);
        return r15409;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15410 = a;
        double r15411 = c;
        double r15412 = atan2(r15410, r15411);
        double r15413 = atan2(r15412, r15410);
        double r15414 = exp(r15413);
        double r15415 = r15414 / r15410;
        double r15416 = log(r15415);
        return r15416;
}

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 r15417, r15418, r15419, r15420, r15421, r15422;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15417);
        mpfr_init(r15418);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15417, a, MPFR_RNDN);
        mpfr_set_d(r15418, c, MPFR_RNDN);
        mpfr_atan2(r15419, r15417, r15418, MPFR_RNDN);
        mpfr_atan2(r15420, r15419, r15417, MPFR_RNDN);
        mpfr_log(r15421, r15417, MPFR_RNDN);
        mpfr_sub(r15422, r15420, r15421, MPFR_RNDN);
        return mpfr_get_d(r15422, MPFR_RNDN);
}

static mpfr_t r15423, r15424, r15425, r15426, r15427, r15428, r15429;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15423, a, MPFR_RNDN);
        mpfr_set_d(r15424, c, MPFR_RNDN);
        mpfr_atan2(r15425, r15423, r15424, MPFR_RNDN);
        mpfr_atan2(r15426, r15425, r15423, MPFR_RNDN);
        mpfr_exp(r15427, r15426, MPFR_RNDN);
        mpfr_div(r15428, r15427, r15423, MPFR_RNDN);
        mpfr_log(r15429, r15428, MPFR_RNDN);
        return mpfr_get_d(r15429, MPFR_RNDN);
}

static mpfr_t r15430, r15431, r15432, r15433, r15434, r15435, r15436;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
        mpfr_init(r15434);
        mpfr_init(r15435);
        mpfr_init(r15436);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15430, a, MPFR_RNDN);
        mpfr_set_d(r15431, c, MPFR_RNDN);
        mpfr_atan2(r15432, r15430, r15431, MPFR_RNDN);
        mpfr_atan2(r15433, r15432, r15430, MPFR_RNDN);
        mpfr_exp(r15434, r15433, MPFR_RNDN);
        mpfr_div(r15435, r15434, r15430, MPFR_RNDN);
        mpfr_log(r15436, r15435, MPFR_RNDN);
        return mpfr_get_d(r15436, MPFR_RNDN);
}

