#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 r15671 = d;
        float r15672 = log(r15671);
        float r15673 = c;
        float r15674 = fabs(r15673);
        float r15675 = r15672 + r15674;
        float r15676 = tan(r15671);
        float r15677 = r15675 * r15676;
        return r15677;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15678 = d;
        double r15679 = log(r15678);
        double r15680 = c;
        double r15681 = fabs(r15680);
        double r15682 = r15679 + r15681;
        double r15683 = tan(r15678);
        double r15684 = r15682 * r15683;
        return r15684;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15685 = d;
        float r15686 = log(r15685);
        float r15687 = c;
        float r15688 = fabs(r15687);
        float r15689 = r15686 + r15688;
        float r15690 = tan(r15685);
        float r15691 = r15689 * r15690;
        return r15691;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15692 = d;
        double r15693 = log(r15692);
        double r15694 = c;
        double r15695 = fabs(r15694);
        double r15696 = r15693 + r15695;
        double r15697 = tan(r15692);
        double r15698 = r15696 * r15697;
        return r15698;
}

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 r15699, r15700, r15701, r15702, r15703, r15704, r15705;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15699);
        mpfr_init(r15700);
        mpfr_init(r15701);
        mpfr_init(r15702);
        mpfr_init(r15703);
        mpfr_init(r15704);
        mpfr_init(r15705);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15699, d, MPFR_RNDN);
        mpfr_log(r15700, r15699, MPFR_RNDN);
        mpfr_set_d(r15701, c, MPFR_RNDN);
        mpfr_abs(r15702, r15701, MPFR_RNDN);
        mpfr_add(r15703, r15700, r15702, MPFR_RNDN);
        mpfr_tan(r15704, r15699, MPFR_RNDN);
        mpfr_mul(r15705, r15703, r15704, MPFR_RNDN);
        return mpfr_get_d(r15705, MPFR_RNDN);
}

static mpfr_t r15706, r15707, r15708, r15709, r15710, r15711, r15712;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15706);
        mpfr_init(r15707);
        mpfr_init(r15708);
        mpfr_init(r15709);
        mpfr_init(r15710);
        mpfr_init(r15711);
        mpfr_init(r15712);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15706, d, MPFR_RNDN);
        mpfr_log(r15707, r15706, MPFR_RNDN);
        mpfr_set_d(r15708, c, MPFR_RNDN);
        mpfr_abs(r15709, r15708, MPFR_RNDN);
        mpfr_add(r15710, r15707, r15709, MPFR_RNDN);
        mpfr_tan(r15711, r15706, MPFR_RNDN);
        mpfr_mul(r15712, r15710, r15711, MPFR_RNDN);
        return mpfr_get_d(r15712, MPFR_RNDN);
}

static mpfr_t r15713, r15714, r15715, r15716, r15717, r15718, r15719;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15713);
        mpfr_init(r15714);
        mpfr_init(r15715);
        mpfr_init(r15716);
        mpfr_init(r15717);
        mpfr_init(r15718);
        mpfr_init(r15719);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15713, d, MPFR_RNDN);
        mpfr_log(r15714, r15713, MPFR_RNDN);
        mpfr_set_d(r15715, c, MPFR_RNDN);
        mpfr_abs(r15716, r15715, MPFR_RNDN);
        mpfr_add(r15717, r15714, r15716, MPFR_RNDN);
        mpfr_tan(r15718, r15713, MPFR_RNDN);
        mpfr_mul(r15719, r15717, r15718, MPFR_RNDN);
        return mpfr_get_d(r15719, MPFR_RNDN);
}

