#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 r15222 = a;
        float r15223 = atan(r15222);
        float r15224 = sqrt(r15223);
        float r15225 = b;
        float r15226 = hypot(r15224, r15225);
        float r15227 = c;
        float r15228 = r15227 * r15222;
        float r15229 = r15226 - r15228;
        return r15229;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15230 = a;
        double r15231 = atan(r15230);
        double r15232 = sqrt(r15231);
        double r15233 = b;
        double r15234 = hypot(r15232, r15233);
        double r15235 = c;
        double r15236 = r15235 * r15230;
        double r15237 = r15234 - r15236;
        return r15237;
}


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

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 r15254, r15255, r15256, r15257, r15258, r15259, r15260, r15261;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15254);
        mpfr_init(r15255);
        mpfr_init(r15256);
        mpfr_init(r15257);
        mpfr_init(r15258);
        mpfr_init(r15259);
        mpfr_init(r15260);
        mpfr_init(r15261);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15254, a, MPFR_RNDN);
        mpfr_atan(r15255, r15254, MPFR_RNDN);
        mpfr_sqrt(r15256, r15255, MPFR_RNDN);
        mpfr_set_d(r15257, b, MPFR_RNDN);
        mpfr_hypot(r15258, r15256, r15257, MPFR_RNDN);
        mpfr_set_d(r15259, c, MPFR_RNDN);
        mpfr_mul(r15260, r15259, r15254, MPFR_RNDN);
        mpfr_sub(r15261, r15258, r15260, MPFR_RNDN);
        return mpfr_get_d(r15261, MPFR_RNDN);
}

static mpfr_t r15262, r15263, r15264, r15265, r15266, r15267, r15268, r15269;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15262);
        mpfr_init(r15263);
        mpfr_init(r15264);
        mpfr_init(r15265);
        mpfr_init(r15266);
        mpfr_init(r15267);
        mpfr_init(r15268);
        mpfr_init(r15269);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15262, a, MPFR_RNDN);
        mpfr_atan(r15263, r15262, MPFR_RNDN);
        mpfr_sqrt(r15264, r15263, MPFR_RNDN);
        mpfr_set_d(r15265, b, MPFR_RNDN);
        mpfr_hypot(r15266, r15264, r15265, MPFR_RNDN);
        mpfr_set_d(r15267, c, MPFR_RNDN);
        mpfr_mul(r15268, r15267, r15262, MPFR_RNDN);
        mpfr_sub(r15269, r15266, r15268, MPFR_RNDN);
        return mpfr_get_d(r15269, MPFR_RNDN);
}

static mpfr_t r15270, r15271, r15272, r15273, r15274, r15275, r15276, r15277;

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

