#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 r15659 = d;
        float r15660 = log(r15659);
        float r15661 = c;
        float r15662 = fabs(r15661);
        float r15663 = r15660 + r15662;
        float r15664 = tan(r15659);
        float r15665 = r15663 * r15664;
        return r15665;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15666 = d;
        double r15667 = log(r15666);
        double r15668 = c;
        double r15669 = fabs(r15668);
        double r15670 = r15667 + r15669;
        double r15671 = tan(r15666);
        double r15672 = r15670 * r15671;
        return r15672;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15673 = d;
        float r15674 = log(r15673);
        float r15675 = c;
        float r15676 = fabs(r15675);
        float r15677 = r15674 + r15676;
        float r15678 = tan(r15673);
        float r15679 = r15677 * r15678;
        return r15679;
}

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

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 r15687, r15688, r15689, r15690, r15691, r15692, r15693;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15687);
        mpfr_init(r15688);
        mpfr_init(r15689);
        mpfr_init(r15690);
        mpfr_init(r15691);
        mpfr_init(r15692);
        mpfr_init(r15693);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15687, d, MPFR_RNDN);
        mpfr_log(r15688, r15687, MPFR_RNDN);
        mpfr_set_d(r15689, c, MPFR_RNDN);
        mpfr_abs(r15690, r15689, MPFR_RNDN);
        mpfr_add(r15691, r15688, r15690, MPFR_RNDN);
        mpfr_tan(r15692, r15687, MPFR_RNDN);
        mpfr_mul(r15693, r15691, r15692, MPFR_RNDN);
        return mpfr_get_d(r15693, MPFR_RNDN);
}

static mpfr_t r15694, r15695, r15696, r15697, r15698, r15699, r15700;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15694);
        mpfr_init(r15695);
        mpfr_init(r15696);
        mpfr_init(r15697);
        mpfr_init(r15698);
        mpfr_init(r15699);
        mpfr_init(r15700);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15694, d, MPFR_RNDN);
        mpfr_log(r15695, r15694, MPFR_RNDN);
        mpfr_set_d(r15696, c, MPFR_RNDN);
        mpfr_abs(r15697, r15696, MPFR_RNDN);
        mpfr_add(r15698, r15695, r15697, MPFR_RNDN);
        mpfr_tan(r15699, r15694, MPFR_RNDN);
        mpfr_mul(r15700, r15698, r15699, MPFR_RNDN);
        return mpfr_get_d(r15700, MPFR_RNDN);
}

static mpfr_t r15701, r15702, r15703, r15704, r15705, r15706, r15707;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15701);
        mpfr_init(r15702);
        mpfr_init(r15703);
        mpfr_init(r15704);
        mpfr_init(r15705);
        mpfr_init(r15706);
        mpfr_init(r15707);
}

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

