#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 r15551 = d;
        float r15552 = log(r15551);
        float r15553 = c;
        float r15554 = fabs(r15553);
        float r15555 = r15552 + r15554;
        float r15556 = tan(r15551);
        float r15557 = r15555 * r15556;
        return r15557;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15558 = d;
        double r15559 = log(r15558);
        double r15560 = c;
        double r15561 = fabs(r15560);
        double r15562 = r15559 + r15561;
        double r15563 = tan(r15558);
        double r15564 = r15562 * r15563;
        return r15564;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15565 = d;
        float r15566 = log(r15565);
        float r15567 = c;
        float r15568 = fabs(r15567);
        float r15569 = r15566 + r15568;
        float r15570 = tan(r15565);
        float r15571 = r15569 * r15570;
        return r15571;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15572 = d;
        double r15573 = log(r15572);
        double r15574 = c;
        double r15575 = fabs(r15574);
        double r15576 = r15573 + r15575;
        double r15577 = tan(r15572);
        double r15578 = r15576 * r15577;
        return r15578;
}

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 r15579, r15580, r15581, r15582, r15583, r15584, r15585;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15579);
        mpfr_init(r15580);
        mpfr_init(r15581);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15579, d, MPFR_RNDN);
        mpfr_log(r15580, r15579, MPFR_RNDN);
        mpfr_set_d(r15581, c, MPFR_RNDN);
        mpfr_abs(r15582, r15581, MPFR_RNDN);
        mpfr_add(r15583, r15580, r15582, MPFR_RNDN);
        mpfr_tan(r15584, r15579, MPFR_RNDN);
        mpfr_mul(r15585, r15583, r15584, MPFR_RNDN);
        return mpfr_get_d(r15585, MPFR_RNDN);
}

static mpfr_t r15586, r15587, r15588, r15589, r15590, r15591, r15592;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15586);
        mpfr_init(r15587);
        mpfr_init(r15588);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15586, d, MPFR_RNDN);
        mpfr_log(r15587, r15586, MPFR_RNDN);
        mpfr_set_d(r15588, c, MPFR_RNDN);
        mpfr_abs(r15589, r15588, MPFR_RNDN);
        mpfr_add(r15590, r15587, r15589, MPFR_RNDN);
        mpfr_tan(r15591, r15586, MPFR_RNDN);
        mpfr_mul(r15592, r15590, r15591, MPFR_RNDN);
        return mpfr_get_d(r15592, MPFR_RNDN);
}

static mpfr_t r15593, r15594, r15595, r15596, r15597, r15598, r15599;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15593);
        mpfr_init(r15594);
        mpfr_init(r15595);
        mpfr_init(r15596);
        mpfr_init(r15597);
        mpfr_init(r15598);
        mpfr_init(r15599);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15593, d, MPFR_RNDN);
        mpfr_log(r15594, r15593, MPFR_RNDN);
        mpfr_set_d(r15595, c, MPFR_RNDN);
        mpfr_abs(r15596, r15595, MPFR_RNDN);
        mpfr_add(r15597, r15594, r15596, MPFR_RNDN);
        mpfr_tan(r15598, r15593, MPFR_RNDN);
        mpfr_mul(r15599, r15597, r15598, MPFR_RNDN);
        return mpfr_get_d(r15599, MPFR_RNDN);
}

