#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 r15403 = a;
        float r15404 = c;
        float r15405 = atan2(r15403, r15404);
        float r15406 = atan2(r15405, r15403);
        float r15407 = log(r15403);
        float r15408 = r15406 - r15407;
        return r15408;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15409 = a;
        double r15410 = c;
        double r15411 = atan2(r15409, r15410);
        double r15412 = atan2(r15411, r15409);
        double r15413 = log(r15409);
        double r15414 = r15412 - r15413;
        return r15414;
}


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

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15422 = a;
        double r15423 = c;
        double r15424 = atan2(r15422, r15423);
        double r15425 = atan2(r15424, r15422);
        double r15426 = exp(r15425);
        double r15427 = r15426 / r15422;
        double r15428 = log(r15427);
        return r15428;
}

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 r15429, r15430, r15431, r15432, r15433, r15434;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15429);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
        mpfr_init(r15434);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15429, a, MPFR_RNDN);
        mpfr_set_d(r15430, c, MPFR_RNDN);
        mpfr_atan2(r15431, r15429, r15430, MPFR_RNDN);
        mpfr_atan2(r15432, r15431, r15429, MPFR_RNDN);
        mpfr_log(r15433, r15429, MPFR_RNDN);
        mpfr_sub(r15434, r15432, r15433, MPFR_RNDN);
        return mpfr_get_d(r15434, MPFR_RNDN);
}

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

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15435);
        mpfr_init(r15436);
        mpfr_init(r15437);
        mpfr_init(r15438);
        mpfr_init(r15439);
        mpfr_init(r15440);
        mpfr_init(r15441);
}

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

static mpfr_t r15442, r15443, r15444, r15445, r15446, r15447, r15448;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15442);
        mpfr_init(r15443);
        mpfr_init(r15444);
        mpfr_init(r15445);
        mpfr_init(r15446);
        mpfr_init(r15447);
        mpfr_init(r15448);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15442, a, MPFR_RNDN);
        mpfr_set_d(r15443, c, MPFR_RNDN);
        mpfr_atan2(r15444, r15442, r15443, MPFR_RNDN);
        mpfr_atan2(r15445, r15444, r15442, MPFR_RNDN);
        mpfr_exp(r15446, r15445, MPFR_RNDN);
        mpfr_div(r15447, r15446, r15442, MPFR_RNDN);
        mpfr_log(r15448, r15447, MPFR_RNDN);
        return mpfr_get_d(r15448, MPFR_RNDN);
}

