#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 r15408 = a;
        float r15409 = c;
        float r15410 = atan2(r15408, r15409);
        float r15411 = atan2(r15410, r15408);
        float r15412 = log(r15408);
        float r15413 = r15411 - r15412;
        return r15413;
}

double f_id(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        double r15414 = a;
        double r15415 = c;
        double r15416 = atan2(r15414, r15415);
        double r15417 = atan2(r15416, r15414);
        double r15418 = log(r15414);
        double r15419 = r15417 - r15418;
        return r15419;
}


double f_of(float a, float __attribute__((unused)) b, float c, float __attribute__((unused)) d) {
        float r15420 = a;
        float r15421 = c;
        float r15422 = atan2(r15420, r15421);
        float r15423 = atan2(r15422, r15420);
        float r15424 = log(r15420);
        float r15425 = r15423 - r15424;
        float r15426 = r15425 * (r15425 * r15425);
        float r15427 = cbrt(r15426);
        return r15427;
}

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

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 r15436, r15437, r15438, r15439, r15440, r15441;

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

double f_im(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_log(r15440, r15436, MPFR_RNDN);
        mpfr_sub(r15441, r15439, r15440, MPFR_RNDN);
        return mpfr_get_d(r15441, MPFR_RNDN);
}

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

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

double f_fm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15442, a, MPFR_RNDN);
        mpfr_set_d(r15443, c, MPFR_RNDN);
        mpfr_atan2(r15444, r15442, r15443, MPFR_RNDN);
        mpfr_atan2(r15445, r15444, r15442, MPFR_RNDN);
        mpfr_log(r15446, r15442, MPFR_RNDN);
        mpfr_sub(r15447, r15445, r15446, MPFR_RNDN);
        mpfr_mul(r15448, r15447, r15447, MPFR_RNDN); mpfr_mul(r15448, r15448, r15447, MPFR_RNDN);
        mpfr_cbrt(r15449, r15448, MPFR_RNDN);
        return mpfr_get_d(r15449, MPFR_RNDN);
}

static mpfr_t r15450, r15451, r15452, r15453, r15454, r15455, r15456, r15457;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15450);
        mpfr_init(r15451);
        mpfr_init(r15452);
        mpfr_init(r15453);
        mpfr_init(r15454);
        mpfr_init(r15455);
        mpfr_init(r15456);
        mpfr_init(r15457);
}

double f_dm(double a, double __attribute__((unused)) b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15450, a, MPFR_RNDN);
        mpfr_set_d(r15451, c, MPFR_RNDN);
        mpfr_atan2(r15452, r15450, r15451, MPFR_RNDN);
        mpfr_atan2(r15453, r15452, r15450, MPFR_RNDN);
        mpfr_log(r15454, r15450, MPFR_RNDN);
        mpfr_sub(r15455, r15453, r15454, MPFR_RNDN);
        mpfr_mul(r15456, r15455, r15455, MPFR_RNDN); mpfr_mul(r15456, r15456, r15455, MPFR_RNDN);
        mpfr_cbrt(r15457, r15456, MPFR_RNDN);
        return mpfr_get_d(r15457, MPFR_RNDN);
}

