#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 r15655 = d;
        float r15656 = log(r15655);
        float r15657 = c;
        float r15658 = fabs(r15657);
        float r15659 = r15656 + r15658;
        float r15660 = tan(r15655);
        float r15661 = r15659 * r15660;
        return r15661;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15662 = d;
        double r15663 = log(r15662);
        double r15664 = c;
        double r15665 = fabs(r15664);
        double r15666 = r15663 + r15665;
        double r15667 = tan(r15662);
        double r15668 = r15666 * r15667;
        return r15668;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15669 = d;
        float r15670 = log(r15669);
        float r15671 = c;
        float r15672 = fabs(r15671);
        float r15673 = r15670 + r15672;
        float r15674 = tan(r15669);
        float r15675 = r15673 * r15674;
        return r15675;
}

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

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 r15683, r15684, r15685, r15686, r15687, r15688, r15689;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15683);
        mpfr_init(r15684);
        mpfr_init(r15685);
        mpfr_init(r15686);
        mpfr_init(r15687);
        mpfr_init(r15688);
        mpfr_init(r15689);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15683, d, MPFR_RNDN);
        mpfr_log(r15684, r15683, MPFR_RNDN);
        mpfr_set_d(r15685, c, MPFR_RNDN);
        mpfr_abs(r15686, r15685, MPFR_RNDN);
        mpfr_add(r15687, r15684, r15686, MPFR_RNDN);
        mpfr_tan(r15688, r15683, MPFR_RNDN);
        mpfr_mul(r15689, r15687, r15688, MPFR_RNDN);
        return mpfr_get_d(r15689, MPFR_RNDN);
}

static mpfr_t r15690, r15691, r15692, r15693, r15694, r15695, r15696;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15690);
        mpfr_init(r15691);
        mpfr_init(r15692);
        mpfr_init(r15693);
        mpfr_init(r15694);
        mpfr_init(r15695);
        mpfr_init(r15696);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15690, d, MPFR_RNDN);
        mpfr_log(r15691, r15690, MPFR_RNDN);
        mpfr_set_d(r15692, c, MPFR_RNDN);
        mpfr_abs(r15693, r15692, MPFR_RNDN);
        mpfr_add(r15694, r15691, r15693, MPFR_RNDN);
        mpfr_tan(r15695, r15690, MPFR_RNDN);
        mpfr_mul(r15696, r15694, r15695, MPFR_RNDN);
        return mpfr_get_d(r15696, MPFR_RNDN);
}

static mpfr_t r15697, r15698, r15699, r15700, r15701, r15702, r15703;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15697);
        mpfr_init(r15698);
        mpfr_init(r15699);
        mpfr_init(r15700);
        mpfr_init(r15701);
        mpfr_init(r15702);
        mpfr_init(r15703);
}

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

