(FPCore (a b angle x-scale y-scale)
:precision binary64
(*
180.0
(/
(atan
(/
(-
(-
(/
(/
(+
(pow (* a (cos (* (/ angle 180.0) PI))) 2.0)
(pow (* b (sin (* (/ angle 180.0) PI))) 2.0))
y-scale)
y-scale)
(/
(/
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* (/ angle 180.0) PI))) 2.0))
x-scale)
x-scale))
(sqrt
(+
(pow
(-
(/
(/
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* (/ angle 180.0) PI))) 2.0))
x-scale)
x-scale)
(/
(/
(+
(pow (* a (cos (* (/ angle 180.0) PI))) 2.0)
(pow (* b (sin (* (/ angle 180.0) PI))) 2.0))
y-scale)
y-scale))
2.0)
(pow
(/
(/
(*
(*
(* 2.0 (- (pow b 2.0) (pow a 2.0)))
(sin (* (/ angle 180.0) PI)))
(cos (* (/ angle 180.0) PI)))
x-scale)
y-scale)
2.0))))
(/
(/
(*
(* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI)))
(cos (* (/ angle 180.0) PI)))
x-scale)
y-scale)))
PI)))(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* y-scale (pow x-scale -2.0)))
(t_2 (sin t_0))
(t_3 (* t_2 t_1))
(t_4
(*
180.0
(/
(atan
(*
x-scale
(*
(/ (pow (cos t_0) 2.0) (* x-scale x-scale))
(/ (- y-scale) t_2))))
PI)))
(t_5 (/ y-scale (* x-scale x-scale)))
(t_6
(*
180.0
(/
(atan
(*
x-scale
(*
t_5
(expm1 (log1p (sin (* angle (* 0.005555555555555556 PI))))))))
PI)))
(t_7
(*
180.0
(/
(atan (* 0.005555555555555556 (* (* angle PI) (/ y-scale x-scale))))
PI)))
(t_8 (* 180.0 (/ (atan (/ (* y-scale t_2) x-scale)) PI))))
(if (<= x-scale -3.2116766629260986e+154)
t_7
(if (<= x-scale -9.84452925613738e+111)
t_4
(if (<= x-scale -1.242420305716196e-42)
t_8
(if (<= x-scale -5.6248734637854445e-99)
t_4
(if (<= x-scale -4.8060553385269945e-197)
(*
180.0
(/
(atan (* x-scale (/ (* (/ y-scale x-scale) t_2) x-scale)))
PI))
(if (<= x-scale -6.253184033580119e-243)
(* 180.0 (/ (atan (* x-scale (sqrt (pow t_3 2.0)))) PI))
(if (<= x-scale 1.6582340324706763e-307)
t_6
(if (<= x-scale 5.147224452517122e-270)
(*
180.0
(/
(atan
(*
x-scale
(* t_2 (pow (pow t_1 3.0) 0.3333333333333333))))
PI))
(if (<= x-scale 8.191269321848878e-218)
(* 180.0 (/ (atan (* x-scale (* t_0 t_5))) PI))
(if (<= x-scale 1.4303173329051239e-126)
(*
180.0
(/
(atan
(*
x-scale
(*
t_5
(+
t_0
(*
(* (pow angle 3.0) (pow PI 3.0))
-2.8577960676726107e-8)))))
PI))
(if (<= x-scale 8.962533660054582e-101)
(*
180.0
(/ (atan (* x-scale (log1p (expm1 t_3)))) PI))
(if (<= x-scale 2.8859830434113404e-37)
t_6
(if (<= x-scale 1.8322237614678637e+34)
t_4
(if (<= x-scale 7.22517356074486e+120)
t_7
t_8))))))))))))))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((((((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale) - (((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale)) - sqrt((pow(((((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale) - (((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale))) / ((double) M_PI));
}
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = y_45_scale * pow(x_45_scale, -2.0);
double t_2 = sin(t_0);
double t_3 = t_2 * t_1;
double t_4 = 180.0 * (atan((x_45_scale * ((pow(cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_2)))) / ((double) M_PI));
double t_5 = y_45_scale / (x_45_scale * x_45_scale);
double t_6 = 180.0 * (atan((x_45_scale * (t_5 * expm1(log1p(sin((angle * (0.005555555555555556 * ((double) M_PI))))))))) / ((double) M_PI));
double t_7 = 180.0 * (atan((0.005555555555555556 * ((angle * ((double) M_PI)) * (y_45_scale / x_45_scale)))) / ((double) M_PI));
double t_8 = 180.0 * (atan(((y_45_scale * t_2) / x_45_scale)) / ((double) M_PI));
double tmp;
if (x_45_scale <= -3.2116766629260986e+154) {
tmp = t_7;
} else if (x_45_scale <= -9.84452925613738e+111) {
tmp = t_4;
} else if (x_45_scale <= -1.242420305716196e-42) {
tmp = t_8;
} else if (x_45_scale <= -5.6248734637854445e-99) {
tmp = t_4;
} else if (x_45_scale <= -4.8060553385269945e-197) {
tmp = 180.0 * (atan((x_45_scale * (((y_45_scale / x_45_scale) * t_2) / x_45_scale))) / ((double) M_PI));
} else if (x_45_scale <= -6.253184033580119e-243) {
tmp = 180.0 * (atan((x_45_scale * sqrt(pow(t_3, 2.0)))) / ((double) M_PI));
} else if (x_45_scale <= 1.6582340324706763e-307) {
tmp = t_6;
} else if (x_45_scale <= 5.147224452517122e-270) {
tmp = 180.0 * (atan((x_45_scale * (t_2 * pow(pow(t_1, 3.0), 0.3333333333333333)))) / ((double) M_PI));
} else if (x_45_scale <= 8.191269321848878e-218) {
tmp = 180.0 * (atan((x_45_scale * (t_0 * t_5))) / ((double) M_PI));
} else if (x_45_scale <= 1.4303173329051239e-126) {
tmp = 180.0 * (atan((x_45_scale * (t_5 * (t_0 + ((pow(angle, 3.0) * pow(((double) M_PI), 3.0)) * -2.8577960676726107e-8))))) / ((double) M_PI));
} else if (x_45_scale <= 8.962533660054582e-101) {
tmp = 180.0 * (atan((x_45_scale * log1p(expm1(t_3)))) / ((double) M_PI));
} else if (x_45_scale <= 2.8859830434113404e-37) {
tmp = t_6;
} else if (x_45_scale <= 1.8322237614678637e+34) {
tmp = t_4;
} else if (x_45_scale <= 7.22517356074486e+120) {
tmp = t_7;
} else {
tmp = t_8;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((((((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale) - (((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale)) - Math.sqrt((Math.pow(((((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale) - (((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale))) / Math.PI);
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = y_45_scale * Math.pow(x_45_scale, -2.0);
double t_2 = Math.sin(t_0);
double t_3 = t_2 * t_1;
double t_4 = 180.0 * (Math.atan((x_45_scale * ((Math.pow(Math.cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_2)))) / Math.PI);
double t_5 = y_45_scale / (x_45_scale * x_45_scale);
double t_6 = 180.0 * (Math.atan((x_45_scale * (t_5 * Math.expm1(Math.log1p(Math.sin((angle * (0.005555555555555556 * Math.PI)))))))) / Math.PI);
double t_7 = 180.0 * (Math.atan((0.005555555555555556 * ((angle * Math.PI) * (y_45_scale / x_45_scale)))) / Math.PI);
double t_8 = 180.0 * (Math.atan(((y_45_scale * t_2) / x_45_scale)) / Math.PI);
double tmp;
if (x_45_scale <= -3.2116766629260986e+154) {
tmp = t_7;
} else if (x_45_scale <= -9.84452925613738e+111) {
tmp = t_4;
} else if (x_45_scale <= -1.242420305716196e-42) {
tmp = t_8;
} else if (x_45_scale <= -5.6248734637854445e-99) {
tmp = t_4;
} else if (x_45_scale <= -4.8060553385269945e-197) {
tmp = 180.0 * (Math.atan((x_45_scale * (((y_45_scale / x_45_scale) * t_2) / x_45_scale))) / Math.PI);
} else if (x_45_scale <= -6.253184033580119e-243) {
tmp = 180.0 * (Math.atan((x_45_scale * Math.sqrt(Math.pow(t_3, 2.0)))) / Math.PI);
} else if (x_45_scale <= 1.6582340324706763e-307) {
tmp = t_6;
} else if (x_45_scale <= 5.147224452517122e-270) {
tmp = 180.0 * (Math.atan((x_45_scale * (t_2 * Math.pow(Math.pow(t_1, 3.0), 0.3333333333333333)))) / Math.PI);
} else if (x_45_scale <= 8.191269321848878e-218) {
tmp = 180.0 * (Math.atan((x_45_scale * (t_0 * t_5))) / Math.PI);
} else if (x_45_scale <= 1.4303173329051239e-126) {
tmp = 180.0 * (Math.atan((x_45_scale * (t_5 * (t_0 + ((Math.pow(angle, 3.0) * Math.pow(Math.PI, 3.0)) * -2.8577960676726107e-8))))) / Math.PI);
} else if (x_45_scale <= 8.962533660054582e-101) {
tmp = 180.0 * (Math.atan((x_45_scale * Math.log1p(Math.expm1(t_3)))) / Math.PI);
} else if (x_45_scale <= 2.8859830434113404e-37) {
tmp = t_6;
} else if (x_45_scale <= 1.8322237614678637e+34) {
tmp = t_4;
} else if (x_45_scale <= 7.22517356074486e+120) {
tmp = t_7;
} else {
tmp = t_8;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((((((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale) - (((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale)) - math.sqrt((math.pow(((((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale) - (((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale)), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale), 2.0)))) / (((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale))) / math.pi)
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = y_45_scale * math.pow(x_45_scale, -2.0) t_2 = math.sin(t_0) t_3 = t_2 * t_1 t_4 = 180.0 * (math.atan((x_45_scale * ((math.pow(math.cos(t_0), 2.0) / (x_45_scale * x_45_scale)) * (-y_45_scale / t_2)))) / math.pi) t_5 = y_45_scale / (x_45_scale * x_45_scale) t_6 = 180.0 * (math.atan((x_45_scale * (t_5 * math.expm1(math.log1p(math.sin((angle * (0.005555555555555556 * math.pi)))))))) / math.pi) t_7 = 180.0 * (math.atan((0.005555555555555556 * ((angle * math.pi) * (y_45_scale / x_45_scale)))) / math.pi) t_8 = 180.0 * (math.atan(((y_45_scale * t_2) / x_45_scale)) / math.pi) tmp = 0 if x_45_scale <= -3.2116766629260986e+154: tmp = t_7 elif x_45_scale <= -9.84452925613738e+111: tmp = t_4 elif x_45_scale <= -1.242420305716196e-42: tmp = t_8 elif x_45_scale <= -5.6248734637854445e-99: tmp = t_4 elif x_45_scale <= -4.8060553385269945e-197: tmp = 180.0 * (math.atan((x_45_scale * (((y_45_scale / x_45_scale) * t_2) / x_45_scale))) / math.pi) elif x_45_scale <= -6.253184033580119e-243: tmp = 180.0 * (math.atan((x_45_scale * math.sqrt(math.pow(t_3, 2.0)))) / math.pi) elif x_45_scale <= 1.6582340324706763e-307: tmp = t_6 elif x_45_scale <= 5.147224452517122e-270: tmp = 180.0 * (math.atan((x_45_scale * (t_2 * math.pow(math.pow(t_1, 3.0), 0.3333333333333333)))) / math.pi) elif x_45_scale <= 8.191269321848878e-218: tmp = 180.0 * (math.atan((x_45_scale * (t_0 * t_5))) / math.pi) elif x_45_scale <= 1.4303173329051239e-126: tmp = 180.0 * (math.atan((x_45_scale * (t_5 * (t_0 + ((math.pow(angle, 3.0) * math.pow(math.pi, 3.0)) * -2.8577960676726107e-8))))) / math.pi) elif x_45_scale <= 8.962533660054582e-101: tmp = 180.0 * (math.atan((x_45_scale * math.log1p(math.expm1(t_3)))) / math.pi) elif x_45_scale <= 2.8859830434113404e-37: tmp = t_6 elif x_45_scale <= 1.8322237614678637e+34: tmp = t_4 elif x_45_scale <= 7.22517356074486e+120: tmp = t_7 else: tmp = t_8 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale) - Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) - sqrt(Float64((Float64(Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0)))) / Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale))) / pi)) end
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(y_45_scale * (x_45_scale ^ -2.0)) t_2 = sin(t_0) t_3 = Float64(t_2 * t_1) t_4 = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(Float64((cos(t_0) ^ 2.0) / Float64(x_45_scale * x_45_scale)) * Float64(Float64(-y_45_scale) / t_2)))) / pi)) t_5 = Float64(y_45_scale / Float64(x_45_scale * x_45_scale)) t_6 = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(t_5 * expm1(log1p(sin(Float64(angle * Float64(0.005555555555555556 * pi)))))))) / pi)) t_7 = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(Float64(angle * pi) * Float64(y_45_scale / x_45_scale)))) / pi)) t_8 = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_2) / x_45_scale)) / pi)) tmp = 0.0 if (x_45_scale <= -3.2116766629260986e+154) tmp = t_7; elseif (x_45_scale <= -9.84452925613738e+111) tmp = t_4; elseif (x_45_scale <= -1.242420305716196e-42) tmp = t_8; elseif (x_45_scale <= -5.6248734637854445e-99) tmp = t_4; elseif (x_45_scale <= -4.8060553385269945e-197) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(Float64(Float64(y_45_scale / x_45_scale) * t_2) / x_45_scale))) / pi)); elseif (x_45_scale <= -6.253184033580119e-243) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * sqrt((t_3 ^ 2.0)))) / pi)); elseif (x_45_scale <= 1.6582340324706763e-307) tmp = t_6; elseif (x_45_scale <= 5.147224452517122e-270) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(t_2 * ((t_1 ^ 3.0) ^ 0.3333333333333333)))) / pi)); elseif (x_45_scale <= 8.191269321848878e-218) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(t_0 * t_5))) / pi)); elseif (x_45_scale <= 1.4303173329051239e-126) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * Float64(t_5 * Float64(t_0 + Float64(Float64((angle ^ 3.0) * (pi ^ 3.0)) * -2.8577960676726107e-8))))) / pi)); elseif (x_45_scale <= 8.962533660054582e-101) tmp = Float64(180.0 * Float64(atan(Float64(x_45_scale * log1p(expm1(t_3)))) / pi)); elseif (x_45_scale <= 2.8859830434113404e-37) tmp = t_6; elseif (x_45_scale <= 1.8322237614678637e+34) tmp = t_4; elseif (x_45_scale <= 7.22517356074486e+120) tmp = t_7; else tmp = t_8; end return tmp end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision] - N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] - N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$45$scale * N[Power[x$45$scale, -2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(N[(N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision] / N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[((-y$45$scale) / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(y$45$scale / N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(t$95$5 * N[(Exp[N[Log[1 + N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(N[(angle * Pi), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -3.2116766629260986e+154], t$95$7, If[LessEqual[x$45$scale, -9.84452925613738e+111], t$95$4, If[LessEqual[x$45$scale, -1.242420305716196e-42], t$95$8, If[LessEqual[x$45$scale, -5.6248734637854445e-99], t$95$4, If[LessEqual[x$45$scale, -4.8060553385269945e-197], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, -6.253184033580119e-243], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1.6582340324706763e-307], t$95$6, If[LessEqual[x$45$scale, 5.147224452517122e-270], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(t$95$2 * N[Power[N[Power[t$95$1, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 8.191269321848878e-218], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1.4303173329051239e-126], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[(t$95$5 * N[(t$95$0 + N[(N[(N[Power[angle, 3.0], $MachinePrecision] * N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 8.962533660054582e-101], N[(180.0 * N[(N[ArcTan[N[(x$45$scale * N[Log[1 + N[(Exp[t$95$3] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 2.8859830434113404e-37], t$95$6, If[LessEqual[x$45$scale, 1.8322237614678637e+34], t$95$4, If[LessEqual[x$45$scale, 7.22517356074486e+120], t$95$7, t$95$8]]]]]]]]]]]]]]]]]]]]]]]
180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}}{\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi}
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := y-scale \cdot {x-scale}^{-2}\\
t_2 := \sin t_0\\
t_3 := t_2 \cdot t_1\\
t_4 := 180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(\frac{{\cos t_0}^{2}}{x-scale \cdot x-scale} \cdot \frac{-y-scale}{t_2}\right)\right)}{\pi}\\
t_5 := \frac{y-scale}{x-scale \cdot x-scale}\\
t_6 := 180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(t_5 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\right)}{\pi}\\
t_7 := 180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \frac{y-scale}{x-scale}\right)\right)}{\pi}\\
t_8 := 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t_2}{x-scale}\right)}{\pi}\\
\mathbf{if}\;x-scale \leq -3.2116766629260986 \cdot 10^{+154}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;x-scale \leq -9.84452925613738 \cdot 10^{+111}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x-scale \leq -1.242420305716196 \cdot 10^{-42}:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x-scale \leq -5.6248734637854445 \cdot 10^{-99}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x-scale \leq -4.8060553385269945 \cdot 10^{-197}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \frac{\frac{y-scale}{x-scale} \cdot t_2}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq -6.253184033580119 \cdot 10^{-243}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \sqrt{{t_3}^{2}}\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 1.6582340324706763 \cdot 10^{-307}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x-scale \leq 5.147224452517122 \cdot 10^{-270}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(t_2 \cdot {\left({t_1}^{3}\right)}^{0.3333333333333333}\right)\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 8.191269321848878 \cdot 10^{-218}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(t_0 \cdot t_5\right)\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 1.4303173329051239 \cdot 10^{-126}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \left(t_5 \cdot \left(t_0 + \left({angle}^{3} \cdot {\pi}^{3}\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right)\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 8.962533660054582 \cdot 10^{-101}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(x-scale \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(t_3\right)\right)\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 2.8859830434113404 \cdot 10^{-37}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x-scale \leq 1.8322237614678637 \cdot 10^{+34}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x-scale \leq 7.22517356074486 \cdot 10^{+120}:\\
\;\;\;\;t_7\\
\mathbf{else}:\\
\;\;\;\;t_8\\
\end{array}



Bits error versus a



Bits error versus b



Bits error versus angle



Bits error versus x-scale



Bits error versus y-scale
Results
if x-scale < -3.21167666292609857e154 or 1.8322237614678637e34 < x-scale < 7.2251735607448595e120Initial program 59.9
Simplified58.3
Taylor expanded in x-scale around 0 54.7
Simplified54.7
Taylor expanded in angle around 0 54.7
Taylor expanded in a around inf 37.0
Simplified37.0
Taylor expanded in angle around 0 36.9
Simplified32.1
if -3.21167666292609857e154 < x-scale < -9.84452925613738043e111 or -1.242420305716196e-42 < x-scale < -5.6248734637854445e-99 or 2.8859830434113404e-37 < x-scale < 1.8322237614678637e34Initial program 52.1
Simplified51.3
Taylor expanded in x-scale around 0 49.8
Simplified49.8
Taylor expanded in angle around 0 50.3
Taylor expanded in a around 0 38.8
Simplified38.7
if -9.84452925613738043e111 < x-scale < -1.242420305716196e-42 or 7.2251735607448595e120 < x-scale Initial program 58.6
Simplified57.4
Taylor expanded in x-scale around 0 54.4
Simplified54.4
Taylor expanded in angle around 0 54.7
Taylor expanded in a around inf 37.2
Simplified37.1
Taylor expanded in x-scale around 0 32.5
if -5.6248734637854445e-99 < x-scale < -4.8060553385269945e-197Initial program 51.2
Simplified48.7
Taylor expanded in x-scale around 0 47.8
Simplified47.8
Taylor expanded in angle around 0 47.7
Taylor expanded in a around inf 38.2
Simplified36.5
Applied egg-rr34.6
if -4.8060553385269945e-197 < x-scale < -6.25318403358011933e-243Initial program 55.4
Simplified51.6
Taylor expanded in x-scale around 0 51.5
Simplified51.5
Taylor expanded in angle around 0 50.6
Taylor expanded in a around inf 38.3
Simplified38.1
Applied egg-rr36.4
if -6.25318403358011933e-243 < x-scale < 1.6582340324706763e-307 or 8.96253366005458249e-101 < x-scale < 2.8859830434113404e-37Initial program 51.4
Simplified48.6
Taylor expanded in x-scale around 0 47.3
Simplified47.3
Taylor expanded in angle around 0 47.6
Taylor expanded in a around inf 38.6
Simplified37.1
Applied egg-rr37.2
if 1.6582340324706763e-307 < x-scale < 5.1472244525171218e-270Initial program 53.4
Simplified47.8
Taylor expanded in x-scale around 0 44.7
Simplified44.7
Taylor expanded in angle around 0 46.2
Taylor expanded in a around inf 36.9
Simplified35.1
Applied egg-rr32.5
if 5.1472244525171218e-270 < x-scale < 8.19126932184887821e-218Initial program 50.7
Simplified46.6
Taylor expanded in x-scale around 0 44.3
Simplified44.3
Taylor expanded in angle around 0 44.2
Taylor expanded in a around inf 39.8
Simplified39.2
Taylor expanded in angle around 0 37.9
if 8.19126932184887821e-218 < x-scale < 1.4303173329051239e-126Initial program 49.8
Simplified47.6
Taylor expanded in x-scale around 0 46.2
Simplified46.2
Taylor expanded in angle around 0 46.4
Taylor expanded in a around inf 41.3
Simplified39.7
Taylor expanded in angle around 0 38.5
if 1.4303173329051239e-126 < x-scale < 8.96253366005458249e-101Initial program 49.2
Simplified48.4
Taylor expanded in x-scale around 0 48.7
Simplified48.7
Taylor expanded in angle around 0 48.5
Taylor expanded in a around inf 39.5
Simplified36.8
Applied egg-rr38.4
Final simplification34.9
herbie shell --seed 2022151
(FPCore (a b angle x-scale y-scale)
:name "raw-angle from scale-rotated-ellipse"
:precision binary64
(* 180.0 (/ (atan (/ (- (- (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale) (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale) 2.0)))) (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale))) PI)))