#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 r15639 = d;
        float r15640 = log(r15639);
        float r15641 = c;
        float r15642 = fabs(r15641);
        float r15643 = r15640 + r15642;
        float r15644 = tan(r15639);
        float r15645 = r15643 * r15644;
        return r15645;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15646 = d;
        double r15647 = log(r15646);
        double r15648 = c;
        double r15649 = fabs(r15648);
        double r15650 = r15647 + r15649;
        double r15651 = tan(r15646);
        double r15652 = r15650 * r15651;
        return r15652;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15653 = d;
        float r15654 = log(r15653);
        float r15655 = c;
        float r15656 = fabs(r15655);
        float r15657 = r15654 + r15656;
        float r15658 = tan(r15653);
        float r15659 = r15657 * r15658;
        return r15659;
}

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

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 r15667, r15668, r15669, r15670, r15671, r15672, r15673;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15667);
        mpfr_init(r15668);
        mpfr_init(r15669);
        mpfr_init(r15670);
        mpfr_init(r15671);
        mpfr_init(r15672);
        mpfr_init(r15673);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15667, d, MPFR_RNDN);
        mpfr_log(r15668, r15667, MPFR_RNDN);
        mpfr_set_d(r15669, c, MPFR_RNDN);
        mpfr_abs(r15670, r15669, MPFR_RNDN);
        mpfr_add(r15671, r15668, r15670, MPFR_RNDN);
        mpfr_tan(r15672, r15667, MPFR_RNDN);
        mpfr_mul(r15673, r15671, r15672, MPFR_RNDN);
        return mpfr_get_d(r15673, MPFR_RNDN);
}

static mpfr_t r15674, r15675, r15676, r15677, r15678, r15679, r15680;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15674);
        mpfr_init(r15675);
        mpfr_init(r15676);
        mpfr_init(r15677);
        mpfr_init(r15678);
        mpfr_init(r15679);
        mpfr_init(r15680);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15674, d, MPFR_RNDN);
        mpfr_log(r15675, r15674, MPFR_RNDN);
        mpfr_set_d(r15676, c, MPFR_RNDN);
        mpfr_abs(r15677, r15676, MPFR_RNDN);
        mpfr_add(r15678, r15675, r15677, MPFR_RNDN);
        mpfr_tan(r15679, r15674, MPFR_RNDN);
        mpfr_mul(r15680, r15678, r15679, MPFR_RNDN);
        return mpfr_get_d(r15680, MPFR_RNDN);
}

static mpfr_t r15681, r15682, r15683, r15684, r15685, r15686, r15687;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15681);
        mpfr_init(r15682);
        mpfr_init(r15683);
        mpfr_init(r15684);
        mpfr_init(r15685);
        mpfr_init(r15686);
        mpfr_init(r15687);
}

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

