#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 r15395 = a;
        float r15396 = c;
        float r15397 = atan2(r15395, r15396);
        float r15398 = atan2(r15397, r15395);
        float r15399 = log(r15395);
        float r15400 = r15398 - r15399;
        return r15400;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15401 = a;
        double r15402 = c;
        double r15403 = atan2(r15401, r15402);
        double r15404 = atan2(r15403, r15401);
        double r15405 = log(r15401);
        double r15406 = r15404 - r15405;
        return r15406;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15407 = a;
        float r15408 = c;
        float r15409 = atan2(r15407, r15408);
        float r15410 = atan2(r15409, r15407);
        float r15411 = exp(r15410);
        float r15412 = r15411 / r15407;
        float r15413 = log(r15412);
        return r15413;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15414 = a;
        double r15415 = c;
        double r15416 = atan2(r15414, r15415);
        double r15417 = atan2(r15416, r15414);
        double r15418 = exp(r15417);
        double r15419 = r15418 / r15414;
        double r15420 = log(r15419);
        return r15420;
}

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 r15421, r15422, r15423, r15424, r15425, r15426;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15421);
        mpfr_init(r15422);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15421, a, MPFR_RNDN);
        mpfr_set_d(r15422, c, MPFR_RNDN);
        mpfr_atan2(r15423, r15421, r15422, MPFR_RNDN);
        mpfr_atan2(r15424, r15423, r15421, MPFR_RNDN);
        mpfr_log(r15425, r15421, MPFR_RNDN);
        mpfr_sub(r15426, r15424, r15425, MPFR_RNDN);
        return mpfr_get_d(r15426, MPFR_RNDN);
}

static mpfr_t r15427, r15428, r15429, r15430, r15431, r15432, r15433;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15427, a, MPFR_RNDN);
        mpfr_set_d(r15428, c, MPFR_RNDN);
        mpfr_atan2(r15429, r15427, r15428, MPFR_RNDN);
        mpfr_atan2(r15430, r15429, r15427, MPFR_RNDN);
        mpfr_exp(r15431, r15430, MPFR_RNDN);
        mpfr_div(r15432, r15431, r15427, MPFR_RNDN);
        mpfr_log(r15433, r15432, MPFR_RNDN);
        return mpfr_get_d(r15433, MPFR_RNDN);
}

static mpfr_t r15434, r15435, r15436, r15437, r15438, r15439, r15440;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15434);
        mpfr_init(r15435);
        mpfr_init(r15436);
        mpfr_init(r15437);
        mpfr_init(r15438);
        mpfr_init(r15439);
        mpfr_init(r15440);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15434, a, MPFR_RNDN);
        mpfr_set_d(r15435, c, MPFR_RNDN);
        mpfr_atan2(r15436, r15434, r15435, MPFR_RNDN);
        mpfr_atan2(r15437, r15436, r15434, MPFR_RNDN);
        mpfr_exp(r15438, r15437, MPFR_RNDN);
        mpfr_div(r15439, r15438, r15434, MPFR_RNDN);
        mpfr_log(r15440, r15439, MPFR_RNDN);
        return mpfr_get_d(r15440, MPFR_RNDN);
}

