#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 r15412 = a;
        float r15413 = c;
        float r15414 = atan2(r15412, r15413);
        float r15415 = atan2(r15414, r15412);
        float r15416 = log(r15412);
        float r15417 = r15415 - r15416;
        return r15417;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15418 = a;
        double r15419 = c;
        double r15420 = atan2(r15418, r15419);
        double r15421 = atan2(r15420, r15418);
        double r15422 = log(r15418);
        double r15423 = r15421 - r15422;
        return r15423;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15424 = a;
        float r15425 = c;
        float r15426 = atan2(r15424, r15425);
        float r15427 = atan2(r15426, r15424);
        float r15428 = exp(r15427);
        float r15429 = log(r15428);
        float r15430 = log(r15424);
        float r15431 = r15429 - r15430;
        return r15431;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15432 = a;
        double r15433 = c;
        double r15434 = atan2(r15432, r15433);
        double r15435 = atan2(r15434, r15432);
        double r15436 = exp(r15435);
        double r15437 = log(r15436);
        double r15438 = log(r15432);
        double r15439 = r15437 - r15438;
        return r15439;
}

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 r15440, r15441, r15442, r15443, r15444, r15445;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15440);
        mpfr_init(r15441);
        mpfr_init(r15442);
        mpfr_init(r15443);
        mpfr_init(r15444);
        mpfr_init(r15445);
}

double f_im(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15440, a, MPFR_RNDN);
        mpfr_set_d(r15441, c, MPFR_RNDN);
        mpfr_atan2(r15442, r15440, r15441, MPFR_RNDN);
        mpfr_atan2(r15443, r15442, r15440, MPFR_RNDN);
        mpfr_log(r15444, r15440, MPFR_RNDN);
        mpfr_sub(r15445, r15443, r15444, MPFR_RNDN);
        return mpfr_get_d(r15445, MPFR_RNDN);
}

static mpfr_t r15446, r15447, r15448, r15449, r15450, r15451, r15452, r15453;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15446);
        mpfr_init(r15447);
        mpfr_init(r15448);
        mpfr_init(r15449);
        mpfr_init(r15450);
        mpfr_init(r15451);
        mpfr_init(r15452);
        mpfr_init(r15453);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15446, a, MPFR_RNDN);
        mpfr_set_d(r15447, c, MPFR_RNDN);
        mpfr_atan2(r15448, r15446, r15447, MPFR_RNDN);
        mpfr_atan2(r15449, r15448, r15446, MPFR_RNDN);
        mpfr_exp(r15450, r15449, MPFR_RNDN);
        mpfr_log(r15451, r15450, MPFR_RNDN);
        mpfr_log(r15452, r15446, MPFR_RNDN);
        mpfr_sub(r15453, r15451, r15452, MPFR_RNDN);
        return mpfr_get_d(r15453, MPFR_RNDN);
}

static mpfr_t r15454, r15455, r15456, r15457, r15458, r15459, r15460, r15461;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15454);
        mpfr_init(r15455);
        mpfr_init(r15456);
        mpfr_init(r15457);
        mpfr_init(r15458);
        mpfr_init(r15459);
        mpfr_init(r15460);
        mpfr_init(r15461);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15454, a, MPFR_RNDN);
        mpfr_set_d(r15455, c, MPFR_RNDN);
        mpfr_atan2(r15456, r15454, r15455, MPFR_RNDN);
        mpfr_atan2(r15457, r15456, r15454, MPFR_RNDN);
        mpfr_exp(r15458, r15457, MPFR_RNDN);
        mpfr_log(r15459, r15458, MPFR_RNDN);
        mpfr_log(r15460, r15454, MPFR_RNDN);
        mpfr_sub(r15461, r15459, r15460, MPFR_RNDN);
        return mpfr_get_d(r15461, MPFR_RNDN);
}

