
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = math.sin(t_0) t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cos(t_0) t_2 = sin(t_0) t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale) t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = cos(t_0); t_2 = sin(t_0); t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale; t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale; tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\pi}
\end{array}
\end{array}
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 5.6e-18)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (sin t_0) (cos t_0)))) PI))
(/
(*
180.0
(atan
(*
(/ y-scale x-scale)
(/
-1.0
(tan (* (* 0.005555555555555556 angle) (pow (sqrt PI) 2.0)))))))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 5.6e-18) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan(((0.005555555555555556 * angle) * pow(sqrt(((double) M_PI)), 2.0))))))) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 5.6e-18) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(t_0) / Math.cos(t_0)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / Math.tan(((0.005555555555555556 * angle) * Math.pow(Math.sqrt(Math.PI), 2.0))))))) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 5.6e-18: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (math.sin(t_0) / math.cos(t_0)))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / math.tan(((0.005555555555555556 * angle) * math.pow(math.sqrt(math.pi), 2.0))))))) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 5.6e-18) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(t_0) / cos(t_0)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / tan(Float64(Float64(0.005555555555555556 * angle) * (sqrt(pi) ^ 2.0))))))) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 5.6e-18) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / pi); else tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan(((0.005555555555555556 * angle) * (sqrt(pi) ^ 2.0))))))) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 5.6e-18], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 5.6 \cdot 10^{-18}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin t\_0}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot {\left(\sqrt{\pi}\right)}^{2}\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.60000000000000025e-18Initial program 15.3%
Simplified10.6%
Taylor expanded in x-scale around 0 28.2%
Simplified31.5%
Taylor expanded in a around inf 46.9%
times-frac49.9%
Simplified49.9%
if 5.60000000000000025e-18 < b Initial program 15.1%
Simplified7.3%
Taylor expanded in x-scale around 0 18.6%
Simplified20.1%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
times-frac58.1%
Simplified58.1%
associate-*r/58.1%
distribute-lft-neg-in58.1%
clear-num58.1%
quot-tan58.1%
associate-*r*56.4%
Applied egg-rr56.4%
add-sqr-sqrt62.2%
pow262.2%
Applied egg-rr62.2%
Final simplification53.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 3.4e-18)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (sin t_0) (cos t_0)))) PI))
(/ (* (atan (* (/ y-scale x-scale) (/ 1.0 (tan t_0)))) (- 180.0)) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 3.4e-18) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / ((double) M_PI));
} else {
tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / tan(t_0)))) * -180.0) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 3.4e-18) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(t_0) / Math.cos(t_0)))) / Math.PI);
} else {
tmp = (Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan(t_0)))) * -180.0) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 3.4e-18: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (math.sin(t_0) / math.cos(t_0)))) / math.pi) else: tmp = (math.atan(((y_45_scale / x_45_scale) * (1.0 / math.tan(t_0)))) * -180.0) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 3.4e-18) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(t_0) / cos(t_0)))) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(t_0)))) * Float64(-180.0)) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 3.4e-18) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / cos(t_0)))) / pi); else tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / tan(t_0)))) * -180.0) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 3.4e-18], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-180.0)), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 3.4 \cdot 10^{-18}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin t\_0}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan t\_0}\right) \cdot \left(-180\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.40000000000000001e-18Initial program 15.3%
Simplified10.6%
Taylor expanded in x-scale around 0 28.2%
Simplified31.5%
Taylor expanded in a around inf 46.9%
times-frac49.9%
Simplified49.9%
if 3.40000000000000001e-18 < b Initial program 15.1%
Simplified7.3%
Taylor expanded in x-scale around 0 18.6%
Simplified20.1%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
times-frac58.1%
Simplified58.1%
associate-*r/58.1%
distribute-lft-neg-in58.1%
clear-num58.1%
quot-tan58.1%
associate-*r*56.4%
Applied egg-rr56.4%
distribute-lft-neg-out56.4%
atan-neg56.4%
associate-*l*58.1%
Applied egg-rr58.1%
Final simplification52.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b_m 6.5e-18)
(* 180.0 (/ (atan (* y-scale (/ (sin t_0) (* x-scale (cos t_0))))) PI))
(/ (* (atan (* (/ y-scale x-scale) (/ 1.0 (tan t_0)))) (- 180.0)) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 6.5e-18) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (x_45_scale * cos(t_0))))) / ((double) M_PI));
} else {
tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / tan(t_0)))) * -180.0) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 6.5e-18) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_0) / (x_45_scale * Math.cos(t_0))))) / Math.PI);
} else {
tmp = (Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan(t_0)))) * -180.0) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 6.5e-18: tmp = 180.0 * (math.atan((y_45_scale * (math.sin(t_0) / (x_45_scale * math.cos(t_0))))) / math.pi) else: tmp = (math.atan(((y_45_scale / x_45_scale) * (1.0 / math.tan(t_0)))) * -180.0) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 6.5e-18) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_0) / Float64(x_45_scale * cos(t_0))))) / pi)); else tmp = Float64(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(t_0)))) * Float64(-180.0)) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 6.5e-18) tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (x_45_scale * cos(t_0))))) / pi); else tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / tan(t_0)))) * -180.0) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 6.5e-18], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$0], $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-180.0)), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 6.5 \cdot 10^{-18}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan t\_0}\right) \cdot \left(-180\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.50000000000000008e-18Initial program 15.3%
Simplified10.6%
Taylor expanded in b around 0 5.8%
Simplified5.9%
Taylor expanded in y-scale around inf 26.2%
mul-1-neg26.2%
associate-*r*27.7%
Simplified27.7%
Taylor expanded in a around inf 46.9%
associate-/l*47.3%
*-commutative47.3%
Simplified47.3%
if 6.50000000000000008e-18 < b Initial program 15.1%
Simplified7.3%
Taylor expanded in x-scale around 0 18.6%
Simplified20.1%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
times-frac58.1%
Simplified58.1%
associate-*r/58.1%
distribute-lft-neg-in58.1%
clear-num58.1%
quot-tan58.1%
associate-*r*56.4%
Applied egg-rr56.4%
distribute-lft-neg-out56.4%
atan-neg56.4%
associate-*l*58.1%
Applied egg-rr58.1%
Final simplification50.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (tan (* 0.005555555555555556 (* angle PI)))))
(if (<= b_m 5.8e-174)
(fabs (* (atan (/ (/ y-scale (- x-scale)) t_0)) (/ 180.0 PI)))
(/ (* (atan (* (/ y-scale x-scale) (/ 1.0 t_0))) (- 180.0)) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = tan((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b_m <= 5.8e-174) {
tmp = fabs((atan(((y_45_scale / -x_45_scale) / t_0)) * (180.0 / ((double) M_PI))));
} else {
tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / t_0))) * -180.0) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.tan((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b_m <= 5.8e-174) {
tmp = Math.abs((Math.atan(((y_45_scale / -x_45_scale) / t_0)) * (180.0 / Math.PI)));
} else {
tmp = (Math.atan(((y_45_scale / x_45_scale) * (1.0 / t_0))) * -180.0) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.tan((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b_m <= 5.8e-174: tmp = math.fabs((math.atan(((y_45_scale / -x_45_scale) / t_0)) * (180.0 / math.pi))) else: tmp = (math.atan(((y_45_scale / x_45_scale) * (1.0 / t_0))) * -180.0) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = tan(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b_m <= 5.8e-174) tmp = abs(Float64(atan(Float64(Float64(y_45_scale / Float64(-x_45_scale)) / t_0)) * Float64(180.0 / pi))); else tmp = Float64(Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / t_0))) * Float64(-180.0)) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = tan((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b_m <= 5.8e-174) tmp = abs((atan(((y_45_scale / -x_45_scale) / t_0)) * (180.0 / pi))); else tmp = (atan(((y_45_scale / x_45_scale) * (1.0 / t_0))) * -180.0) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 5.8e-174], N[Abs[N[(N[ArcTan[N[(N[(y$45$scale / (-x$45$scale)), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-180.0)), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b\_m \leq 5.8 \cdot 10^{-174}:\\
\;\;\;\;\left|\tan^{-1} \left(\frac{\frac{y-scale}{-x-scale}}{t\_0}\right) \cdot \frac{180}{\pi}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{t\_0}\right) \cdot \left(-180\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.8000000000000002e-174Initial program 15.0%
Simplified10.4%
Taylor expanded in x-scale around 0 27.6%
Simplified31.1%
Taylor expanded in a around 0 42.6%
mul-1-neg42.6%
times-frac43.6%
Simplified43.6%
associate-*r/43.6%
distribute-lft-neg-in43.6%
clear-num43.6%
quot-tan43.6%
associate-*r*44.8%
Applied egg-rr44.8%
associate-*r/44.8%
add-sqr-sqrt25.6%
pow1/225.6%
pow1/225.6%
pow-prod-down36.6%
Applied egg-rr36.6%
unpow1/236.6%
unpow236.6%
rem-sqrt-square37.1%
associate-*r/37.1%
Simplified37.1%
if 5.8000000000000002e-174 < b Initial program 15.7%
Simplified8.3%
Taylor expanded in x-scale around 0 21.4%
Simplified22.9%
Taylor expanded in a around 0 50.7%
mul-1-neg50.7%
times-frac54.3%
Simplified54.3%
associate-*r/54.4%
distribute-lft-neg-in54.4%
clear-num54.4%
quot-tan54.4%
associate-*r*53.1%
Applied egg-rr53.1%
distribute-lft-neg-out53.1%
atan-neg53.1%
associate-*l*54.4%
Applied egg-rr54.4%
Final simplification43.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= y-scale 1.9e+128)
(/
(*
180.0
(atan
(*
(/ y-scale x-scale)
(/ -1.0 (tan (* PI (* 0.005555555555555556 angle)))))))
PI)
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/
(+
(*
(pow angle 2.0)
(- (* PI -0.000925925925925926) (* PI -0.002777777777777778)))
(* 180.0 (/ -1.0 PI)))
angle)))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 1.9e+128) {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan((((double) M_PI) * (0.005555555555555556 * angle))))))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (((pow(angle, 2.0) * ((((double) M_PI) * -0.000925925925925926) - (((double) M_PI) * -0.002777777777777778))) + (180.0 * (-1.0 / ((double) M_PI)))) / angle))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 1.9e+128) {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / Math.tan((Math.PI * (0.005555555555555556 * angle))))))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (((Math.pow(angle, 2.0) * ((Math.PI * -0.000925925925925926) - (Math.PI * -0.002777777777777778))) + (180.0 * (-1.0 / Math.PI))) / angle))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= 1.9e+128: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / math.tan((math.pi * (0.005555555555555556 * angle))))))) / math.pi else: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (((math.pow(angle, 2.0) * ((math.pi * -0.000925925925925926) - (math.pi * -0.002777777777777778))) + (180.0 * (-1.0 / math.pi))) / angle))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= 1.9e+128) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / tan(Float64(pi * Float64(0.005555555555555556 * angle))))))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(Float64(Float64((angle ^ 2.0) * Float64(Float64(pi * -0.000925925925925926) - Float64(pi * -0.002777777777777778))) + Float64(180.0 * Float64(-1.0 / pi))) / angle))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= 1.9e+128) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan((pi * (0.005555555555555556 * angle))))))) / pi; else tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * ((((angle ^ 2.0) * ((pi * -0.000925925925925926) - (pi * -0.002777777777777778))) + (180.0 * (-1.0 / pi))) / angle))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, 1.9e+128], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[(N[(N[Power[angle, 2.0], $MachinePrecision] * N[(N[(Pi * -0.000925925925925926), $MachinePrecision] - N[(Pi * -0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(180.0 * N[(-1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq 1.9 \cdot 10^{+128}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{\tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{{angle}^{2} \cdot \left(\pi \cdot -0.000925925925925926 - \pi \cdot -0.002777777777777778\right) + 180 \cdot \frac{-1}{\pi}}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if y-scale < 1.89999999999999995e128Initial program 11.8%
Simplified7.6%
Taylor expanded in x-scale around 0 24.3%
Simplified27.2%
Taylor expanded in a around 0 46.1%
mul-1-neg46.1%
times-frac48.6%
Simplified48.6%
associate-*r/48.6%
distribute-lft-neg-in48.6%
clear-num48.6%
quot-tan48.6%
associate-*r*49.5%
Applied egg-rr49.5%
if 1.89999999999999995e128 < y-scale Initial program 28.7%
Simplified17.5%
Taylor expanded in x-scale around 0 29.4%
Simplified31.7%
Taylor expanded in a around 0 43.2%
mul-1-neg43.2%
times-frac43.2%
Simplified43.2%
Taylor expanded in angle around 0 50.6%
Final simplification49.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (or (<= angle -6.5e+109) (not (<= angle 5.9e+85)))
(* 180.0 (/ (atan (/ y-scale (* x-scale (- (tan t_0))))) PI))
(/ (* 180.0 (atan (* (/ y-scale x-scale) (/ -1.0 t_0)))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if ((angle <= -6.5e+109) || !(angle <= 5.9e+85)) {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -tan(t_0)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / ((double) M_PI);
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if ((angle <= -6.5e+109) || !(angle <= 5.9e+85)) {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -Math.tan(t_0)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / Math.PI;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if (angle <= -6.5e+109) or not (angle <= 5.9e+85): tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -math.tan(t_0)))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / math.pi return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if ((angle <= -6.5e+109) || !(angle <= 5.9e+85)) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-tan(t_0))))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / t_0)))) / pi); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if ((angle <= -6.5e+109) || ~((angle <= 5.9e+85))) tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -tan(t_0)))) / pi); else tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / t_0)))) / pi; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[angle, -6.5e+109], N[Not[LessEqual[angle, 5.9e+85]], $MachinePrecision]], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-N[Tan[t$95$0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;angle \leq -6.5 \cdot 10^{+109} \lor \neg \left(angle \leq 5.9 \cdot 10^{+85}\right):\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-\tan t\_0\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if angle < -6.5e109 or 5.9e85 < angle Initial program 11.9%
Simplified7.5%
Taylor expanded in x-scale around 0 17.0%
Simplified17.7%
Taylor expanded in a around 0 40.7%
mul-1-neg40.7%
times-frac40.7%
Simplified40.7%
associate-*r/40.7%
distribute-lft-neg-in40.7%
clear-num40.7%
quot-tan40.7%
associate-*r*40.5%
Applied egg-rr40.5%
Taylor expanded in y-scale around 0 40.7%
mul-1-neg40.7%
Simplified40.7%
if -6.5e109 < angle < 5.9e85Initial program 17.0%
Simplified10.8%
Taylor expanded in x-scale around 0 29.8%
Simplified33.7%
Taylor expanded in a around 0 48.1%
mul-1-neg48.1%
times-frac51.1%
Simplified51.1%
associate-*r/51.1%
distribute-lft-neg-in51.1%
clear-num51.1%
quot-tan51.1%
associate-*r*51.7%
Applied egg-rr51.7%
Taylor expanded in angle around 0 53.1%
Final simplification48.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(*
180.0
(/
(atan
(*
(/ y-scale x-scale)
(/ 1.0 (tan (* PI (* 0.005555555555555556 angle))))))
(- PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((y_45_scale / x_45_scale) * (1.0 / tan((((double) M_PI) * (0.005555555555555556 * angle)))))) / -((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (1.0 / Math.tan((Math.PI * (0.005555555555555556 * angle)))))) / -Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((y_45_scale / x_45_scale) * (1.0 / math.tan((math.pi * (0.005555555555555556 * angle)))))) / -math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(1.0 / tan(Float64(pi * Float64(0.005555555555555556 * angle)))))) / Float64(-pi))) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (1.0 / tan((pi * (0.005555555555555556 * angle)))))) / -pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(1.0 / N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{1}{\tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)}{-\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
atan-neg47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Final simplification47.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(/
(*
180.0
(atan
(*
(/ y-scale x-scale)
(/ -1.0 (tan (* PI (* 0.005555555555555556 angle)))))))
PI))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan((((double) M_PI) * (0.005555555555555556 * angle))))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / Math.tan((Math.PI * (0.005555555555555556 * angle))))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / math.tan((math.pi * (0.005555555555555556 * angle))))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / tan(Float64(pi * Float64(0.005555555555555556 * angle))))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / tan((pi * (0.005555555555555556 * angle))))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{\tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Final simplification47.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(/
(*
180.0
(atan
(/ (/ y-scale (- x-scale)) (tan (* 0.005555555555555556 (* angle PI))))))
PI))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan(((y_45_scale / -x_45_scale) / tan((0.005555555555555556 * (angle * ((double) M_PI))))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan(((y_45_scale / -x_45_scale) / Math.tan((0.005555555555555556 * (angle * Math.PI)))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan(((y_45_scale / -x_45_scale) / math.tan((0.005555555555555556 * (angle * math.pi)))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / Float64(-x_45_scale)) / tan(Float64(0.005555555555555556 * Float64(angle * pi)))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan(((y_45_scale / -x_45_scale) / tan((0.005555555555555556 * (angle * pi)))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / (-x$45$scale)), $MachinePrecision] / N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(\frac{\frac{y-scale}{-x-scale}}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Taylor expanded in y-scale around 0 45.5%
associate-/r*47.5%
associate-*r/47.5%
neg-mul-147.5%
distribute-frac-neg247.5%
Simplified47.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (atan (/ (/ y-scale (- x-scale)) (tan (* 0.005555555555555556 (* angle PI))))) (/ 180.0 PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return atan(((y_45_scale / -x_45_scale) / tan((0.005555555555555556 * (angle * ((double) M_PI)))))) * (180.0 / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return Math.atan(((y_45_scale / -x_45_scale) / Math.tan((0.005555555555555556 * (angle * Math.PI))))) * (180.0 / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return math.atan(((y_45_scale / -x_45_scale) / math.tan((0.005555555555555556 * (angle * math.pi))))) * (180.0 / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(atan(Float64(Float64(y_45_scale / Float64(-x_45_scale)) / tan(Float64(0.005555555555555556 * Float64(angle * pi))))) * Float64(180.0 / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = atan(((y_45_scale / -x_45_scale) / tan((0.005555555555555556 * (angle * pi))))) * (180.0 / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[ArcTan[N[(N[(y$45$scale / (-x$45$scale)), $MachinePrecision] / N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\tan^{-1} \left(\frac{\frac{y-scale}{-x-scale}}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \frac{180}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Taylor expanded in y-scale around 0 45.5%
associate-*r/45.5%
*-commutative45.5%
associate-*r/45.5%
associate-/r*47.5%
associate-*r/47.5%
neg-mul-147.5%
distribute-frac-neg247.5%
Simplified47.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle PI))))) (- PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((y_45_scale / x_45_scale) / tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / -((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((y_45_scale / x_45_scale) / Math.tan((0.005555555555555556 * (angle * Math.PI))))) / -Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((y_45_scale / x_45_scale) / math.tan((0.005555555555555556 * (angle * math.pi))))) / -math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) / tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / Float64(-pi))) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) / tan((0.005555555555555556 * (angle * pi))))) / -pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] / N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale}{x-scale}}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}{-\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
atan-neg47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
associate-*r/47.8%
*-rgt-identity47.8%
associate-*r*47.5%
Simplified47.5%
Final simplification47.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(/
(*
180.0
(atan
(* (/ y-scale x-scale) (/ -1.0 (* 0.005555555555555556 (* angle PI))))))
PI))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / (0.005555555555555556 * (angle * ((double) M_PI))))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan(((y_45_scale / x_45_scale) * (-1.0 / (0.005555555555555556 * (angle * Math.PI)))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan(((y_45_scale / x_45_scale) * (-1.0 / (0.005555555555555556 * (angle * math.pi)))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(-1.0 / Float64(0.005555555555555556 * Float64(angle * pi)))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * (-1.0 / (0.005555555555555556 * (angle * pi)))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(-1.0 / N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-1}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 42.3%
Final simplification42.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (- 180.0) (* angle PI)))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((y_45_scale / x_45_scale) * (-180.0 / (angle * ((double) M_PI))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (-180.0 / (angle * Math.PI)))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((y_45_scale / x_45_scale) * (-180.0 / (angle * math.pi)))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(Float64(-180.0) / Float64(angle * pi)))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (-180.0 / (angle * pi)))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[((-180.0) / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{-180}{angle \cdot \pi}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
Taylor expanded in angle around 0 42.3%
Final simplification42.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (/ (* 180.0 (atan (* -180.0 (/ y-scale (* PI (* x-scale angle)))))) PI))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan((-180.0 * (y_45_scale / (((double) M_PI) * (x_45_scale * angle)))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan((-180.0 * (y_45_scale / (Math.PI * (x_45_scale * angle)))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan((-180.0 * (y_45_scale / (math.pi * (x_45_scale * angle)))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(pi * Float64(x_45_scale * angle)))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan((-180.0 * (y_45_scale / (pi * (x_45_scale * angle)))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(Pi * N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\pi \cdot \left(x-scale \cdot angle\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 40.4%
associate-*r*40.4%
*-commutative40.4%
*-commutative40.4%
Simplified40.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (/ (* 180.0 (atan (* -180.0 (/ y-scale (* angle (* x-scale PI)))))) PI))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan((-180.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI))))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * Math.PI)))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * math.pi)))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi)))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi)))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in x-scale around 0 25.4%
Simplified28.1%
Taylor expanded in a around 0 45.5%
mul-1-neg45.5%
times-frac47.5%
Simplified47.5%
associate-*r/47.5%
distribute-lft-neg-in47.5%
clear-num47.5%
quot-tan47.5%
associate-*r*47.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 40.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (* y-scale -180.0) (* PI (* x-scale angle)))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((y_45_scale * -180.0) / (((double) M_PI) * (x_45_scale * angle)))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((y_45_scale * -180.0) / (Math.PI * (x_45_scale * angle)))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((y_45_scale * -180.0) / (math.pi * (x_45_scale * angle)))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * -180.0) / Float64(pi * Float64(x_45_scale * angle)))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((y_45_scale * -180.0) / (pi * (x_45_scale * angle)))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{\pi \cdot \left(x-scale \cdot angle\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in angle around 0 10.4%
associate-*r/10.4%
distribute-lft-out--10.4%
Simplified10.4%
Taylor expanded in a around 0 40.3%
associate-*r/40.3%
associate-*r*40.3%
Applied egg-rr40.3%
Final simplification40.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in angle around 0 10.4%
associate-*r/10.4%
distribute-lft-out--10.4%
Simplified10.4%
Taylor expanded in a around 0 40.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 15.3%
Simplified9.6%
Taylor expanded in angle around 0 10.4%
associate-*r/10.4%
distribute-lft-out--10.4%
Simplified10.4%
Taylor expanded in a around inf 12.0%
herbie shell --seed 2024148
(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)))