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

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


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

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

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 r15325, r15326, r15327, r15328, r15329, r15330, r15331, r15332;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15325);
        mpfr_init(r15326);
        mpfr_init(r15327);
        mpfr_init(r15328);
        mpfr_init(r15329);
        mpfr_init(r15330);
        mpfr_init(r15331);
        mpfr_init(r15332);
}

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

static mpfr_t r15333, r15334, r15335, r15336, r15337, r15338, r15339, r15340;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15333);
        mpfr_init(r15334);
        mpfr_init(r15335);
        mpfr_init(r15336);
        mpfr_init(r15337);
        mpfr_init(r15338);
        mpfr_init(r15339);
        mpfr_init(r15340);
}

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

static mpfr_t r15341, r15342, r15343, r15344, r15345, r15346, r15347, r15348;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15341);
        mpfr_init(r15342);
        mpfr_init(r15343);
        mpfr_init(r15344);
        mpfr_init(r15345);
        mpfr_init(r15346);
        mpfr_init(r15347);
        mpfr_init(r15348);
}

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

