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

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


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

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

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

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

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

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

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

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

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

void setup_mpfr_f_dm() {
        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_dm(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);
}

