
(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 12 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))
(t_1 (cos t_0))
(t_2 (* 0.005555555555555556 (* angle PI)))
(t_3 (sin t_0)))
(if (<= b_m 6e-65)
(* 180.0 (/ (atan (* (/ t_3 t_1) (/ y-scale x-scale))) PI))
(if (<= b_m 1.38e+178)
(* 180.0 (/ (atan (/ -1.0 (* t_3 (/ t_1 (/ y-scale x-scale))))) PI))
(*
180.0
(/
(atan
(/ (* y-scale (cos t_2)) (* x-scale (- (sin (pow (cbrt t_2) 3.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 t_1 = cos(t_0);
double t_2 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_3 = sin(t_0);
double tmp;
if (b_m <= 6e-65) {
tmp = 180.0 * (atan(((t_3 / t_1) * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else if (b_m <= 1.38e+178) {
tmp = 180.0 * (atan((-1.0 / (t_3 * (t_1 / (y_45_scale / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((y_45_scale * cos(t_2)) / (x_45_scale * -sin(pow(cbrt(t_2), 3.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 t_1 = Math.cos(t_0);
double t_2 = 0.005555555555555556 * (angle * Math.PI);
double t_3 = Math.sin(t_0);
double tmp;
if (b_m <= 6e-65) {
tmp = 180.0 * (Math.atan(((t_3 / t_1) * (y_45_scale / x_45_scale))) / Math.PI);
} else if (b_m <= 1.38e+178) {
tmp = 180.0 * (Math.atan((-1.0 / (t_3 * (t_1 / (y_45_scale / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.cos(t_2)) / (x_45_scale * -Math.sin(Math.pow(Math.cbrt(t_2), 3.0))))) / Math.PI);
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = cos(t_0) t_2 = Float64(0.005555555555555556 * Float64(angle * pi)) t_3 = sin(t_0) tmp = 0.0 if (b_m <= 6e-65) tmp = Float64(180.0 * Float64(atan(Float64(Float64(t_3 / t_1) * Float64(y_45_scale / x_45_scale))) / pi)); elseif (b_m <= 1.38e+178) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(t_3 * Float64(t_1 / Float64(y_45_scale / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * cos(t_2)) / Float64(x_45_scale * Float64(-sin((cbrt(t_2) ^ 3.0)))))) / pi)); end return 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 6e-65], N[(180.0 * N[(N[ArcTan[N[(N[(t$95$3 / t$95$1), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.38e+178], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(t$95$3 * N[(t$95$1 / N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * (-N[Sin[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_3 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 6 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_3}{t\_1} \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.38 \cdot 10^{+178}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{t\_3 \cdot \frac{t\_1}{\frac{y-scale}{x-scale}}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \cos t\_2}{x-scale \cdot \left(-\sin \left({\left(\sqrt[3]{t\_2}\right)}^{3}\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.99999999999999996e-65Initial program 14.8%
Simplified13.2%
Taylor expanded in x-scale around 0 27.6%
Simplified33.5%
Taylor expanded in a around inf 56.8%
pow156.8%
Applied egg-rr56.8%
unpow156.8%
associate-*r*57.4%
Simplified57.4%
Taylor expanded in y-scale around 0 56.3%
*-commutative56.3%
*-commutative56.3%
times-frac58.8%
associate-*r*59.4%
associate-*r*59.3%
Simplified59.3%
if 5.99999999999999996e-65 < b < 1.37999999999999994e178Initial program 20.4%
Simplified10.3%
Taylor expanded in b around inf 17.6%
associate-*r/17.6%
Simplified17.4%
Taylor expanded in angle around 0 50.6%
clear-num50.6%
inv-pow50.6%
*-commutative50.6%
associate-*r*50.6%
metadata-eval50.6%
Applied egg-rr50.6%
unpow-150.6%
associate-/l*52.5%
associate-*r*55.0%
associate-*r*58.0%
associate-*r/58.0%
mul-1-neg58.0%
Simplified58.0%
if 1.37999999999999994e178 < b Initial program 0.0%
Simplified0.0%
Taylor expanded in x-scale around 0 0.0%
Simplified0.0%
Taylor expanded in a around 0 65.9%
add-cube-cbrt74.1%
pow374.1%
Applied egg-rr74.1%
Final simplification60.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1 (cos t_0))
(t_2 (sin t_0)))
(if (<= b_m 8e-65)
(* 180.0 (/ (atan (* (/ t_2 t_1) (/ y-scale x-scale))) PI))
(if (<= b_m 1.25e+173)
(* 180.0 (/ (atan (/ -1.0 (* t_2 (/ t_1 (/ y-scale x-scale))))) PI))
(*
180.0
(/
(atan
(/
y-scale
(* x-scale (- (sin (* 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) {
double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else if (b_m <= 1.25e+173) {
tmp = 180.0 * (atan((-1.0 / (t_2 * (t_1 / (y_45_scale / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * ((double) M_PI))))))) / ((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 t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (Math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / Math.PI);
} else if (b_m <= 1.25e+173) {
tmp = 180.0 * (Math.atan((-1.0 / (t_2 * (t_1 / (y_45_scale / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -Math.sin((0.005555555555555556 * (angle * Math.PI)))))) / 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 t_1 = math.cos(t_0) t_2 = math.sin(t_0) tmp = 0 if b_m <= 8e-65: tmp = 180.0 * (math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / math.pi) elif b_m <= 1.25e+173: tmp = 180.0 * (math.atan((-1.0 / (t_2 * (t_1 / (y_45_scale / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -math.sin((0.005555555555555556 * (angle * math.pi)))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = cos(t_0) t_2 = sin(t_0) tmp = 0.0 if (b_m <= 8e-65) tmp = Float64(180.0 * Float64(atan(Float64(Float64(t_2 / t_1) * Float64(y_45_scale / x_45_scale))) / pi)); elseif (b_m <= 1.25e+173) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(t_2 * Float64(t_1 / Float64(y_45_scale / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-sin(Float64(0.005555555555555556 * Float64(angle * pi))))))) / 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; t_1 = cos(t_0); t_2 = sin(t_0); tmp = 0.0; if (b_m <= 8e-65) tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / pi); elseif (b_m <= 1.25e+173) tmp = 180.0 * (atan((-1.0 / (t_2 * (t_1 / (y_45_scale / x_45_scale))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * pi)))))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 8e-65], N[(180.0 * N[(N[ArcTan[N[(N[(t$95$2 / t$95$1), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.25e+173], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(t$95$2 * N[(t$95$1 / N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.25 \cdot 10^{+173}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{t\_2 \cdot \frac{t\_1}{\frac{y-scale}{x-scale}}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.99999999999999939e-65Initial program 14.8%
Simplified13.2%
Taylor expanded in x-scale around 0 27.6%
Simplified33.5%
Taylor expanded in a around inf 56.8%
pow156.8%
Applied egg-rr56.8%
unpow156.8%
associate-*r*57.4%
Simplified57.4%
Taylor expanded in y-scale around 0 56.3%
*-commutative56.3%
*-commutative56.3%
times-frac58.8%
associate-*r*59.4%
associate-*r*59.3%
Simplified59.3%
if 7.99999999999999939e-65 < b < 1.25000000000000009e173Initial program 20.9%
Simplified10.5%
Taylor expanded in b around inf 18.0%
associate-*r/18.0%
Simplified17.7%
Taylor expanded in angle around 0 49.6%
clear-num49.6%
inv-pow49.6%
*-commutative49.6%
associate-*r*49.6%
metadata-eval49.6%
Applied egg-rr49.6%
unpow-149.6%
associate-/l*51.6%
associate-*r*54.0%
associate-*r*57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
if 1.25000000000000009e173 < b Initial program 0.0%
Simplified0.0%
Taylor expanded in x-scale around 0 0.0%
Simplified0.0%
Taylor expanded in a around 0 67.2%
Taylor expanded in angle around 0 64.8%
Final simplification59.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1 (cos t_0))
(t_2 (sin t_0)))
(if (<= b_m 8e-65)
(* 180.0 (/ (atan (* (/ t_2 t_1) (/ y-scale x-scale))) PI))
(if (<= b_m 8.5e+45)
(/ (* -180.0 (atan (* (/ y-scale x-scale) (/ t_1 t_2)))) PI)
(*
180.0
(/
(atan
(/
y-scale
(* x-scale (- (sin (* 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) {
double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else if (b_m <= 8.5e+45) {
tmp = (-180.0 * atan(((y_45_scale / x_45_scale) * (t_1 / t_2)))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * ((double) M_PI))))))) / ((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 t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (Math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / Math.PI);
} else if (b_m <= 8.5e+45) {
tmp = (-180.0 * Math.atan(((y_45_scale / x_45_scale) * (t_1 / t_2)))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -Math.sin((0.005555555555555556 * (angle * Math.PI)))))) / 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 t_1 = math.cos(t_0) t_2 = math.sin(t_0) tmp = 0 if b_m <= 8e-65: tmp = 180.0 * (math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / math.pi) elif b_m <= 8.5e+45: tmp = (-180.0 * math.atan(((y_45_scale / x_45_scale) * (t_1 / t_2)))) / math.pi else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -math.sin((0.005555555555555556 * (angle * math.pi)))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = cos(t_0) t_2 = sin(t_0) tmp = 0.0 if (b_m <= 8e-65) tmp = Float64(180.0 * Float64(atan(Float64(Float64(t_2 / t_1) * Float64(y_45_scale / x_45_scale))) / pi)); elseif (b_m <= 8.5e+45) tmp = Float64(Float64(-180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / t_2)))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-sin(Float64(0.005555555555555556 * Float64(angle * pi))))))) / 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; t_1 = cos(t_0); t_2 = sin(t_0); tmp = 0.0; if (b_m <= 8e-65) tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / pi); elseif (b_m <= 8.5e+45) tmp = (-180.0 * atan(((y_45_scale / x_45_scale) * (t_1 / t_2)))) / pi; else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * pi)))))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 8e-65], N[(180.0 * N[(N[ArcTan[N[(N[(t$95$2 / t$95$1), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 8.5e+45], N[(N[(-180.0 * N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 8.5 \cdot 10^{+45}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{t\_2}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.99999999999999939e-65Initial program 14.8%
Simplified13.2%
Taylor expanded in x-scale around 0 27.6%
Simplified33.5%
Taylor expanded in a around inf 56.8%
pow156.8%
Applied egg-rr56.8%
unpow156.8%
associate-*r*57.4%
Simplified57.4%
Taylor expanded in y-scale around 0 56.3%
*-commutative56.3%
*-commutative56.3%
times-frac58.8%
associate-*r*59.4%
associate-*r*59.3%
Simplified59.3%
if 7.99999999999999939e-65 < b < 8.4999999999999996e45Initial program 15.9%
Simplified11.8%
Taylor expanded in x-scale around 0 37.0%
Simplified41.2%
Taylor expanded in a around 0 47.0%
associate-*r/47.0%
mul-1-neg47.0%
atan-neg47.0%
associate-/l*47.0%
Applied egg-rr47.0%
distribute-rgt-neg-out47.0%
distribute-lft-neg-in47.0%
metadata-eval47.0%
associate-*r/47.0%
times-frac50.1%
*-commutative50.1%
associate-*r*50.0%
associate-*r*48.9%
Simplified48.9%
if 8.4999999999999996e45 < b Initial program 12.2%
Simplified4.2%
Taylor expanded in x-scale around 0 20.6%
Simplified20.9%
Taylor expanded in a around 0 60.9%
Taylor expanded in angle around 0 62.9%
Final simplification59.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1 (cos t_0))
(t_2 (sin t_0)))
(if (<= b_m 8e-65)
(* 180.0 (/ (atan (* (/ t_2 t_1) (/ y-scale x-scale))) PI))
(* 180.0 (/ (atan (/ (* t_1 y-scale) (* t_2 (- x-scale)))) 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 t_1 = cos(t_0);
double t_2 = sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((t_1 * y_45_scale) / (t_2 * -x_45_scale))) / ((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 t_1 = Math.cos(t_0);
double t_2 = Math.sin(t_0);
double tmp;
if (b_m <= 8e-65) {
tmp = 180.0 * (Math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((t_1 * y_45_scale) / (t_2 * -x_45_scale))) / 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 t_1 = math.cos(t_0) t_2 = math.sin(t_0) tmp = 0 if b_m <= 8e-65: tmp = 180.0 * (math.atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / math.pi) else: tmp = 180.0 * (math.atan(((t_1 * y_45_scale) / (t_2 * -x_45_scale))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = cos(t_0) t_2 = sin(t_0) tmp = 0.0 if (b_m <= 8e-65) tmp = Float64(180.0 * Float64(atan(Float64(Float64(t_2 / t_1) * Float64(y_45_scale / x_45_scale))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(t_1 * y_45_scale) / Float64(t_2 * Float64(-x_45_scale)))) / 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; t_1 = cos(t_0); t_2 = sin(t_0); tmp = 0.0; if (b_m <= 8e-65) tmp = 180.0 * (atan(((t_2 / t_1) * (y_45_scale / x_45_scale))) / pi); else tmp = 180.0 * (atan(((t_1 * y_45_scale) / (t_2 * -x_45_scale))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 8e-65], N[(180.0 * N[(N[ArcTan[N[(N[(t$95$2 / t$95$1), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(t$95$1 * y$45$scale), $MachinePrecision] / N[(t$95$2 * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{-65}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{t\_1 \cdot y-scale}{t\_2 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.99999999999999939e-65Initial program 14.8%
Simplified13.2%
Taylor expanded in x-scale around 0 27.6%
Simplified33.5%
Taylor expanded in a around inf 56.8%
pow156.8%
Applied egg-rr56.8%
unpow156.8%
associate-*r*57.4%
Simplified57.4%
Taylor expanded in y-scale around 0 56.3%
*-commutative56.3%
*-commutative56.3%
times-frac58.8%
associate-*r*59.4%
associate-*r*59.3%
Simplified59.3%
if 7.99999999999999939e-65 < b Initial program 13.5%
Simplified6.8%
Taylor expanded in x-scale around 0 26.2%
Simplified27.9%
*-un-lft-identity27.9%
*-commutative27.9%
associate-*r*29.2%
metadata-eval29.2%
div-inv29.2%
associate-*r/29.2%
associate-*l/30.4%
*-commutative30.4%
div-inv29.2%
metadata-eval29.2%
Applied egg-rr29.2%
*-lft-identity29.2%
Simplified29.2%
Taylor expanded in a around 0 56.2%
mul-1-neg56.2%
associate-*r*58.1%
*-commutative58.1%
associate-*r*59.8%
Simplified59.8%
Final simplification59.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= b_m 6.5e-164)
(* 180.0 (/ (atan (* (/ (sin t_0) (cos t_0)) (/ y-scale x-scale))) PI))
(if (<= b_m 2.2e+35)
(* 180.0 (/ (atan (* -0.5 (* y-scale (* -2.0 (/ t_1 x-scale))))) PI))
(* 180.0 (/ (atan (/ y-scale (* x-scale (- t_1)))) 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 t_1 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b_m <= 6.5e-164) {
tmp = 180.0 * (atan(((sin(t_0) / cos(t_0)) * (y_45_scale / x_45_scale))) / ((double) M_PI));
} else if (b_m <= 2.2e+35) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / ((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 t_1 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b_m <= 6.5e-164) {
tmp = 180.0 * (Math.atan(((Math.sin(t_0) / Math.cos(t_0)) * (y_45_scale / x_45_scale))) / Math.PI);
} else if (b_m <= 2.2e+35) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -t_1))) / 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 t_1 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b_m <= 6.5e-164: tmp = 180.0 * (math.atan(((math.sin(t_0) / math.cos(t_0)) * (y_45_scale / x_45_scale))) / math.pi) elif b_m <= 2.2e+35: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -t_1))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b_m <= 6.5e-164) tmp = Float64(180.0 * Float64(atan(Float64(Float64(sin(t_0) / cos(t_0)) * Float64(y_45_scale / x_45_scale))) / pi)); elseif (b_m <= 2.2e+35) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(-2.0 * Float64(t_1 / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-t_1)))) / 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; t_1 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b_m <= 6.5e-164) tmp = 180.0 * (atan(((sin(t_0) / cos(t_0)) * (y_45_scale / x_45_scale))) / pi); elseif (b_m <= 2.2e+35) tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 6.5e-164], N[(180.0 * N[(N[ArcTan[N[(N[(N[Sin[t$95$0], $MachinePrecision] / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.2e+35], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(-2.0 * N[(t$95$1 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-t$95$1)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b\_m \leq 6.5 \cdot 10^{-164}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\sin t\_0}{\cos t\_0} \cdot \frac{y-scale}{x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.2 \cdot 10^{+35}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(-2 \cdot \frac{t\_1}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-t\_1\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.50000000000000004e-164Initial program 12.5%
Simplified12.0%
Taylor expanded in x-scale around 0 24.0%
Simplified29.5%
Taylor expanded in a around inf 57.7%
pow157.7%
Applied egg-rr57.7%
unpow157.7%
associate-*r*57.8%
Simplified57.8%
Taylor expanded in y-scale around 0 57.1%
*-commutative57.1%
*-commutative57.1%
times-frac59.8%
associate-*r*59.8%
associate-*r*60.4%
Simplified60.4%
if 6.50000000000000004e-164 < b < 2.1999999999999999e35Initial program 23.0%
Simplified16.2%
Taylor expanded in x-scale around 0 44.6%
Simplified49.2%
Taylor expanded in a around inf 49.8%
Taylor expanded in angle around 0 58.8%
if 2.1999999999999999e35 < b Initial program 12.8%
Simplified5.6%
Taylor expanded in x-scale around 0 22.4%
Simplified24.6%
Taylor expanded in a around 0 60.5%
Taylor expanded in angle around 0 60.4%
Final simplification60.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= b_m 3.2e+36)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 (cos t_0)))) PI))
(* 180.0 (/ (atan (/ y-scale (* x-scale (- t_1)))) 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 t_1 = sin(t_0);
double tmp;
if (b_m <= 3.2e+36) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / cos(t_0)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / ((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 t_1 = Math.sin(t_0);
double tmp;
if (b_m <= 3.2e+36) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (t_1 / Math.cos(t_0)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -t_1))) / 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) t_1 = math.sin(t_0) tmp = 0 if b_m <= 3.2e+36: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * (t_1 / math.cos(t_0)))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -t_1))) / 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)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 3.2e+36) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / cos(t_0)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-t_1)))) / 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); t_1 = sin(t_0); tmp = 0.0; if (b_m <= 3.2e+36) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / cos(t_0)))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / 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]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 3.2e+36], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$1 / N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-t$95$1)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 3.2 \cdot 10^{+36}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-t\_1\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.1999999999999999e36Initial program 14.8%
Simplified12.9%
Taylor expanded in x-scale around 0 28.6%
Simplified33.9%
Taylor expanded in a around inf 56.0%
pow156.0%
Applied egg-rr56.0%
unpow156.0%
associate-*r*56.7%
Simplified56.7%
Taylor expanded in y-scale around 0 55.0%
times-frac57.7%
Simplified57.7%
if 3.1999999999999999e36 < b Initial program 12.8%
Simplified5.6%
Taylor expanded in x-scale around 0 22.4%
Simplified24.6%
Taylor expanded in a around 0 60.5%
Taylor expanded in angle around 0 60.4%
Final simplification58.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle) PI))
(t_1 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= b_m 1.45e-226)
(* 180.0 (/ (atan (* y-scale (/ (sin t_0) (* (cos t_0) x-scale)))) PI))
(if (<= b_m 6.5e+34)
(* 180.0 (/ (atan (* -0.5 (* y-scale (* -2.0 (/ t_1 x-scale))))) PI))
(* 180.0 (/ (atan (/ y-scale (* x-scale (- t_1)))) 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 t_1 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b_m <= 1.45e-226) {
tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (cos(t_0) * x_45_scale)))) / ((double) M_PI));
} else if (b_m <= 6.5e+34) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / ((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 t_1 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b_m <= 1.45e-226) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.sin(t_0) / (Math.cos(t_0) * x_45_scale)))) / Math.PI);
} else if (b_m <= 6.5e+34) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -t_1))) / 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 t_1 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b_m <= 1.45e-226: tmp = 180.0 * (math.atan((y_45_scale * (math.sin(t_0) / (math.cos(t_0) * x_45_scale)))) / math.pi) elif b_m <= 6.5e+34: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -t_1))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.005555555555555556 * angle) * pi) t_1 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b_m <= 1.45e-226) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(sin(t_0) / Float64(cos(t_0) * x_45_scale)))) / pi)); elseif (b_m <= 6.5e+34) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(-2.0 * Float64(t_1 / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-t_1)))) / 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; t_1 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b_m <= 1.45e-226) tmp = 180.0 * (atan((y_45_scale * (sin(t_0) / (cos(t_0) * x_45_scale)))) / pi); elseif (b_m <= 6.5e+34) tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_1 / x_45_scale))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -t_1))) / 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[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 1.45e-226], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Sin[t$95$0], $MachinePrecision] / N[(N[Cos[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 6.5e+34], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(-2.0 * N[(t$95$1 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-t$95$1)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b\_m \leq 1.45 \cdot 10^{-226}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\sin t\_0}{\cos t\_0 \cdot x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 6.5 \cdot 10^{+34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(-2 \cdot \frac{t\_1}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-t\_1\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.45000000000000001e-226Initial program 13.4%
Simplified12.8%
Taylor expanded in x-scale around 0 24.4%
Simplified29.7%
Taylor expanded in a around inf 57.9%
Taylor expanded in y-scale around 0 57.2%
associate-/l*57.9%
associate-*r*57.4%
associate-*r*57.9%
Simplified57.9%
if 1.45000000000000001e-226 < b < 6.50000000000000017e34Initial program 18.6%
Simplified13.3%
Taylor expanded in x-scale around 0 39.5%
Simplified45.0%
Taylor expanded in a around inf 50.9%
Taylor expanded in angle around 0 62.0%
if 6.50000000000000017e34 < b Initial program 12.8%
Simplified5.6%
Taylor expanded in x-scale around 0 22.4%
Simplified24.6%
Taylor expanded in a around 0 60.5%
Taylor expanded in angle around 0 60.4%
Final simplification59.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= b_m 6.5e+36)
(* 180.0 (/ (atan (* -0.5 (* y-scale (* -2.0 (/ t_0 x-scale))))) PI))
(* 180.0 (/ (atan (/ y-scale (* x-scale (- 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 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b_m <= 6.5e+36) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_0 / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -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 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b_m <= 6.5e+36) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (-2.0 * (t_0 / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -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 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b_m <= 6.5e+36: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * (-2.0 * (t_0 / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -t_0))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b_m <= 6.5e+36) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(-2.0 * Float64(t_0 / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-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 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b_m <= 6.5e+36) tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (t_0 / x_45_scale))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -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[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 6.5e+36], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(-2.0 * N[(t$95$0 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-t$95$0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b\_m \leq 6.5 \cdot 10^{+36}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(-2 \cdot \frac{t\_0}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-t\_0\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.4999999999999998e36Initial program 14.8%
Simplified12.9%
Taylor expanded in x-scale around 0 28.6%
Simplified33.9%
Taylor expanded in a around inf 56.0%
Taylor expanded in angle around 0 54.8%
if 6.4999999999999998e36 < b Initial program 12.8%
Simplified5.6%
Taylor expanded in x-scale around 0 22.4%
Simplified24.6%
Taylor expanded in a around 0 60.5%
Taylor expanded in angle around 0 60.4%
Final simplification56.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6.5e+33)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(*
180.0
(/
(atan
(/ y-scale (* x-scale (- (sin (* 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) {
double tmp;
if (b_m <= 6.5e+33) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * ((double) M_PI))))))) / ((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 (b_m <= 6.5e+33) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((y_45_scale / (x_45_scale * -Math.sin((0.005555555555555556 * (angle * Math.PI)))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6.5e+33: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((y_45_scale / (x_45_scale * -math.sin((0.005555555555555556 * (angle * math.pi)))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6.5e+33) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale / Float64(x_45_scale * Float64(-sin(Float64(0.005555555555555556 * Float64(angle * pi))))))) / 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 (b_m <= 6.5e+33) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((y_45_scale / (x_45_scale * -sin((0.005555555555555556 * (angle * pi)))))) / 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[b$95$m, 6.5e+33], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(y$45$scale / N[(x$45$scale * (-N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6.5 \cdot 10^{+33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale \cdot \left(-\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.49999999999999993e33Initial program 14.8%
Simplified12.9%
Taylor expanded in x-scale around 0 28.6%
Simplified33.9%
Taylor expanded in a around inf 56.0%
pow156.0%
Applied egg-rr56.0%
unpow156.0%
associate-*r*56.7%
Simplified56.7%
Taylor expanded in angle around 0 45.1%
associate-/l*51.5%
associate-/l*51.5%
Simplified51.5%
if 6.49999999999999993e33 < b Initial program 12.8%
Simplified5.6%
Taylor expanded in x-scale around 0 22.4%
Simplified24.6%
Taylor expanded in a around 0 60.5%
Taylor expanded in angle around 0 60.4%
Final simplification53.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6e+38)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale angle) (* PI x-scale)))) 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 (b_m <= 6e+38) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale / angle) / (((double) M_PI) * x_45_scale)))) / ((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 (b_m <= 6e+38) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale / angle) / (Math.PI * x_45_scale)))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6e+38: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale / angle) / (math.pi * x_45_scale)))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6e+38) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / angle) / Float64(pi * x_45_scale)))) / 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 (b_m <= 6e+38) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((-180.0 * ((y_45_scale / angle) / (pi * x_45_scale)))) / 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[b$95$m, 6e+38], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / angle), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6 \cdot 10^{+38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{angle}}{\pi \cdot x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.0000000000000002e38Initial program 14.8%
Simplified12.9%
Taylor expanded in x-scale around 0 28.5%
Simplified33.8%
Taylor expanded in a around inf 55.7%
pow155.7%
Applied egg-rr55.7%
unpow155.7%
associate-*r*56.4%
Simplified56.4%
Taylor expanded in angle around 0 44.9%
associate-/l*51.2%
associate-/l*51.2%
Simplified51.2%
if 6.0000000000000002e38 < b Initial program 12.9%
Simplified5.6%
Taylor expanded in b around inf 25.4%
associate-*r/25.4%
Simplified25.4%
Taylor expanded in angle around 0 56.3%
Taylor expanded in angle around 0 53.0%
associate-/r*53.0%
*-commutative53.0%
Simplified53.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) 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 * (((double) M_PI) * x_45_scale))))) / ((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 * (Math.PI * x_45_scale))))) / 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 * (math.pi * x_45_scale))))) / 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(pi * x_45_scale))))) / 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 * (pi * x_45_scale))))) / 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[(Pi * x$45$scale), $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(\pi \cdot x-scale\right)}\right)}{\pi}
\end{array}
Initial program 14.4%
Simplified11.3%
Taylor expanded in angle around 0 14.4%
associate-*r/14.4%
associate-*r*12.7%
distribute-lft-out--12.7%
associate-*r*12.7%
Simplified12.7%
Taylor expanded in a around 0 38.3%
Final simplification38.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 (* PI y-scale))))) 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 * (((double) M_PI) * y_45_scale))))) / ((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 * (Math.PI * y_45_scale))))) / 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 * (math.pi * y_45_scale))))) / 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(pi * y_45_scale))))) / 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 * (pi * y_45_scale))))) / 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[(Pi * y$45$scale), $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(\pi \cdot y-scale\right)}\right)}{\pi}
\end{array}
Initial program 14.4%
Simplified11.3%
Taylor expanded in angle around 0 14.4%
associate-*r/14.4%
associate-*r*12.7%
distribute-lft-out--12.7%
associate-*r*12.7%
Simplified12.7%
Taylor expanded in a around inf 11.8%
Final simplification11.8%
herbie shell --seed 2024132
(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)))