#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 r15380 = a;
        float r15381 = c;
        float r15382 = atan2(r15380, r15381);
        float r15383 = atan2(r15382, r15380);
        float r15384 = log(r15380);
        float r15385 = r15383 - r15384;
        return r15385;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15386 = a;
        double r15387 = c;
        double r15388 = atan2(r15386, r15387);
        double r15389 = atan2(r15388, r15386);
        double r15390 = log(r15386);
        double r15391 = r15389 - r15390;
        return r15391;
}


double f_of(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_od(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;
}

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 r15404, r15405, r15406, r15407, r15408, r15409;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15404);
        mpfr_init(r15405);
        mpfr_init(r15406);
        mpfr_init(r15407);
        mpfr_init(r15408);
        mpfr_init(r15409);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15404, a, MPFR_RNDN);
        mpfr_set_d(r15405, c, MPFR_RNDN);
        mpfr_atan2(r15406, r15404, r15405, MPFR_RNDN);
        mpfr_atan2(r15407, r15406, r15404, MPFR_RNDN);
        mpfr_log(r15408, r15404, MPFR_RNDN);
        mpfr_sub(r15409, r15407, r15408, MPFR_RNDN);
        return mpfr_get_d(r15409, MPFR_RNDN);
}

static mpfr_t r15410, r15411, r15412, r15413, r15414, r15415;

void setup_mpfr_f_fm() {
        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_fm(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;

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

double f_dm(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_log(r15420, r15416, MPFR_RNDN);
        mpfr_sub(r15421, r15419, r15420, MPFR_RNDN);
        return mpfr_get_d(r15421, MPFR_RNDN);
}

