#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 r15875 = d;
        float r15876 = log(r15875);
        float r15877 = c;
        float r15878 = fabs(r15877);
        float r15879 = r15876 + r15878;
        float r15880 = tan(r15875);
        float r15881 = r15879 * r15880;
        return r15881;
}

double f_id(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15882 = d;
        double r15883 = log(r15882);
        double r15884 = c;
        double r15885 = fabs(r15884);
        double r15886 = r15883 + r15885;
        double r15887 = tan(r15882);
        double r15888 = r15886 * r15887;
        return r15888;
}


double f_of(float __attribute__((unused)) a, float __attribute__((unused)) b, float c, float d) {
        float r15889 = d;
        float r15890 = log(r15889);
        float r15891 = c;
        float r15892 = fabs(r15891);
        float r15893 = r15890 + r15892;
        float r15894 = tan(r15889);
        float r15895 = r15893 * r15894;
        return r15895;
}

double f_od(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        double r15896 = d;
        double r15897 = log(r15896);
        double r15898 = c;
        double r15899 = fabs(r15898);
        double r15900 = r15897 + r15899;
        double r15901 = tan(r15896);
        double r15902 = r15900 * r15901;
        return r15902;
}

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 r15903, r15904, r15905, r15906, r15907, r15908, r15909;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15903);
        mpfr_init(r15904);
        mpfr_init(r15905);
        mpfr_init(r15906);
        mpfr_init(r15907);
        mpfr_init(r15908);
        mpfr_init(r15909);
}

double f_im(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15903, d, MPFR_RNDN);
        mpfr_log(r15904, r15903, MPFR_RNDN);
        mpfr_set_d(r15905, c, MPFR_RNDN);
        mpfr_abs(r15906, r15905, MPFR_RNDN);
        mpfr_add(r15907, r15904, r15906, MPFR_RNDN);
        mpfr_tan(r15908, r15903, MPFR_RNDN);
        mpfr_mul(r15909, r15907, r15908, MPFR_RNDN);
        return mpfr_get_d(r15909, MPFR_RNDN);
}

static mpfr_t r15910, r15911, r15912, r15913, r15914, r15915, r15916;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15910);
        mpfr_init(r15911);
        mpfr_init(r15912);
        mpfr_init(r15913);
        mpfr_init(r15914);
        mpfr_init(r15915);
        mpfr_init(r15916);
}

double f_fm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15910, d, MPFR_RNDN);
        mpfr_log(r15911, r15910, MPFR_RNDN);
        mpfr_set_d(r15912, c, MPFR_RNDN);
        mpfr_abs(r15913, r15912, MPFR_RNDN);
        mpfr_add(r15914, r15911, r15913, MPFR_RNDN);
        mpfr_tan(r15915, r15910, MPFR_RNDN);
        mpfr_mul(r15916, r15914, r15915, MPFR_RNDN);
        return mpfr_get_d(r15916, MPFR_RNDN);
}

static mpfr_t r15917, r15918, r15919, r15920, r15921, r15922, r15923;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15917);
        mpfr_init(r15918);
        mpfr_init(r15919);
        mpfr_init(r15920);
        mpfr_init(r15921);
        mpfr_init(r15922);
        mpfr_init(r15923);
}

double f_dm(double __attribute__((unused)) a, double __attribute__((unused)) b, double c, double d) {
        mpfr_set_d(r15917, d, MPFR_RNDN);
        mpfr_log(r15918, r15917, MPFR_RNDN);
        mpfr_set_d(r15919, c, MPFR_RNDN);
        mpfr_abs(r15920, r15919, MPFR_RNDN);
        mpfr_add(r15921, r15918, r15920, MPFR_RNDN);
        mpfr_tan(r15922, r15917, MPFR_RNDN);
        mpfr_mul(r15923, r15921, r15922, MPFR_RNDN);
        return mpfr_get_d(r15923, MPFR_RNDN);
}

