#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 r15218 = a;
        float r15219 = atan(r15218);
        float r15220 = sqrt(r15219);
        float r15221 = b;
        float r15222 = hypot(r15220, r15221);
        float r15223 = c;
        float r15224 = r15223 * r15218;
        float r15225 = r15222 - r15224;
        return r15225;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15226 = a;
        double r15227 = atan(r15226);
        double r15228 = sqrt(r15227);
        double r15229 = b;
        double r15230 = hypot(r15228, r15229);
        double r15231 = c;
        double r15232 = r15231 * r15226;
        double r15233 = r15230 - r15232;
        return r15233;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15234 = a;
        float r15235 = atan(r15234);
        float r15236 = sqrt(r15235);
        float r15237 = b;
        float r15238 = hypot(r15236, r15237);
        float r15239 = c;
        float r15240 = r15239 * r15234;
        float r15241 = r15238 - r15240;
        return r15241;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15242 = a;
        double r15243 = atan(r15242);
        double r15244 = sqrt(r15243);
        double r15245 = b;
        double r15246 = hypot(r15244, r15245);
        double r15247 = c;
        double r15248 = r15247 * r15242;
        double r15249 = r15246 - r15248;
        return r15249;
}

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 r15250, r15251, r15252, r15253, r15254, r15255, r15256, r15257;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15250);
        mpfr_init(r15251);
        mpfr_init(r15252);
        mpfr_init(r15253);
        mpfr_init(r15254);
        mpfr_init(r15255);
        mpfr_init(r15256);
        mpfr_init(r15257);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15250, a, MPFR_RNDN);
        mpfr_atan(r15251, r15250, MPFR_RNDN);
        mpfr_sqrt(r15252, r15251, MPFR_RNDN);
        mpfr_set_d(r15253, b, MPFR_RNDN);
        mpfr_hypot(r15254, r15252, r15253, MPFR_RNDN);
        mpfr_set_d(r15255, c, MPFR_RNDN);
        mpfr_mul(r15256, r15255, r15250, MPFR_RNDN);
        mpfr_sub(r15257, r15254, r15256, MPFR_RNDN);
        return mpfr_get_d(r15257, MPFR_RNDN);
}

static mpfr_t r15258, r15259, r15260, r15261, r15262, r15263, r15264, r15265;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15258);
        mpfr_init(r15259);
        mpfr_init(r15260);
        mpfr_init(r15261);
        mpfr_init(r15262);
        mpfr_init(r15263);
        mpfr_init(r15264);
        mpfr_init(r15265);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15258, a, MPFR_RNDN);
        mpfr_atan(r15259, r15258, MPFR_RNDN);
        mpfr_sqrt(r15260, r15259, MPFR_RNDN);
        mpfr_set_d(r15261, b, MPFR_RNDN);
        mpfr_hypot(r15262, r15260, r15261, MPFR_RNDN);
        mpfr_set_d(r15263, c, MPFR_RNDN);
        mpfr_mul(r15264, r15263, r15258, MPFR_RNDN);
        mpfr_sub(r15265, r15262, r15264, MPFR_RNDN);
        return mpfr_get_d(r15265, MPFR_RNDN);
}

static mpfr_t r15266, r15267, r15268, r15269, r15270, r15271, r15272, r15273;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15266);
        mpfr_init(r15267);
        mpfr_init(r15268);
        mpfr_init(r15269);
        mpfr_init(r15270);
        mpfr_init(r15271);
        mpfr_init(r15272);
        mpfr_init(r15273);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15266, a, MPFR_RNDN);
        mpfr_atan(r15267, r15266, MPFR_RNDN);
        mpfr_sqrt(r15268, r15267, MPFR_RNDN);
        mpfr_set_d(r15269, b, MPFR_RNDN);
        mpfr_hypot(r15270, r15268, r15269, MPFR_RNDN);
        mpfr_set_d(r15271, c, MPFR_RNDN);
        mpfr_mul(r15272, r15271, r15266, MPFR_RNDN);
        mpfr_sub(r15273, r15270, r15272, MPFR_RNDN);
        return mpfr_get_d(r15273, MPFR_RNDN);
}

