#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 r15254 = a;
        float r15255 = atan(r15254);
        float r15256 = sqrt(r15255);
        float r15257 = b;
        float r15258 = hypot(r15256, r15257);
        float r15259 = c;
        float r15260 = r15259 * r15254;
        float r15261 = r15258 - r15260;
        return r15261;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15262 = a;
        double r15263 = atan(r15262);
        double r15264 = sqrt(r15263);
        double r15265 = b;
        double r15266 = hypot(r15264, r15265);
        double r15267 = c;
        double r15268 = r15267 * r15262;
        double r15269 = r15266 - r15268;
        return r15269;
}


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

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

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 r15286, r15287, r15288, r15289, r15290, r15291, r15292, r15293;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15286);
        mpfr_init(r15287);
        mpfr_init(r15288);
        mpfr_init(r15289);
        mpfr_init(r15290);
        mpfr_init(r15291);
        mpfr_init(r15292);
        mpfr_init(r15293);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15286, a, MPFR_RNDN);
        mpfr_atan(r15287, r15286, MPFR_RNDN);
        mpfr_sqrt(r15288, r15287, MPFR_RNDN);
        mpfr_set_d(r15289, b, MPFR_RNDN);
        mpfr_hypot(r15290, r15288, r15289, MPFR_RNDN);
        mpfr_set_d(r15291, c, MPFR_RNDN);
        mpfr_mul(r15292, r15291, r15286, MPFR_RNDN);
        mpfr_sub(r15293, r15290, r15292, MPFR_RNDN);
        return mpfr_get_d(r15293, MPFR_RNDN);
}

static mpfr_t r15294, r15295, r15296, r15297, r15298, r15299, r15300, r15301;

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

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

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

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

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

