#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(* (+ (log d) (fabs c)) (tan d))";

double f_if(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15538 = d;
        float r15539 = log(r15538);
        float r15540 = c;
        float r15541 = fabs(r15540);
        float r15542 = r15539 + r15541;
        float r15543 = tan(r15538);
        float r15544 = r15542 * r15543;
        return r15544;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15545 = d;
        double r15546 = log(r15545);
        double r15547 = c;
        double r15548 = fabs(r15547);
        double r15549 = r15546 + r15548;
        double r15550 = tan(r15545);
        double r15551 = r15549 * r15550;
        return r15551;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15552 = d;
        float r15553 = log(r15552);
        float r15554 = c;
        float r15555 = fabs(r15554);
        float r15556 = r15553 + r15555;
        float r15557 = tan(r15552);
        float r15558 = r15556 * r15557;
        return r15558;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15559 = d;
        double r15560 = log(r15559);
        double r15561 = c;
        double r15562 = fabs(r15561);
        double r15563 = r15560 + r15562;
        double r15564 = tan(r15559);
        double r15565 = r15563 * r15564;
        return r15565;
}

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 r15566, r15567, r15568, r15569, r15570, r15571, r15572;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15566);
        mpfr_init(r15567);
        mpfr_init(r15568);
        mpfr_init(r15569);
        mpfr_init(r15570);
        mpfr_init(r15571);
        mpfr_init(r15572);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15566, d, MPFR_RNDN);
        mpfr_log(r15567, r15566, MPFR_RNDN);
        mpfr_set_d(r15568, c, MPFR_RNDN);
        mpfr_abs(r15569, r15568, MPFR_RNDN);
        mpfr_add(r15570, r15567, r15569, MPFR_RNDN);
        mpfr_tan(r15571, r15566, MPFR_RNDN);
        mpfr_mul(r15572, r15570, r15571, MPFR_RNDN);
        return mpfr_get_d(r15572, MPFR_RNDN);
}

static mpfr_t r15573, r15574, r15575, r15576, r15577, r15578, r15579;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15573);
        mpfr_init(r15574);
        mpfr_init(r15575);
        mpfr_init(r15576);
        mpfr_init(r15577);
        mpfr_init(r15578);
        mpfr_init(r15579);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15573, d, MPFR_RNDN);
        mpfr_log(r15574, r15573, MPFR_RNDN);
        mpfr_set_d(r15575, c, MPFR_RNDN);
        mpfr_abs(r15576, r15575, MPFR_RNDN);
        mpfr_add(r15577, r15574, r15576, MPFR_RNDN);
        mpfr_tan(r15578, r15573, MPFR_RNDN);
        mpfr_mul(r15579, r15577, r15578, MPFR_RNDN);
        return mpfr_get_d(r15579, MPFR_RNDN);
}

static mpfr_t r15580, r15581, r15582, r15583, r15584, r15585, r15586;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15580);
        mpfr_init(r15581);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15580, d, MPFR_RNDN);
        mpfr_log(r15581, r15580, MPFR_RNDN);
        mpfr_set_d(r15582, c, MPFR_RNDN);
        mpfr_abs(r15583, r15582, MPFR_RNDN);
        mpfr_add(r15584, r15581, r15583, MPFR_RNDN);
        mpfr_tan(r15585, r15580, MPFR_RNDN);
        mpfr_mul(r15586, r15584, r15585, MPFR_RNDN);
        return mpfr_get_d(r15586, MPFR_RNDN);
}

