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

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


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

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

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

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

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

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

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

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

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

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

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

