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

double f_id(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 = log(r15398);
        double r15403 = r15401 - r15402;
        return r15403;
}


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

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

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

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

double f_im(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_log(r15422, r15418, MPFR_RNDN);
        mpfr_sub(r15423, r15421, r15422, MPFR_RNDN);
        return mpfr_get_d(r15423, MPFR_RNDN);
}

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

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

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

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

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

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

