#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 r15635 = d;
        float r15636 = log(r15635);
        float r15637 = c;
        float r15638 = fabs(r15637);
        float r15639 = r15636 + r15638;
        float r15640 = tan(r15635);
        float r15641 = r15639 * r15640;
        return r15641;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15642 = d;
        double r15643 = log(r15642);
        double r15644 = c;
        double r15645 = fabs(r15644);
        double r15646 = r15643 + r15645;
        double r15647 = tan(r15642);
        double r15648 = r15646 * r15647;
        return r15648;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15649 = d;
        float r15650 = log(r15649);
        float r15651 = c;
        float r15652 = fabs(r15651);
        float r15653 = r15650 + r15652;
        float r15654 = tan(r15649);
        float r15655 = r15653 * r15654;
        return r15655;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15656 = d;
        double r15657 = log(r15656);
        double r15658 = c;
        double r15659 = fabs(r15658);
        double r15660 = r15657 + r15659;
        double r15661 = tan(r15656);
        double r15662 = r15660 * r15661;
        return r15662;
}

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 r15663, r15664, r15665, r15666, r15667, r15668, r15669;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15663);
        mpfr_init(r15664);
        mpfr_init(r15665);
        mpfr_init(r15666);
        mpfr_init(r15667);
        mpfr_init(r15668);
        mpfr_init(r15669);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15663, d, MPFR_RNDN);
        mpfr_log(r15664, r15663, MPFR_RNDN);
        mpfr_set_d(r15665, c, MPFR_RNDN);
        mpfr_abs(r15666, r15665, MPFR_RNDN);
        mpfr_add(r15667, r15664, r15666, MPFR_RNDN);
        mpfr_tan(r15668, r15663, MPFR_RNDN);
        mpfr_mul(r15669, r15667, r15668, MPFR_RNDN);
        return mpfr_get_d(r15669, MPFR_RNDN);
}

static mpfr_t r15670, r15671, r15672, r15673, r15674, r15675, r15676;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15670);
        mpfr_init(r15671);
        mpfr_init(r15672);
        mpfr_init(r15673);
        mpfr_init(r15674);
        mpfr_init(r15675);
        mpfr_init(r15676);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15670, d, MPFR_RNDN);
        mpfr_log(r15671, r15670, MPFR_RNDN);
        mpfr_set_d(r15672, c, MPFR_RNDN);
        mpfr_abs(r15673, r15672, MPFR_RNDN);
        mpfr_add(r15674, r15671, r15673, MPFR_RNDN);
        mpfr_tan(r15675, r15670, MPFR_RNDN);
        mpfr_mul(r15676, r15674, r15675, MPFR_RNDN);
        return mpfr_get_d(r15676, MPFR_RNDN);
}

static mpfr_t r15677, r15678, r15679, r15680, r15681, r15682, r15683;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15677);
        mpfr_init(r15678);
        mpfr_init(r15679);
        mpfr_init(r15680);
        mpfr_init(r15681);
        mpfr_init(r15682);
        mpfr_init(r15683);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15677, d, MPFR_RNDN);
        mpfr_log(r15678, r15677, MPFR_RNDN);
        mpfr_set_d(r15679, c, MPFR_RNDN);
        mpfr_abs(r15680, r15679, MPFR_RNDN);
        mpfr_add(r15681, r15678, r15680, MPFR_RNDN);
        mpfr_tan(r15682, r15677, MPFR_RNDN);
        mpfr_mul(r15683, r15681, r15682, MPFR_RNDN);
        return mpfr_get_d(r15683, MPFR_RNDN);
}

