#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 r15336 = a;
        float r15337 = c;
        float r15338 = atan2(r15336, r15337);
        float r15339 = atan2(r15338, r15336);
        float r15340 = log(r15336);
        float r15341 = r15339 - r15340;
        return r15341;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15342 = a;
        double r15343 = c;
        double r15344 = atan2(r15342, r15343);
        double r15345 = atan2(r15344, r15342);
        double r15346 = log(r15342);
        double r15347 = r15345 - r15346;
        return r15347;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15348 = a;
        float r15349 = c;
        float r15350 = atan2(r15348, r15349);
        float r15351 = atan2(r15350, r15348);
        float r15352 = exp(r15351);
        float r15353 = log(r15352);
        float r15354 = log(r15348);
        float r15355 = r15353 - r15354;
        return r15355;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15356 = a;
        double r15357 = c;
        double r15358 = atan2(r15356, r15357);
        double r15359 = atan2(r15358, r15356);
        double r15360 = exp(r15359);
        double r15361 = log(r15360);
        double r15362 = log(r15356);
        double r15363 = r15361 - r15362;
        return r15363;
}

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 r15364, r15365, r15366, r15367, r15368, r15369;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15364);
        mpfr_init(r15365);
        mpfr_init(r15366);
        mpfr_init(r15367);
        mpfr_init(r15368);
        mpfr_init(r15369);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15364, a, MPFR_RNDN);
        mpfr_set_d(r15365, c, MPFR_RNDN);
        mpfr_atan2(r15366, r15364, r15365, MPFR_RNDN);
        mpfr_atan2(r15367, r15366, r15364, MPFR_RNDN);
        mpfr_log(r15368, r15364, MPFR_RNDN);
        mpfr_sub(r15369, r15367, r15368, MPFR_RNDN);
        return mpfr_get_d(r15369, MPFR_RNDN);
}

static mpfr_t r15370, r15371, r15372, r15373, r15374, r15375, r15376, r15377;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15370);
        mpfr_init(r15371);
        mpfr_init(r15372);
        mpfr_init(r15373);
        mpfr_init(r15374);
        mpfr_init(r15375);
        mpfr_init(r15376);
        mpfr_init(r15377);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15370, a, MPFR_RNDN);
        mpfr_set_d(r15371, c, MPFR_RNDN);
        mpfr_atan2(r15372, r15370, r15371, MPFR_RNDN);
        mpfr_atan2(r15373, r15372, r15370, MPFR_RNDN);
        mpfr_exp(r15374, r15373, MPFR_RNDN);
        mpfr_log(r15375, r15374, MPFR_RNDN);
        mpfr_log(r15376, r15370, MPFR_RNDN);
        mpfr_sub(r15377, r15375, r15376, MPFR_RNDN);
        return mpfr_get_d(r15377, MPFR_RNDN);
}

static mpfr_t r15378, r15379, r15380, r15381, r15382, r15383, r15384, r15385;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15378);
        mpfr_init(r15379);
        mpfr_init(r15380);
        mpfr_init(r15381);
        mpfr_init(r15382);
        mpfr_init(r15383);
        mpfr_init(r15384);
        mpfr_init(r15385);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15378, a, MPFR_RNDN);
        mpfr_set_d(r15379, c, MPFR_RNDN);
        mpfr_atan2(r15380, r15378, r15379, MPFR_RNDN);
        mpfr_atan2(r15381, r15380, r15378, MPFR_RNDN);
        mpfr_exp(r15382, r15381, MPFR_RNDN);
        mpfr_log(r15383, r15382, MPFR_RNDN);
        mpfr_log(r15384, r15378, MPFR_RNDN);
        mpfr_sub(r15385, r15383, r15384, MPFR_RNDN);
        return mpfr_get_d(r15385, MPFR_RNDN);
}

