#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 r15546 = d;
        float r15547 = log(r15546);
        float r15548 = c;
        float r15549 = fabs(r15548);
        float r15550 = r15547 + r15549;
        float r15551 = tan(r15546);
        float r15552 = r15550 * r15551;
        return r15552;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15553 = d;
        double r15554 = log(r15553);
        double r15555 = c;
        double r15556 = fabs(r15555);
        double r15557 = r15554 + r15556;
        double r15558 = tan(r15553);
        double r15559 = r15557 * r15558;
        return r15559;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15560 = d;
        float r15561 = log(r15560);
        float r15562 = c;
        float r15563 = fabs(r15562);
        float r15564 = r15561 + r15563;
        float r15565 = tan(r15560);
        float r15566 = r15564 * r15565;
        return r15566;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15567 = d;
        double r15568 = log(r15567);
        double r15569 = c;
        double r15570 = fabs(r15569);
        double r15571 = r15568 + r15570;
        double r15572 = tan(r15567);
        double r15573 = r15571 * r15572;
        return r15573;
}

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 r15574, r15575, r15576, r15577, r15578, r15579, r15580;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15574);
        mpfr_init(r15575);
        mpfr_init(r15576);
        mpfr_init(r15577);
        mpfr_init(r15578);
        mpfr_init(r15579);
        mpfr_init(r15580);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15574, d, MPFR_RNDN);
        mpfr_log(r15575, r15574, MPFR_RNDN);
        mpfr_set_d(r15576, c, MPFR_RNDN);
        mpfr_abs(r15577, r15576, MPFR_RNDN);
        mpfr_add(r15578, r15575, r15577, MPFR_RNDN);
        mpfr_tan(r15579, r15574, MPFR_RNDN);
        mpfr_mul(r15580, r15578, r15579, MPFR_RNDN);
        return mpfr_get_d(r15580, MPFR_RNDN);
}

static mpfr_t r15581, r15582, r15583, r15584, r15585, r15586, r15587;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15581);
        mpfr_init(r15582);
        mpfr_init(r15583);
        mpfr_init(r15584);
        mpfr_init(r15585);
        mpfr_init(r15586);
        mpfr_init(r15587);
}

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

static mpfr_t r15588, r15589, r15590, r15591, r15592, r15593, r15594;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15588);
        mpfr_init(r15589);
        mpfr_init(r15590);
        mpfr_init(r15591);
        mpfr_init(r15592);
        mpfr_init(r15593);
        mpfr_init(r15594);
}

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

