#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 r15626 = d;
        float r15627 = log(r15626);
        float r15628 = c;
        float r15629 = fabs(r15628);
        float r15630 = r15627 + r15629;
        float r15631 = tan(r15626);
        float r15632 = r15630 * r15631;
        return r15632;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15633 = d;
        double r15634 = log(r15633);
        double r15635 = c;
        double r15636 = fabs(r15635);
        double r15637 = r15634 + r15636;
        double r15638 = tan(r15633);
        double r15639 = r15637 * r15638;
        return r15639;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15640 = d;
        float r15641 = log(r15640);
        float r15642 = c;
        float r15643 = fabs(r15642);
        float r15644 = r15641 + r15643;
        float r15645 = tan(r15640);
        float r15646 = r15644 * r15645;
        return r15646;
}

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

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 r15654, r15655, r15656, r15657, r15658, r15659, r15660;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15654);
        mpfr_init(r15655);
        mpfr_init(r15656);
        mpfr_init(r15657);
        mpfr_init(r15658);
        mpfr_init(r15659);
        mpfr_init(r15660);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15654, d, MPFR_RNDN);
        mpfr_log(r15655, r15654, MPFR_RNDN);
        mpfr_set_d(r15656, c, MPFR_RNDN);
        mpfr_abs(r15657, r15656, MPFR_RNDN);
        mpfr_add(r15658, r15655, r15657, MPFR_RNDN);
        mpfr_tan(r15659, r15654, MPFR_RNDN);
        mpfr_mul(r15660, r15658, r15659, MPFR_RNDN);
        return mpfr_get_d(r15660, MPFR_RNDN);
}

static mpfr_t r15661, r15662, r15663, r15664, r15665, r15666, r15667;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15661);
        mpfr_init(r15662);
        mpfr_init(r15663);
        mpfr_init(r15664);
        mpfr_init(r15665);
        mpfr_init(r15666);
        mpfr_init(r15667);
}

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

static mpfr_t r15668, r15669, r15670, r15671, r15672, r15673, r15674;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15668);
        mpfr_init(r15669);
        mpfr_init(r15670);
        mpfr_init(r15671);
        mpfr_init(r15672);
        mpfr_init(r15673);
        mpfr_init(r15674);
}

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

