#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 r15238 = a;
        float r15239 = atan(r15238);
        float r15240 = sqrt(r15239);
        float r15241 = b;
        float r15242 = hypot(r15240, r15241);
        float r15243 = c;
        float r15244 = r15243 * r15238;
        float r15245 = r15242 - r15244;
        return r15245;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15246 = a;
        double r15247 = atan(r15246);
        double r15248 = sqrt(r15247);
        double r15249 = b;
        double r15250 = hypot(r15248, r15249);
        double r15251 = c;
        double r15252 = r15251 * r15246;
        double r15253 = r15250 - r15252;
        return r15253;
}


double f_of(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_od(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;
}

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 r15270, r15271, r15272, r15273, r15274, r15275, r15276, r15277;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15270);
        mpfr_init(r15271);
        mpfr_init(r15272);
        mpfr_init(r15273);
        mpfr_init(r15274);
        mpfr_init(r15275);
        mpfr_init(r15276);
        mpfr_init(r15277);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15270, a, MPFR_RNDN);
        mpfr_atan(r15271, r15270, MPFR_RNDN);
        mpfr_sqrt(r15272, r15271, MPFR_RNDN);
        mpfr_set_d(r15273, b, MPFR_RNDN);
        mpfr_hypot(r15274, r15272, r15273, MPFR_RNDN);
        mpfr_set_d(r15275, c, MPFR_RNDN);
        mpfr_mul(r15276, r15275, r15270, MPFR_RNDN);
        mpfr_sub(r15277, r15274, r15276, MPFR_RNDN);
        return mpfr_get_d(r15277, MPFR_RNDN);
}

static mpfr_t r15278, r15279, r15280, r15281, r15282, r15283, r15284, r15285;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15278);
        mpfr_init(r15279);
        mpfr_init(r15280);
        mpfr_init(r15281);
        mpfr_init(r15282);
        mpfr_init(r15283);
        mpfr_init(r15284);
        mpfr_init(r15285);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15278, a, MPFR_RNDN);
        mpfr_atan(r15279, r15278, MPFR_RNDN);
        mpfr_sqrt(r15280, r15279, MPFR_RNDN);
        mpfr_set_d(r15281, b, MPFR_RNDN);
        mpfr_hypot(r15282, r15280, r15281, MPFR_RNDN);
        mpfr_set_d(r15283, c, MPFR_RNDN);
        mpfr_mul(r15284, r15283, r15278, MPFR_RNDN);
        mpfr_sub(r15285, r15282, r15284, MPFR_RNDN);
        return mpfr_get_d(r15285, MPFR_RNDN);
}

static mpfr_t r15286, r15287, r15288, r15289, r15290, r15291, r15292, r15293;

void setup_mpfr_f_dm() {
        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_dm(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);
}

