#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 r15379 = a;
        float r15380 = c;
        float r15381 = atan2(r15379, r15380);
        float r15382 = atan2(r15381, r15379);
        float r15383 = log(r15379);
        float r15384 = r15382 - r15383;
        return r15384;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15385 = a;
        double r15386 = c;
        double r15387 = atan2(r15385, r15386);
        double r15388 = atan2(r15387, r15385);
        double r15389 = log(r15385);
        double r15390 = r15388 - r15389;
        return r15390;
}


double f_of(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 = exp(r15394);
        float r15396 = r15395 / r15391;
        float r15397 = log(r15396);
        return r15397;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15398 = a;
        double r15399 = c;
        double r15400 = atan2(r15398, r15399);
        double r15401 = atan2(r15400, r15398);
        double r15402 = exp(r15401);
        double r15403 = r15402 / r15398;
        double r15404 = log(r15403);
        return r15404;
}

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 r15405, r15406, r15407, r15408, r15409, r15410;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
        mpfr_init(r15410);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15405, a, MPFR_RNDN);
        mpfr_set_d(r15406, c, MPFR_RNDN);
        mpfr_atan2(r15407, r15405, r15406, MPFR_RNDN);
        mpfr_atan2(r15408, r15407, r15405, MPFR_RNDN);
        mpfr_log(r15409, r15405, MPFR_RNDN);
        mpfr_sub(r15410, r15408, r15409, MPFR_RNDN);
        return mpfr_get_d(r15410, MPFR_RNDN);
}

static mpfr_t r15411, r15412, r15413, r15414, r15415, r15416, r15417;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15411, a, MPFR_RNDN);
        mpfr_set_d(r15412, c, MPFR_RNDN);
        mpfr_atan2(r15413, r15411, r15412, MPFR_RNDN);
        mpfr_atan2(r15414, r15413, r15411, MPFR_RNDN);
        mpfr_exp(r15415, r15414, MPFR_RNDN);
        mpfr_div(r15416, r15415, r15411, MPFR_RNDN);
        mpfr_log(r15417, r15416, MPFR_RNDN);
        return mpfr_get_d(r15417, MPFR_RNDN);
}

static mpfr_t r15418, r15419, r15420, r15421, r15422, r15423, r15424;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15418);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15418, a, MPFR_RNDN);
        mpfr_set_d(r15419, c, MPFR_RNDN);
        mpfr_atan2(r15420, r15418, r15419, MPFR_RNDN);
        mpfr_atan2(r15421, r15420, r15418, MPFR_RNDN);
        mpfr_exp(r15422, r15421, MPFR_RNDN);
        mpfr_div(r15423, r15422, r15418, MPFR_RNDN);
        mpfr_log(r15424, r15423, MPFR_RNDN);
        return mpfr_get_d(r15424, MPFR_RNDN);
}

