#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 r15383 = a;
        float r15384 = atan(r15383);
        float r15385 = sqrt(r15384);
        float r15386 = b;
        float r15387 = hypot(r15385, r15386);
        float r15388 = c;
        float r15389 = r15388 * r15383;
        float r15390 = r15387 - r15389;
        return r15390;
}

double f_id(double a, double b, double c, double __attribute__((unused)) d) {
        double r15391 = a;
        double r15392 = atan(r15391);
        double r15393 = sqrt(r15392);
        double r15394 = b;
        double r15395 = hypot(r15393, r15394);
        double r15396 = c;
        double r15397 = r15396 * r15391;
        double r15398 = r15395 - r15397;
        return r15398;
}


double f_of(float a, float b, float c, float __attribute__((unused)) d) {
        float r15399 = a;
        float r15400 = atan(r15399);
        float r15401 = sqrt(r15400);
        float r15402 = b;
        float r15403 = hypot(r15401, r15402);
        float r15404 = c;
        float r15405 = r15404 * r15399;
        float r15406 = r15403 - r15405;
        return r15406;
}

double f_od(double a, double b, double c, double __attribute__((unused)) d) {
        double r15407 = a;
        double r15408 = atan(r15407);
        double r15409 = sqrt(r15408);
        double r15410 = b;
        double r15411 = hypot(r15409, r15410);
        double r15412 = c;
        double r15413 = r15412 * r15407;
        double r15414 = r15411 - r15413;
        return r15414;
}

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 r15415, r15416, r15417, r15418, r15419, r15420, r15421, r15422;

void setup_mpfr_f_im() {
        mpfr_set_default_prec(144);
        mpfr_init(r15415);
        mpfr_init(r15416);
        mpfr_init(r15417);
        mpfr_init(r15418);
        mpfr_init(r15419);
        mpfr_init(r15420);
        mpfr_init(r15421);
        mpfr_init(r15422);
}

double f_im(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15415, a, MPFR_RNDN);
        mpfr_atan(r15416, r15415, MPFR_RNDN);
        mpfr_sqrt(r15417, r15416, MPFR_RNDN);
        mpfr_set_d(r15418, b, MPFR_RNDN);
        mpfr_hypot(r15419, r15417, r15418, MPFR_RNDN);
        mpfr_set_d(r15420, c, MPFR_RNDN);
        mpfr_mul(r15421, r15420, r15415, MPFR_RNDN);
        mpfr_sub(r15422, r15419, r15421, MPFR_RNDN);
        return mpfr_get_d(r15422, MPFR_RNDN);
}

static mpfr_t r15423, r15424, r15425, r15426, r15427, r15428, r15429, r15430;

void setup_mpfr_f_fm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15423);
        mpfr_init(r15424);
        mpfr_init(r15425);
        mpfr_init(r15426);
        mpfr_init(r15427);
        mpfr_init(r15428);
        mpfr_init(r15429);
        mpfr_init(r15430);
}

double f_fm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15423, a, MPFR_RNDN);
        mpfr_atan(r15424, r15423, MPFR_RNDN);
        mpfr_sqrt(r15425, r15424, MPFR_RNDN);
        mpfr_set_d(r15426, b, MPFR_RNDN);
        mpfr_hypot(r15427, r15425, r15426, MPFR_RNDN);
        mpfr_set_d(r15428, c, MPFR_RNDN);
        mpfr_mul(r15429, r15428, r15423, MPFR_RNDN);
        mpfr_sub(r15430, r15427, r15429, MPFR_RNDN);
        return mpfr_get_d(r15430, MPFR_RNDN);
}

static mpfr_t r15431, r15432, r15433, r15434, r15435, r15436, r15437, r15438;

void setup_mpfr_f_dm() {
        mpfr_set_default_prec(144);
        mpfr_init(r15431);
        mpfr_init(r15432);
        mpfr_init(r15433);
        mpfr_init(r15434);
        mpfr_init(r15435);
        mpfr_init(r15436);
        mpfr_init(r15437);
        mpfr_init(r15438);
}

double f_dm(double a, double b, double c, double __attribute__((unused)) d) {
        mpfr_set_d(r15431, a, MPFR_RNDN);
        mpfr_atan(r15432, r15431, MPFR_RNDN);
        mpfr_sqrt(r15433, r15432, MPFR_RNDN);
        mpfr_set_d(r15434, b, MPFR_RNDN);
        mpfr_hypot(r15435, r15433, r15434, MPFR_RNDN);
        mpfr_set_d(r15436, c, MPFR_RNDN);
        mpfr_mul(r15437, r15436, r15431, MPFR_RNDN);
        mpfr_sub(r15438, r15435, r15437, MPFR_RNDN);
        return mpfr_get_d(r15438, MPFR_RNDN);
}

