#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 r15249 = a;
        float r15250 = atan(r15249);
        float r15251 = sqrt(r15250);
        float r15252 = b;
        float r15253 = hypot(r15251, r15252);
        float r15254 = c;
        float r15255 = r15254 * r15249;
        float r15256 = r15253 - r15255;
        return r15256;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15257 = a;
        double r15258 = atan(r15257);
        double r15259 = sqrt(r15258);
        double r15260 = b;
        double r15261 = hypot(r15259, r15260);
        double r15262 = c;
        double r15263 = r15262 * r15257;
        double r15264 = r15261 - r15263;
        return r15264;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15265 = a;
        float r15266 = atan(r15265);
        float r15267 = sqrt(r15266);
        float r15268 = b;
        float r15269 = hypot(r15267, r15268);
        float r15270 = c;
        float r15271 = r15270 * r15265;
        float r15272 = r15269 - r15271;
        return r15272;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15273 = a;
        double r15274 = atan(r15273);
        double r15275 = sqrt(r15274);
        double r15276 = b;
        double r15277 = hypot(r15275, r15276);
        double r15278 = c;
        double r15279 = r15278 * r15273;
        double r15280 = r15277 - r15279;
        return r15280;
}

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 r15281, r15282, r15283, r15284, r15285, r15286, r15287, r15288;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15281);
        mpfr_init(r15282);
        mpfr_init(r15283);
        mpfr_init(r15284);
        mpfr_init(r15285);
        mpfr_init(r15286);
        mpfr_init(r15287);
        mpfr_init(r15288);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15281, a, MPFR_RNDN);
        mpfr_atan(r15282, r15281, MPFR_RNDN);
        mpfr_sqrt(r15283, r15282, MPFR_RNDN);
        mpfr_set_d(r15284, b, MPFR_RNDN);
        mpfr_hypot(r15285, r15283, r15284, MPFR_RNDN);
        mpfr_set_d(r15286, c, MPFR_RNDN);
        mpfr_mul(r15287, r15286, r15281, MPFR_RNDN);
        mpfr_sub(r15288, r15285, r15287, MPFR_RNDN);
        return mpfr_get_d(r15288, MPFR_RNDN);
}

static mpfr_t r15289, r15290, r15291, r15292, r15293, r15294, r15295, r15296;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15289);
        mpfr_init(r15290);
        mpfr_init(r15291);
        mpfr_init(r15292);
        mpfr_init(r15293);
        mpfr_init(r15294);
        mpfr_init(r15295);
        mpfr_init(r15296);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15289, a, MPFR_RNDN);
        mpfr_atan(r15290, r15289, MPFR_RNDN);
        mpfr_sqrt(r15291, r15290, MPFR_RNDN);
        mpfr_set_d(r15292, b, MPFR_RNDN);
        mpfr_hypot(r15293, r15291, r15292, MPFR_RNDN);
        mpfr_set_d(r15294, c, MPFR_RNDN);
        mpfr_mul(r15295, r15294, r15289, MPFR_RNDN);
        mpfr_sub(r15296, r15293, r15295, MPFR_RNDN);
        return mpfr_get_d(r15296, MPFR_RNDN);
}

static mpfr_t r15297, r15298, r15299, r15300, r15301, r15302, r15303, r15304;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15297);
        mpfr_init(r15298);
        mpfr_init(r15299);
        mpfr_init(r15300);
        mpfr_init(r15301);
        mpfr_init(r15302);
        mpfr_init(r15303);
        mpfr_init(r15304);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15297, a, MPFR_RNDN);
        mpfr_atan(r15298, r15297, MPFR_RNDN);
        mpfr_sqrt(r15299, r15298, MPFR_RNDN);
        mpfr_set_d(r15300, b, MPFR_RNDN);
        mpfr_hypot(r15301, r15299, r15300, MPFR_RNDN);
        mpfr_set_d(r15302, c, MPFR_RNDN);
        mpfr_mul(r15303, r15302, r15297, MPFR_RNDN);
        mpfr_sub(r15304, r15301, r15303, MPFR_RNDN);
        return mpfr_get_d(r15304, MPFR_RNDN);
}

