#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 r15395 = a;
        float r15396 = atan(r15395);
        float r15397 = sqrt(r15396);
        float r15398 = b;
        float r15399 = hypot(r15397, r15398);
        float r15400 = c;
        float r15401 = r15400 * r15395;
        float r15402 = r15399 - r15401;
        return r15402;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15403 = a;
        double r15404 = atan(r15403);
        double r15405 = sqrt(r15404);
        double r15406 = b;
        double r15407 = hypot(r15405, r15406);
        double r15408 = c;
        double r15409 = r15408 * r15403;
        double r15410 = r15407 - r15409;
        return r15410;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15411 = a;
        float r15412 = atan(r15411);
        float r15413 = sqrt(r15412);
        float r15414 = b;
        float r15415 = hypot(r15413, r15414);
        float r15416 = c;
        float r15417 = r15416 * r15411;
        float r15418 = r15415 - r15417;
        return r15418;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15419 = a;
        double r15420 = atan(r15419);
        double r15421 = sqrt(r15420);
        double r15422 = b;
        double r15423 = hypot(r15421, r15422);
        double r15424 = c;
        double r15425 = r15424 * r15419;
        double r15426 = r15423 - r15425;
        return r15426;
}

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 r15427, r15428, r15429, r15430, r15431, r15432, r15433, r15434;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
        mpfr_init(r15430);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
        mpfr_init(r15434);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15427, a, MPFR_RNDN);
        mpfr_atan(r15428, r15427, MPFR_RNDN);
        mpfr_sqrt(r15429, r15428, MPFR_RNDN);
        mpfr_set_d(r15430, b, MPFR_RNDN);
        mpfr_hypot(r15431, r15429, r15430, MPFR_RNDN);
        mpfr_set_d(r15432, c, MPFR_RNDN);
        mpfr_mul(r15433, r15432, r15427, MPFR_RNDN);
        mpfr_sub(r15434, r15431, r15433, MPFR_RNDN);
        return mpfr_get_d(r15434, MPFR_RNDN);
}

static mpfr_t r15435, r15436, r15437, r15438, r15439, r15440, r15441, r15442;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15435);
        mpfr_init(r15436);
        mpfr_init(r15437);
        mpfr_init(r15438);
        mpfr_init(r15439);
        mpfr_init(r15440);
        mpfr_init(r15441);
        mpfr_init(r15442);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15435, a, MPFR_RNDN);
        mpfr_atan(r15436, r15435, MPFR_RNDN);
        mpfr_sqrt(r15437, r15436, MPFR_RNDN);
        mpfr_set_d(r15438, b, MPFR_RNDN);
        mpfr_hypot(r15439, r15437, r15438, MPFR_RNDN);
        mpfr_set_d(r15440, c, MPFR_RNDN);
        mpfr_mul(r15441, r15440, r15435, MPFR_RNDN);
        mpfr_sub(r15442, r15439, r15441, MPFR_RNDN);
        return mpfr_get_d(r15442, MPFR_RNDN);
}

static mpfr_t r15443, r15444, r15445, r15446, r15447, r15448, r15449, r15450;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15443);
        mpfr_init(r15444);
        mpfr_init(r15445);
        mpfr_init(r15446);
        mpfr_init(r15447);
        mpfr_init(r15448);
        mpfr_init(r15449);
        mpfr_init(r15450);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15443, a, MPFR_RNDN);
        mpfr_atan(r15444, r15443, MPFR_RNDN);
        mpfr_sqrt(r15445, r15444, MPFR_RNDN);
        mpfr_set_d(r15446, b, MPFR_RNDN);
        mpfr_hypot(r15447, r15445, r15446, MPFR_RNDN);
        mpfr_set_d(r15448, c, MPFR_RNDN);
        mpfr_mul(r15449, r15448, r15443, MPFR_RNDN);
        mpfr_sub(r15450, r15447, r15449, MPFR_RNDN);
        return mpfr_get_d(r15450, MPFR_RNDN);
}

