(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 (* PI (* 0.005555555555555556 angle)))
(t_1 (* 0.005555555555555556 (* angle PI)))
(t_2 (sin t_1))
(t_3 (cos t_0))
(t_4 (cos t_1))
(t_5
(*
(atan (* x-scale (* y-scale (/ t_2 (* (pow x-scale 2.0) t_4)))))
(/ 180.0 PI)))
(t_6
(*
(/ 180.0 PI)
(atan
(* x-scale (* y-scale (/ (- t_4) (* t_2 (pow x-scale 2.0))))))))
(t_7 (sin t_0))
(t_8
(*
(/ 180.0 PI)
(atan
(* x-scale (* y-scale (/ (- t_3) (* t_7 (* x-scale x-scale))))))))
(t_9 (/ t_7 (* x-scale (* x-scale t_3))))
(t_10 (* (* x-scale a) (* x-scale a))))
(if (<= x-scale -2.3273358225878017e+33)
t_5
(if (<= x-scale -1.7544344154926862e-68)
t_8
(if (<= x-scale -4.534307734857159e-308)
t_5
(if (<= x-scale 6.895664114487812e-139)
t_6
(if (<= x-scale 2.4232374911042355e-95)
t_5
(if (<= x-scale 1.1138736257067423e-41)
t_8
(if (<= x-scale 2.0880495689654187e-9)
(* (/ 180.0 PI) (atan (* x-scale (* y-scale t_9))))
(if (<= x-scale 1.8347736864239356e+50)
t_6
(if (<= x-scale 9.063302108862638e+81)
(*
(/ 180.0 PI)
(atan
(*
x-scale
(*
y-scale
(+
t_9
(*
(* b b)
(+ (/ (/ t_3 t_10) t_7) (/ t_7 (* t_3 t_10)))))))))
t_5)))))))))))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 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_2 = sin(t_1);
double t_3 = cos(t_0);
double t_4 = cos(t_1);
double t_5 = atan((x_45_scale * (y_45_scale * (t_2 / (pow(x_45_scale, 2.0) * t_4))))) * (180.0 / ((double) M_PI));
double t_6 = (180.0 / ((double) M_PI)) * atan((x_45_scale * (y_45_scale * (-t_4 / (t_2 * pow(x_45_scale, 2.0))))));
double t_7 = sin(t_0);
double t_8 = (180.0 / ((double) M_PI)) * atan((x_45_scale * (y_45_scale * (-t_3 / (t_7 * (x_45_scale * x_45_scale))))));
double t_9 = t_7 / (x_45_scale * (x_45_scale * t_3));
double t_10 = (x_45_scale * a) * (x_45_scale * a);
double tmp;
if (x_45_scale <= -2.3273358225878017e+33) {
tmp = t_5;
} else if (x_45_scale <= -1.7544344154926862e-68) {
tmp = t_8;
} else if (x_45_scale <= -4.534307734857159e-308) {
tmp = t_5;
} else if (x_45_scale <= 6.895664114487812e-139) {
tmp = t_6;
} else if (x_45_scale <= 2.4232374911042355e-95) {
tmp = t_5;
} else if (x_45_scale <= 1.1138736257067423e-41) {
tmp = t_8;
} else if (x_45_scale <= 2.0880495689654187e-9) {
tmp = (180.0 / ((double) M_PI)) * atan((x_45_scale * (y_45_scale * t_9)));
} else if (x_45_scale <= 1.8347736864239356e+50) {
tmp = t_6;
} else if (x_45_scale <= 9.063302108862638e+81) {
tmp = (180.0 / ((double) M_PI)) * atan((x_45_scale * (y_45_scale * (t_9 + ((b * b) * (((t_3 / t_10) / t_7) + (t_7 / (t_3 * t_10))))))));
} else {
tmp = t_5;
}
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 = Math.PI * (0.005555555555555556 * angle);
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double t_2 = Math.sin(t_1);
double t_3 = Math.cos(t_0);
double t_4 = Math.cos(t_1);
double t_5 = Math.atan((x_45_scale * (y_45_scale * (t_2 / (Math.pow(x_45_scale, 2.0) * t_4))))) * (180.0 / Math.PI);
double t_6 = (180.0 / Math.PI) * Math.atan((x_45_scale * (y_45_scale * (-t_4 / (t_2 * Math.pow(x_45_scale, 2.0))))));
double t_7 = Math.sin(t_0);
double t_8 = (180.0 / Math.PI) * Math.atan((x_45_scale * (y_45_scale * (-t_3 / (t_7 * (x_45_scale * x_45_scale))))));
double t_9 = t_7 / (x_45_scale * (x_45_scale * t_3));
double t_10 = (x_45_scale * a) * (x_45_scale * a);
double tmp;
if (x_45_scale <= -2.3273358225878017e+33) {
tmp = t_5;
} else if (x_45_scale <= -1.7544344154926862e-68) {
tmp = t_8;
} else if (x_45_scale <= -4.534307734857159e-308) {
tmp = t_5;
} else if (x_45_scale <= 6.895664114487812e-139) {
tmp = t_6;
} else if (x_45_scale <= 2.4232374911042355e-95) {
tmp = t_5;
} else if (x_45_scale <= 1.1138736257067423e-41) {
tmp = t_8;
} else if (x_45_scale <= 2.0880495689654187e-9) {
tmp = (180.0 / Math.PI) * Math.atan((x_45_scale * (y_45_scale * t_9)));
} else if (x_45_scale <= 1.8347736864239356e+50) {
tmp = t_6;
} else if (x_45_scale <= 9.063302108862638e+81) {
tmp = (180.0 / Math.PI) * Math.atan((x_45_scale * (y_45_scale * (t_9 + ((b * b) * (((t_3 / t_10) / t_7) + (t_7 / (t_3 * t_10))))))));
} else {
tmp = t_5;
}
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 = math.pi * (0.005555555555555556 * angle) t_1 = 0.005555555555555556 * (angle * math.pi) t_2 = math.sin(t_1) t_3 = math.cos(t_0) t_4 = math.cos(t_1) t_5 = math.atan((x_45_scale * (y_45_scale * (t_2 / (math.pow(x_45_scale, 2.0) * t_4))))) * (180.0 / math.pi) t_6 = (180.0 / math.pi) * math.atan((x_45_scale * (y_45_scale * (-t_4 / (t_2 * math.pow(x_45_scale, 2.0)))))) t_7 = math.sin(t_0) t_8 = (180.0 / math.pi) * math.atan((x_45_scale * (y_45_scale * (-t_3 / (t_7 * (x_45_scale * x_45_scale)))))) t_9 = t_7 / (x_45_scale * (x_45_scale * t_3)) t_10 = (x_45_scale * a) * (x_45_scale * a) tmp = 0 if x_45_scale <= -2.3273358225878017e+33: tmp = t_5 elif x_45_scale <= -1.7544344154926862e-68: tmp = t_8 elif x_45_scale <= -4.534307734857159e-308: tmp = t_5 elif x_45_scale <= 6.895664114487812e-139: tmp = t_6 elif x_45_scale <= 2.4232374911042355e-95: tmp = t_5 elif x_45_scale <= 1.1138736257067423e-41: tmp = t_8 elif x_45_scale <= 2.0880495689654187e-9: tmp = (180.0 / math.pi) * math.atan((x_45_scale * (y_45_scale * t_9))) elif x_45_scale <= 1.8347736864239356e+50: tmp = t_6 elif x_45_scale <= 9.063302108862638e+81: tmp = (180.0 / math.pi) * math.atan((x_45_scale * (y_45_scale * (t_9 + ((b * b) * (((t_3 / t_10) / t_7) + (t_7 / (t_3 * t_10)))))))) else: tmp = t_5 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(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) t_2 = sin(t_1) t_3 = cos(t_0) t_4 = cos(t_1) t_5 = Float64(atan(Float64(x_45_scale * Float64(y_45_scale * Float64(t_2 / Float64((x_45_scale ^ 2.0) * t_4))))) * Float64(180.0 / pi)) t_6 = Float64(Float64(180.0 / pi) * atan(Float64(x_45_scale * Float64(y_45_scale * Float64(Float64(-t_4) / Float64(t_2 * (x_45_scale ^ 2.0))))))) t_7 = sin(t_0) t_8 = Float64(Float64(180.0 / pi) * atan(Float64(x_45_scale * Float64(y_45_scale * Float64(Float64(-t_3) / Float64(t_7 * Float64(x_45_scale * x_45_scale))))))) t_9 = Float64(t_7 / Float64(x_45_scale * Float64(x_45_scale * t_3))) t_10 = Float64(Float64(x_45_scale * a) * Float64(x_45_scale * a)) tmp = 0.0 if (x_45_scale <= -2.3273358225878017e+33) tmp = t_5; elseif (x_45_scale <= -1.7544344154926862e-68) tmp = t_8; elseif (x_45_scale <= -4.534307734857159e-308) tmp = t_5; elseif (x_45_scale <= 6.895664114487812e-139) tmp = t_6; elseif (x_45_scale <= 2.4232374911042355e-95) tmp = t_5; elseif (x_45_scale <= 1.1138736257067423e-41) tmp = t_8; elseif (x_45_scale <= 2.0880495689654187e-9) tmp = Float64(Float64(180.0 / pi) * atan(Float64(x_45_scale * Float64(y_45_scale * t_9)))); elseif (x_45_scale <= 1.8347736864239356e+50) tmp = t_6; elseif (x_45_scale <= 9.063302108862638e+81) tmp = Float64(Float64(180.0 / pi) * atan(Float64(x_45_scale * Float64(y_45_scale * Float64(t_9 + Float64(Float64(b * b) * Float64(Float64(Float64(t_3 / t_10) / t_7) + Float64(t_7 / Float64(t_3 * t_10))))))))); else tmp = t_5; end return tmp end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((((((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale) - (((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) - sqrt(((((((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale) - (((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale) ^ 2.0)))) / (((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale))) / pi); end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = pi * (0.005555555555555556 * angle); t_1 = 0.005555555555555556 * (angle * pi); t_2 = sin(t_1); t_3 = cos(t_0); t_4 = cos(t_1); t_5 = atan((x_45_scale * (y_45_scale * (t_2 / ((x_45_scale ^ 2.0) * t_4))))) * (180.0 / pi); t_6 = (180.0 / pi) * atan((x_45_scale * (y_45_scale * (-t_4 / (t_2 * (x_45_scale ^ 2.0)))))); t_7 = sin(t_0); t_8 = (180.0 / pi) * atan((x_45_scale * (y_45_scale * (-t_3 / (t_7 * (x_45_scale * x_45_scale)))))); t_9 = t_7 / (x_45_scale * (x_45_scale * t_3)); t_10 = (x_45_scale * a) * (x_45_scale * a); tmp = 0.0; if (x_45_scale <= -2.3273358225878017e+33) tmp = t_5; elseif (x_45_scale <= -1.7544344154926862e-68) tmp = t_8; elseif (x_45_scale <= -4.534307734857159e-308) tmp = t_5; elseif (x_45_scale <= 6.895664114487812e-139) tmp = t_6; elseif (x_45_scale <= 2.4232374911042355e-95) tmp = t_5; elseif (x_45_scale <= 1.1138736257067423e-41) tmp = t_8; elseif (x_45_scale <= 2.0880495689654187e-9) tmp = (180.0 / pi) * atan((x_45_scale * (y_45_scale * t_9))); elseif (x_45_scale <= 1.8347736864239356e+50) tmp = t_6; elseif (x_45_scale <= 9.063302108862638e+81) tmp = (180.0 / pi) * atan((x_45_scale * (y_45_scale * (t_9 + ((b * b) * (((t_3 / t_10) / t_7) + (t_7 / (t_3 * t_10)))))))); else tmp = t_5; end tmp_2 = 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[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$5 = N[(N[ArcTan[N[(x$45$scale * N[(y$45$scale * N[(t$95$2 / N[(N[Power[x$45$scale, 2.0], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(x$45$scale * N[(y$45$scale * N[((-t$95$4) / N[(t$95$2 * N[Power[x$45$scale, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$8 = N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(x$45$scale * N[(y$45$scale * N[((-t$95$3) / N[(t$95$7 * N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$7 / N[(x$45$scale * N[(x$45$scale * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[(x$45$scale * a), $MachinePrecision] * N[(x$45$scale * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -2.3273358225878017e+33], t$95$5, If[LessEqual[x$45$scale, -1.7544344154926862e-68], t$95$8, If[LessEqual[x$45$scale, -4.534307734857159e-308], t$95$5, If[LessEqual[x$45$scale, 6.895664114487812e-139], t$95$6, If[LessEqual[x$45$scale, 2.4232374911042355e-95], t$95$5, If[LessEqual[x$45$scale, 1.1138736257067423e-41], t$95$8, If[LessEqual[x$45$scale, 2.0880495689654187e-9], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(x$45$scale * N[(y$45$scale * t$95$9), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1.8347736864239356e+50], t$95$6, If[LessEqual[x$45$scale, 9.063302108862638e+81], N[(N[(180.0 / Pi), $MachinePrecision] * N[ArcTan[N[(x$45$scale * N[(y$45$scale * N[(t$95$9 + N[(N[(b * b), $MachinePrecision] * N[(N[(N[(t$95$3 / t$95$10), $MachinePrecision] / t$95$7), $MachinePrecision] + N[(t$95$7 / N[(t$95$3 * t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$5]]]]]]]]]]]]]]]]]]]]
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 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \sin t_1\\
t_3 := \cos t_0\\
t_4 := \cos t_1\\
t_5 := \tan^{-1} \left(x-scale \cdot \left(y-scale \cdot \frac{t_2}{{x-scale}^{2} \cdot t_4}\right)\right) \cdot \frac{180}{\pi}\\
t_6 := \frac{180}{\pi} \cdot \tan^{-1} \left(x-scale \cdot \left(y-scale \cdot \frac{-t_4}{t_2 \cdot {x-scale}^{2}}\right)\right)\\
t_7 := \sin t_0\\
t_8 := \frac{180}{\pi} \cdot \tan^{-1} \left(x-scale \cdot \left(y-scale \cdot \frac{-t_3}{t_7 \cdot \left(x-scale \cdot x-scale\right)}\right)\right)\\
t_9 := \frac{t_7}{x-scale \cdot \left(x-scale \cdot t_3\right)}\\
t_10 := \left(x-scale \cdot a\right) \cdot \left(x-scale \cdot a\right)\\
\mathbf{if}\;x-scale \leq -2.3273358225878017 \cdot 10^{+33}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x-scale \leq -1.7544344154926862 \cdot 10^{-68}:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x-scale \leq -4.534307734857159 \cdot 10^{-308}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x-scale \leq 6.895664114487812 \cdot 10^{-139}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x-scale \leq 2.4232374911042355 \cdot 10^{-95}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x-scale \leq 1.1138736257067423 \cdot 10^{-41}:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x-scale \leq 2.0880495689654187 \cdot 10^{-9}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(x-scale \cdot \left(y-scale \cdot t_9\right)\right)\\
\mathbf{elif}\;x-scale \leq 1.8347736864239356 \cdot 10^{+50}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x-scale \leq 9.063302108862638 \cdot 10^{+81}:\\
\;\;\;\;\frac{180}{\pi} \cdot \tan^{-1} \left(x-scale \cdot \left(y-scale \cdot \left(t_9 + \left(b \cdot b\right) \cdot \left(\frac{\frac{t_3}{t_10}}{t_7} + \frac{t_7}{t_3 \cdot t_10}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_5\\
\end{array}
Results
if x-scale < -2.3273358225878017e33 or -1.7544344154926862e-68 < x-scale < -4.53430773485715935e-308 or 6.8956641144878118e-139 < x-scale < 2.423237491104236e-95 or 9.0633021088626383e81 < x-scale Initial program 56.7
Simplified55.0
Taylor expanded in y-scale around inf 51.0
Simplified43.3
Taylor expanded in angle around inf 43.2
Applied egg-rr43.2
Taylor expanded in b around 0 37.6
if -2.3273358225878017e33 < x-scale < -1.7544344154926862e-68 or 2.423237491104236e-95 < x-scale < 1.1138736257067423e-41Initial program 50.6
Simplified50.1
Taylor expanded in y-scale around inf 46.1
Simplified46.1
Taylor expanded in angle around inf 46.3
Applied egg-rr46.4
Taylor expanded in b around inf 39.6
Simplified38.9
if -4.53430773485715935e-308 < x-scale < 6.8956641144878118e-139 or 2.0880495689654187e-9 < x-scale < 1.8347736864239356e50Initial program 52.6
Simplified49.2
Taylor expanded in y-scale around inf 53.2
Simplified44.5
Taylor expanded in angle around inf 44.8
Applied egg-rr44.8
Taylor expanded in b around inf 36.1
if 1.1138736257067423e-41 < x-scale < 2.0880495689654187e-9Initial program 52.1
Simplified51.8
Taylor expanded in y-scale around inf 47.2
Simplified46.9
Taylor expanded in angle around inf 47.1
Applied egg-rr47.2
Taylor expanded in b around 0 37.7
Simplified37.5
if 1.8347736864239356e50 < x-scale < 9.0633021088626383e81Initial program 53.6
Simplified53.2
Taylor expanded in y-scale around inf 46.1
Simplified44.4
Taylor expanded in angle around inf 45.0
Applied egg-rr45.0
Taylor expanded in b around 0 44.8
Simplified43.4
Final simplification37.7
herbie shell --seed 2022210
(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)))