#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 r15261 = a;
        float r15262 = atan(r15261);
        float r15263 = sqrt(r15262);
        float r15264 = b;
        float r15265 = hypot(r15263, r15264);
        float r15266 = c;
        float r15267 = r15266 * r15261;
        float r15268 = r15265 - r15267;
        return r15268;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15269 = a;
        double r15270 = atan(r15269);
        double r15271 = sqrt(r15270);
        double r15272 = b;
        double r15273 = hypot(r15271, r15272);
        double r15274 = c;
        double r15275 = r15274 * r15269;
        double r15276 = r15273 - r15275;
        return r15276;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15277 = a;
        float r15278 = atan(r15277);
        float r15279 = sqrt(r15278);
        float r15280 = b;
        float r15281 = hypot(r15279, r15280);
        float r15282 = c;
        float r15283 = r15282 * r15277;
        float r15284 = r15281 - r15283;
        return r15284;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15285 = a;
        double r15286 = atan(r15285);
        double r15287 = sqrt(r15286);
        double r15288 = b;
        double r15289 = hypot(r15287, r15288);
        double r15290 = c;
        double r15291 = r15290 * r15285;
        double r15292 = r15289 - r15291;
        return r15292;
}

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 r15293, r15294, r15295, r15296, r15297, r15298, r15299, r15300;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15293);
        mpfr_init(r15294);
        mpfr_init(r15295);
        mpfr_init(r15296);
        mpfr_init(r15297);
        mpfr_init(r15298);
        mpfr_init(r15299);
        mpfr_init(r15300);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15293, a, MPFR_RNDN);
        mpfr_atan(r15294, r15293, MPFR_RNDN);
        mpfr_sqrt(r15295, r15294, MPFR_RNDN);
        mpfr_set_d(r15296, b, MPFR_RNDN);
        mpfr_hypot(r15297, r15295, r15296, MPFR_RNDN);
        mpfr_set_d(r15298, c, MPFR_RNDN);
        mpfr_mul(r15299, r15298, r15293, MPFR_RNDN);
        mpfr_sub(r15300, r15297, r15299, MPFR_RNDN);
        return mpfr_get_d(r15300, MPFR_RNDN);
}

static mpfr_t r15301, r15302, r15303, r15304, r15305, r15306, r15307, r15308;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15301);
        mpfr_init(r15302);
        mpfr_init(r15303);
        mpfr_init(r15304);
        mpfr_init(r15305);
        mpfr_init(r15306);
        mpfr_init(r15307);
        mpfr_init(r15308);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15301, a, MPFR_RNDN);
        mpfr_atan(r15302, r15301, MPFR_RNDN);
        mpfr_sqrt(r15303, r15302, MPFR_RNDN);
        mpfr_set_d(r15304, b, MPFR_RNDN);
        mpfr_hypot(r15305, r15303, r15304, MPFR_RNDN);
        mpfr_set_d(r15306, c, MPFR_RNDN);
        mpfr_mul(r15307, r15306, r15301, MPFR_RNDN);
        mpfr_sub(r15308, r15305, r15307, MPFR_RNDN);
        return mpfr_get_d(r15308, MPFR_RNDN);
}

static mpfr_t r15309, r15310, r15311, r15312, r15313, r15314, r15315, r15316;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15309);
        mpfr_init(r15310);
        mpfr_init(r15311);
        mpfr_init(r15312);
        mpfr_init(r15313);
        mpfr_init(r15314);
        mpfr_init(r15315);
        mpfr_init(r15316);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15309, a, MPFR_RNDN);
        mpfr_atan(r15310, r15309, MPFR_RNDN);
        mpfr_sqrt(r15311, r15310, MPFR_RNDN);
        mpfr_set_d(r15312, b, MPFR_RNDN);
        mpfr_hypot(r15313, r15311, r15312, MPFR_RNDN);
        mpfr_set_d(r15314, c, MPFR_RNDN);
        mpfr_mul(r15315, r15314, r15309, MPFR_RNDN);
        mpfr_sub(r15316, r15313, r15315, MPFR_RNDN);
        return mpfr_get_d(r15316, MPFR_RNDN);
}

