#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 r15290 = a;
        float r15291 = atan(r15290);
        float r15292 = sqrt(r15291);
        float r15293 = b;
        float r15294 = hypot(r15292, r15293);
        float r15295 = c;
        float r15296 = r15295 * r15290;
        float r15297 = r15294 - r15296;
        return r15297;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15298 = a;
        double r15299 = atan(r15298);
        double r15300 = sqrt(r15299);
        double r15301 = b;
        double r15302 = hypot(r15300, r15301);
        double r15303 = c;
        double r15304 = r15303 * r15298;
        double r15305 = r15302 - r15304;
        return r15305;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15306 = a;
        float r15307 = atan(r15306);
        float r15308 = sqrt(r15307);
        float r15309 = b;
        float r15310 = hypot(r15308, r15309);
        float r15311 = c;
        float r15312 = r15311 * r15306;
        float r15313 = r15310 - r15312;
        return r15313;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15314 = a;
        double r15315 = atan(r15314);
        double r15316 = sqrt(r15315);
        double r15317 = b;
        double r15318 = hypot(r15316, r15317);
        double r15319 = c;
        double r15320 = r15319 * r15314;
        double r15321 = r15318 - r15320;
        return r15321;
}

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 r15322, r15323, r15324, r15325, r15326, r15327, r15328, r15329;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15322);
        mpfr_init(r15323);
        mpfr_init(r15324);
        mpfr_init(r15325);
        mpfr_init(r15326);
        mpfr_init(r15327);
        mpfr_init(r15328);
        mpfr_init(r15329);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15322, a, MPFR_RNDN);
        mpfr_atan(r15323, r15322, MPFR_RNDN);
        mpfr_sqrt(r15324, r15323, MPFR_RNDN);
        mpfr_set_d(r15325, b, MPFR_RNDN);
        mpfr_hypot(r15326, r15324, r15325, MPFR_RNDN);
        mpfr_set_d(r15327, c, MPFR_RNDN);
        mpfr_mul(r15328, r15327, r15322, MPFR_RNDN);
        mpfr_sub(r15329, r15326, r15328, MPFR_RNDN);
        return mpfr_get_d(r15329, MPFR_RNDN);
}

static mpfr_t r15330, r15331, r15332, r15333, r15334, r15335, r15336, r15337;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15330);
        mpfr_init(r15331);
        mpfr_init(r15332);
        mpfr_init(r15333);
        mpfr_init(r15334);
        mpfr_init(r15335);
        mpfr_init(r15336);
        mpfr_init(r15337);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15330, a, MPFR_RNDN);
        mpfr_atan(r15331, r15330, MPFR_RNDN);
        mpfr_sqrt(r15332, r15331, MPFR_RNDN);
        mpfr_set_d(r15333, b, MPFR_RNDN);
        mpfr_hypot(r15334, r15332, r15333, MPFR_RNDN);
        mpfr_set_d(r15335, c, MPFR_RNDN);
        mpfr_mul(r15336, r15335, r15330, MPFR_RNDN);
        mpfr_sub(r15337, r15334, r15336, MPFR_RNDN);
        return mpfr_get_d(r15337, MPFR_RNDN);
}

static mpfr_t r15338, r15339, r15340, r15341, r15342, r15343, r15344, r15345;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15338);
        mpfr_init(r15339);
        mpfr_init(r15340);
        mpfr_init(r15341);
        mpfr_init(r15342);
        mpfr_init(r15343);
        mpfr_init(r15344);
        mpfr_init(r15345);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15338, a, MPFR_RNDN);
        mpfr_atan(r15339, r15338, MPFR_RNDN);
        mpfr_sqrt(r15340, r15339, MPFR_RNDN);
        mpfr_set_d(r15341, b, MPFR_RNDN);
        mpfr_hypot(r15342, r15340, r15341, MPFR_RNDN);
        mpfr_set_d(r15343, c, MPFR_RNDN);
        mpfr_mul(r15344, r15343, r15338, MPFR_RNDN);
        mpfr_sub(r15345, r15342, r15344, MPFR_RNDN);
        return mpfr_get_d(r15345, MPFR_RNDN);
}

