#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 r15230 = a;
        float r15231 = atan(r15230);
        float r15232 = sqrt(r15231);
        float r15233 = b;
        float r15234 = hypot(r15232, r15233);
        float r15235 = c;
        float r15236 = r15235 * r15230;
        float r15237 = r15234 - r15236;
        return r15237;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15238 = a;
        double r15239 = atan(r15238);
        double r15240 = sqrt(r15239);
        double r15241 = b;
        double r15242 = hypot(r15240, r15241);
        double r15243 = c;
        double r15244 = r15243 * r15238;
        double r15245 = r15242 - r15244;
        return r15245;
}


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

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15254 = a;
        double r15255 = atan(r15254);
        double r15256 = sqrt(r15255);
        double r15257 = b;
        double r15258 = hypot(r15256, r15257);
        double r15259 = c;
        double r15260 = r15259 * r15254;
        double r15261 = r15258 - r15260;
        return r15261;
}

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 r15262, r15263, r15264, r15265, r15266, r15267, r15268, r15269;

void setup_mpfr_f_im() {
        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_im(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_fm() {
        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_fm(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_dm() {
        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_dm(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);
}

