#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 r15424 = a;
        float r15425 = c;
        float r15426 = atan2(r15424, r15425);
        float r15427 = atan2(r15426, r15424);
        float r15428 = log(r15424);
        float r15429 = r15427 - r15428;
        return r15429;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15430 = a;
        double r15431 = c;
        double r15432 = atan2(r15430, r15431);
        double r15433 = atan2(r15432, r15430);
        double r15434 = log(r15430);
        double r15435 = r15433 - r15434;
        return r15435;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15436 = a;
        float r15437 = c;
        float r15438 = atan2(r15436, r15437);
        float r15439 = atan2(r15438, r15436);
        float r15440 = sqrt(r15439);
        float r15441 = sqrt(r15440);
        float r15442 = r15441 * r15441;
        float r15443 = r15442 * r15442;
        float r15444 = log(r15436);
        float r15445 = r15443 - r15444;
        return r15445;
}

double f_od(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15446 = a;
        double r15447 = c;
        double r15448 = atan2(r15446, r15447);
        double r15449 = atan2(r15448, r15446);
        double r15450 = sqrt(r15449);
        double r15451 = sqrt(r15450);
        double r15452 = r15451 * r15451;
        double r15453 = r15452 * r15452;
        double r15454 = log(r15446);
        double r15455 = r15453 - r15454;
        return r15455;
}

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 r15456, r15457, r15458, r15459, r15460, r15461;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15456);
        mpfr_init(r15457);
        mpfr_init(r15458);
        mpfr_init(r15459);
        mpfr_init(r15460);
        mpfr_init(r15461);
}

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

static mpfr_t r15462, r15463, r15464, r15465, r15466, r15467, r15468, r15469, r15470, r15471;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15462);
        mpfr_init(r15463);
        mpfr_init(r15464);
        mpfr_init(r15465);
        mpfr_init(r15466);
        mpfr_init(r15467);
        mpfr_init(r15468);
        mpfr_init(r15469);
        mpfr_init(r15470);
        mpfr_init(r15471);
}

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15462, a, MPFR_RNDN);
        mpfr_set_d(r15463, c, MPFR_RNDN);
        mpfr_atan2(r15464, r15462, r15463, MPFR_RNDN);
        mpfr_atan2(r15465, r15464, r15462, MPFR_RNDN);
        mpfr_sqrt(r15466, r15465, MPFR_RNDN);
        mpfr_sqrt(r15467, r15466, MPFR_RNDN);
        mpfr_sqr(r15468, r15467, MPFR_RNDN);
        mpfr_sqr(r15469, r15468, MPFR_RNDN);
        mpfr_log(r15470, r15462, MPFR_RNDN);
        mpfr_sub(r15471, r15469, r15470, MPFR_RNDN);
        return mpfr_get_d(r15471, MPFR_RNDN);
}

static mpfr_t r15472, r15473, r15474, r15475, r15476, r15477, r15478, r15479, r15480, r15481;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15472);
        mpfr_init(r15473);
        mpfr_init(r15474);
        mpfr_init(r15475);
        mpfr_init(r15476);
        mpfr_init(r15477);
        mpfr_init(r15478);
        mpfr_init(r15479);
        mpfr_init(r15480);
        mpfr_init(r15481);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15472, a, MPFR_RNDN);
        mpfr_set_d(r15473, c, MPFR_RNDN);
        mpfr_atan2(r15474, r15472, r15473, MPFR_RNDN);
        mpfr_atan2(r15475, r15474, r15472, MPFR_RNDN);
        mpfr_sqrt(r15476, r15475, MPFR_RNDN);
        mpfr_sqrt(r15477, r15476, MPFR_RNDN);
        mpfr_sqr(r15478, r15477, MPFR_RNDN);
        mpfr_sqr(r15479, r15478, MPFR_RNDN);
        mpfr_log(r15480, r15472, MPFR_RNDN);
        mpfr_sub(r15481, r15479, r15480, MPFR_RNDN);
        return mpfr_get_d(r15481, MPFR_RNDN);
}

