#include <tgmath.h>
#include <gmp.h>
#include <mpfr.h>
#include <stdio.h>
#include <stdbool.h>

char *name = "(- (hypot (sqrt (atan a)) b) (* c a))";

double f_if(float a, float b, float c, float __attribute__((unused)) d) {
        float r15265 = a;
        float r15266 = atan(r15265);
        float r15267 = sqrt(r15266);
        float r15268 = b;
        float r15269 = hypot(r15267, r15268);
        float r15270 = c;
        float r15271 = r15270 * r15265;
        float r15272 = r15269 - r15271;
        return r15272;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15273 = a;
        double r15274 = atan(r15273);
        double r15275 = sqrt(r15274);
        double r15276 = b;
        double r15277 = hypot(r15275, r15276);
        double r15278 = c;
        double r15279 = r15278 * r15273;
        double r15280 = r15277 - r15279;
        return r15280;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15281 = a;
        float r15282 = atan(r15281);
        float r15283 = sqrt(r15282);
        float r15284 = b;
        float r15285 = hypot(r15283, r15284);
        float r15286 = c;
        float r15287 = r15286 * r15281;
        float r15288 = r15285 - r15287;
        return r15288;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15289 = a;
        double r15290 = atan(r15289);
        double r15291 = sqrt(r15290);
        double r15292 = b;
        double r15293 = hypot(r15291, r15292);
        double r15294 = c;
        double r15295 = r15294 * r15289;
        double r15296 = r15293 - r15295;
        return r15296;
}

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 r15297, r15298, r15299, r15300, r15301, r15302, r15303, r15304;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15297);
        mpfr_init(r15298);
        mpfr_init(r15299);
        mpfr_init(r15300);
        mpfr_init(r15301);
        mpfr_init(r15302);
        mpfr_init(r15303);
        mpfr_init(r15304);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15297, a, MPFR_RNDN);
        mpfr_atan(r15298, r15297, MPFR_RNDN);
        mpfr_sqrt(r15299, r15298, MPFR_RNDN);
        mpfr_set_d(r15300, b, MPFR_RNDN);
        mpfr_hypot(r15301, r15299, r15300, MPFR_RNDN);
        mpfr_set_d(r15302, c, MPFR_RNDN);
        mpfr_mul(r15303, r15302, r15297, MPFR_RNDN);
        mpfr_sub(r15304, r15301, r15303, MPFR_RNDN);
        return mpfr_get_d(r15304, MPFR_RNDN);
}

static mpfr_t r15305, r15306, r15307, r15308, r15309, r15310, r15311, r15312;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15305);
        mpfr_init(r15306);
        mpfr_init(r15307);
        mpfr_init(r15308);
        mpfr_init(r15309);
        mpfr_init(r15310);
        mpfr_init(r15311);
        mpfr_init(r15312);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15305, a, MPFR_RNDN);
        mpfr_atan(r15306, r15305, MPFR_RNDN);
        mpfr_sqrt(r15307, r15306, MPFR_RNDN);
        mpfr_set_d(r15308, b, MPFR_RNDN);
        mpfr_hypot(r15309, r15307, r15308, MPFR_RNDN);
        mpfr_set_d(r15310, c, MPFR_RNDN);
        mpfr_mul(r15311, r15310, r15305, MPFR_RNDN);
        mpfr_sub(r15312, r15309, r15311, MPFR_RNDN);
        return mpfr_get_d(r15312, MPFR_RNDN);
}

static mpfr_t r15313, r15314, r15315, r15316, r15317, r15318, r15319, r15320;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15313);
        mpfr_init(r15314);
        mpfr_init(r15315);
        mpfr_init(r15316);
        mpfr_init(r15317);
        mpfr_init(r15318);
        mpfr_init(r15319);
        mpfr_init(r15320);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15313, a, MPFR_RNDN);
        mpfr_atan(r15314, r15313, MPFR_RNDN);
        mpfr_sqrt(r15315, r15314, MPFR_RNDN);
        mpfr_set_d(r15316, b, MPFR_RNDN);
        mpfr_hypot(r15317, r15315, r15316, MPFR_RNDN);
        mpfr_set_d(r15318, c, MPFR_RNDN);
        mpfr_mul(r15319, r15318, r15313, MPFR_RNDN);
        mpfr_sub(r15320, r15317, r15319, MPFR_RNDN);
        return mpfr_get_d(r15320, MPFR_RNDN);
}

