#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 r15383 = a;
        float r15384 = c;
        float r15385 = atan2(r15383, r15384);
        float r15386 = atan2(r15385, r15383);
        float r15387 = log(r15383);
        float r15388 = r15386 - r15387;
        return r15388;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15389 = a;
        double r15390 = c;
        double r15391 = atan2(r15389, r15390);
        double r15392 = atan2(r15391, r15389);
        double r15393 = log(r15389);
        double r15394 = r15392 - r15393;
        return r15394;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15395 = a;
        float r15396 = c;
        float r15397 = atan2(r15395, r15396);
        float r15398 = atan2(r15397, r15395);
        float r15399 = exp(r15398);
        float r15400 = r15399 / r15395;
        float r15401 = log(r15400);
        return r15401;
}

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

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 r15409, r15410, r15411, r15412, r15413, r15414;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15409);
        mpfr_init(r15410);
        mpfr_init(r15411);
        mpfr_init(r15412);
        mpfr_init(r15413);
        mpfr_init(r15414);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15409, a, MPFR_RNDN);
        mpfr_set_d(r15410, c, MPFR_RNDN);
        mpfr_atan2(r15411, r15409, r15410, MPFR_RNDN);
        mpfr_atan2(r15412, r15411, r15409, MPFR_RNDN);
        mpfr_log(r15413, r15409, MPFR_RNDN);
        mpfr_sub(r15414, r15412, r15413, MPFR_RNDN);
        return mpfr_get_d(r15414, MPFR_RNDN);
}

static mpfr_t r15415, r15416, r15417, r15418, r15419, r15420, r15421;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
        mpfr_init(r15418);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15415, a, MPFR_RNDN);
        mpfr_set_d(r15416, c, MPFR_RNDN);
        mpfr_atan2(r15417, r15415, r15416, MPFR_RNDN);
        mpfr_atan2(r15418, r15417, r15415, MPFR_RNDN);
        mpfr_exp(r15419, r15418, MPFR_RNDN);
        mpfr_div(r15420, r15419, r15415, MPFR_RNDN);
        mpfr_log(r15421, r15420, MPFR_RNDN);
        return mpfr_get_d(r15421, MPFR_RNDN);
}

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

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
        mpfr_init(r15427);
        mpfr_init(r15428);
}

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

