
(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 14 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 (sin t_0)))
(if (<= b_m 2.45e+33)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 (cos t_0)))) PI))
(/
(*
180.0
(atan
(/
(*
(cos (* 0.005555555555555556 (* angle (* (sqrt PI) (sqrt PI)))))
(- 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 <= 2.45e+33) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / cos(t_0)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((cos((0.005555555555555556 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI)))))) * -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 <= 2.45e+33) {
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(((Math.cos((0.005555555555555556 * (angle * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI))))) * -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 <= 2.45e+33: 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(((math.cos((0.005555555555555556 * (angle * (math.sqrt(math.pi) * math.sqrt(math.pi))))) * -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 <= 2.45e+33) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / cos(t_0)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(cos(Float64(0.005555555555555556 * Float64(angle * Float64(sqrt(pi) * sqrt(pi))))) * Float64(-y_45_scale)) / Float64(x_45_scale * 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 <= 2.45e+33) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / cos(t_0)))) / pi); else tmp = (180.0 * atan(((cos((0.005555555555555556 * (angle * (sqrt(pi) * sqrt(pi))))) * -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, 2.45e+33], 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[(N[(180.0 * N[ArcTan[N[(N[(N[Cos[N[(0.005555555555555556 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y$45$scale)), $MachinePrecision] / N[(x$45$scale * t$95$1), $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)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 2.45 \cdot 10^{+33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right) \cdot \left(-y-scale\right)}{x-scale \cdot t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.45000000000000007e33Initial program 12.3%
Simplified11.3%
Taylor expanded in x-scale around 0 28.6%
Simplified33.6%
Taylor expanded in a around inf 52.9%
times-frac55.3%
Simplified55.3%
if 2.45000000000000007e33 < b Initial program 7.5%
Simplified5.7%
Taylor expanded in x-scale around 0 20.2%
Simplified20.3%
associate-*r/20.3%
Applied egg-rr20.0%
Taylor expanded in a around 0 60.6%
associate-*r/60.6%
mul-1-neg60.6%
*-commutative60.6%
Simplified60.6%
add-sqr-sqrt61.7%
Applied egg-rr61.7%
Final simplification56.8%
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 7e+32)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 (cos t_0)))) PI))
(/
(*
180.0
(atan
(/
(*
y-scale
(cos (* 0.005555555555555556 (* angle (cbrt (* PI (* PI PI)))))))
(* t_1 (- 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 = sin(t_0);
double tmp;
if (b_m <= 7e+32) {
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 * cos((0.005555555555555556 * (angle * cbrt((((double) M_PI) * (((double) M_PI) * ((double) M_PI)))))))) / (t_1 * -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.sin(t_0);
double tmp;
if (b_m <= 7e+32) {
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 * Math.cos((0.005555555555555556 * (angle * Math.cbrt((Math.PI * (Math.PI * Math.PI))))))) / (t_1 * -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(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 7e+32) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / cos(t_0)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * cos(Float64(0.005555555555555556 * Float64(angle * cbrt(Float64(pi * Float64(pi * pi))))))) / Float64(t_1 * Float64(-x_45_scale))))) / 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 7e+32], 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[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * (-x$45$scale)), $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)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 7 \cdot 10^{+32}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right)}{t\_1 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.0000000000000002e32Initial program 12.3%
Simplified11.3%
Taylor expanded in x-scale around 0 28.6%
Simplified33.6%
Taylor expanded in a around inf 52.9%
times-frac55.3%
Simplified55.3%
if 7.0000000000000002e32 < b Initial program 7.5%
Simplified5.7%
Taylor expanded in x-scale around 0 20.2%
Simplified20.3%
associate-*r/20.3%
Applied egg-rr20.0%
Taylor expanded in a around 0 60.6%
associate-*r/60.6%
mul-1-neg60.6%
*-commutative60.6%
Simplified60.6%
add-cbrt-cube62.6%
Applied egg-rr62.6%
Final simplification57.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)))
(if (<= b_m 4.8e+32)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ (sin t_0) t_1))) PI))
(/
(*
180.0
(atan
(/
(* y-scale t_1)
(*
x-scale
(-
(sin
(* 0.005555555555555556 (* angle (cbrt (* PI (* PI 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 tmp;
if (b_m <= 4.8e+32) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (sin(t_0) / t_1))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * t_1) / (x_45_scale * -sin((0.005555555555555556 * (angle * cbrt((((double) M_PI) * (((double) M_PI) * ((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 tmp;
if (b_m <= 4.8e+32) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * (Math.sin(t_0) / t_1))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * t_1) / (x_45_scale * -Math.sin((0.005555555555555556 * (angle * Math.cbrt((Math.PI * (Math.PI * 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(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if (b_m <= 4.8e+32) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(sin(t_0) / t_1))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * t_1) / Float64(x_45_scale * Float64(-sin(Float64(0.005555555555555556 * Float64(angle * cbrt(Float64(pi * Float64(pi * pi))))))))))) / 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 4.8e+32], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / N[(x$45$scale * (-N[Sin[N[(0.005555555555555556 * N[(angle * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $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)\\
t_1 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 4.8 \cdot 10^{+32}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{\sin t\_0}{t\_1}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot t\_1}{x-scale \cdot \left(-\sin \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.79999999999999983e32Initial program 12.3%
Simplified11.3%
Taylor expanded in x-scale around 0 28.6%
Simplified33.6%
Taylor expanded in a around inf 52.9%
times-frac55.3%
Simplified55.3%
if 4.79999999999999983e32 < b Initial program 7.5%
Simplified5.7%
Taylor expanded in x-scale around 0 20.2%
Simplified20.3%
associate-*r/20.3%
Applied egg-rr20.0%
Taylor expanded in a around 0 60.6%
associate-*r/60.6%
mul-1-neg60.6%
*-commutative60.6%
Simplified60.6%
add-cbrt-cube62.6%
Applied egg-rr62.1%
Final simplification56.9%
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))
(t_2 (cos t_0)))
(if (<= b_m 2.7e+33)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 t_2))) PI))
(/ (* -180.0 (atan (* y-scale (/ t_2 (* 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 t_2 = cos(t_0);
double tmp;
if (b_m <= 2.7e+33) {
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 * (t_2 / (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 t_2 = Math.cos(t_0);
double tmp;
if (b_m <= 2.7e+33) {
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 * (t_2 / (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) t_2 = math.cos(t_0) tmp = 0 if b_m <= 2.7e+33: 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 * (t_2 / (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) t_2 = cos(t_0) tmp = 0.0 if (b_m <= 2.7e+33) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / t_2))) / pi)); else tmp = Float64(Float64(-180.0 * atan(Float64(y_45_scale * Float64(t_2 / Float64(x_45_scale * 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); t_2 = cos(t_0); tmp = 0.0; if (b_m <= 2.7e+33) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / t_2))) / pi); else tmp = (-180.0 * atan((y_45_scale * (t_2 / (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]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 2.7e+33], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(-180.0 * N[ArcTan[N[(y$45$scale * N[(t$95$2 / N[(x$45$scale * t$95$1), $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)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 2.7 \cdot 10^{+33}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{t\_2}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{-180 \cdot \tan^{-1} \left(y-scale \cdot \frac{t\_2}{x-scale \cdot t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.69999999999999991e33Initial program 12.3%
Simplified11.3%
Taylor expanded in x-scale around 0 28.6%
Simplified33.6%
Taylor expanded in a around inf 52.9%
times-frac55.3%
Simplified55.3%
if 2.69999999999999991e33 < b Initial program 7.5%
Simplified5.7%
Taylor expanded in x-scale around 0 20.2%
Simplified20.3%
associate-*r/20.3%
Applied egg-rr20.0%
Taylor expanded in a around 0 60.6%
associate-*r/60.6%
mul-1-neg60.6%
*-commutative60.6%
Simplified60.6%
associate-/l*60.5%
distribute-frac-neg60.5%
atan-neg60.5%
*-commutative60.5%
Applied egg-rr60.5%
associate-*r/60.6%
distribute-rgt-neg-out60.6%
distribute-lft-neg-in60.6%
metadata-eval60.6%
associate-/l*60.6%
*-commutative60.6%
Simplified60.6%
Final simplification56.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 t_0)))
(if (<= b_m 20000000000000.0)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 (cos t_0)))) PI))
(/ (* 180.0 (atan (/ y-scale (* t_1 (- 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 = sin(t_0);
double tmp;
if (b_m <= 20000000000000.0) {
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 / (t_1 * -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.sin(t_0);
double tmp;
if (b_m <= 20000000000000.0) {
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 / (t_1 * -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.sin(t_0) tmp = 0 if b_m <= 20000000000000.0: 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 / (t_1 * -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(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b_m <= 20000000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * Float64(t_1 / cos(t_0)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(t_1 * 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 = sin(t_0); tmp = 0.0; if (b_m <= 20000000000000.0) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * (t_1 / cos(t_0)))) / pi); else tmp = (180.0 * atan((y_45_scale / (t_1 * -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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 20000000000000.0], 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[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(t$95$1 * (-x$45$scale)), $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)\\
t_1 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 20000000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{\cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{t\_1 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2e13Initial program 12.6%
Simplified11.5%
Taylor expanded in x-scale around 0 27.6%
Simplified32.7%
Taylor expanded in a around inf 52.4%
times-frac54.9%
Simplified54.9%
if 2e13 < b Initial program 7.0%
Simplified5.3%
Taylor expanded in x-scale around 0 23.8%
Simplified23.9%
associate-*r/23.9%
Applied egg-rr23.6%
Taylor expanded in a around 0 60.0%
associate-*r/60.0%
mul-1-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in angle around 0 63.0%
Final simplification56.8%
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 19000000000000.0)
(* 180.0 (/ (atan (* (/ y-scale x-scale) (tan t_0))) PI))
(/ (* 180.0 (atan (/ y-scale (* (sin t_0) (- 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 tmp;
if (b_m <= 19000000000000.0) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((y_45_scale / (sin(t_0) * -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 tmp;
if (b_m <= 19000000000000.0) {
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 / (Math.sin(t_0) * -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) tmp = 0 if b_m <= 19000000000000.0: 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 / (math.sin(t_0) * -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(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 19000000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(t_0))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(sin(t_0) * 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); tmp = 0.0; if (b_m <= 19000000000000.0) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan(t_0))) / pi); else tmp = (180.0 * atan((y_45_scale / (sin(t_0) * -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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 19000000000000.0], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(N[Sin[t$95$0], $MachinePrecision] * (-x$45$scale)), $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 19000000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan t\_0\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\sin t\_0 \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.9e13Initial program 12.6%
Simplified11.5%
Taylor expanded in x-scale around 0 27.6%
Simplified32.7%
Taylor expanded in a around inf 52.4%
times-frac54.9%
Simplified54.9%
*-un-lft-identity54.9%
quot-tan54.9%
Applied egg-rr54.9%
if 1.9e13 < b Initial program 7.0%
Simplified5.3%
Taylor expanded in x-scale around 0 23.8%
Simplified23.9%
associate-*r/23.9%
Applied egg-rr23.6%
Taylor expanded in a around 0 60.0%
associate-*r/60.0%
mul-1-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in angle around 0 63.0%
Final simplification56.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 4.2e+26)
(*
180.0
(/
(atan (* (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle PI)))))
PI))
(* 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) {
double tmp;
if (b_m <= 4.2e+26) {
tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / ((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 <= 4.2e+26) {
tmp = 180.0 * (Math.atan(((y_45_scale / x_45_scale) * Math.tan((0.005555555555555556 * (angle * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 4.2e+26: tmp = 180.0 * (math.atan(((y_45_scale / x_45_scale) * math.tan((0.005555555555555556 * (angle * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 4.2e+26) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(x_45_scale * angle)) * Float64(y_45_scale / 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 <= 4.2e+26) tmp = 180.0 * (atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * pi))))) / pi); else tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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, 4.2e+26], 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], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 4.2 \cdot 10^{+26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot angle} \cdot \frac{y-scale}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.2000000000000002e26Initial program 12.4%
Simplified11.4%
Taylor expanded in x-scale around 0 28.2%
Simplified33.2%
Taylor expanded in a around inf 52.7%
times-frac55.1%
Simplified55.1%
*-un-lft-identity55.1%
quot-tan55.1%
Applied egg-rr55.1%
if 4.2000000000000002e26 < b Initial program 7.4%
Simplified5.6%
Taylor expanded in y-scale around 0 3.7%
Simplified3.7%
Taylor expanded in a around 0 3.9%
times-frac3.9%
Simplified7.9%
Taylor expanded in angle around 0 56.4%
associate-*r/56.4%
associate-*r*56.5%
times-frac56.5%
Simplified56.5%
Final simplification55.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 7e+27)
(/
(*
180.0
(atan
(* (/ y-scale x-scale) (tan (* 0.005555555555555556 (* angle PI))))))
PI)
(* 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) {
double tmp;
if (b_m <= 7e+27) {
tmp = (180.0 * atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * ((double) M_PI))))))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / ((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 <= 7e+27) {
tmp = (180.0 * Math.atan(((y_45_scale / x_45_scale) * Math.tan((0.005555555555555556 * (angle * Math.PI)))))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 7e+27: tmp = (180.0 * math.atan(((y_45_scale / x_45_scale) * math.tan((0.005555555555555556 * (angle * math.pi)))))) / math.pi else: tmp = 180.0 * (math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 7e+27) tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * pi)))))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(x_45_scale * angle)) * Float64(y_45_scale / 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 <= 7e+27) tmp = (180.0 * atan(((y_45_scale / x_45_scale) * tan((0.005555555555555556 * (angle * pi)))))) / pi; else tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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, 7e+27], 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], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 7 \cdot 10^{+27}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot angle} \cdot \frac{y-scale}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.0000000000000004e27Initial program 12.4%
Simplified11.4%
Taylor expanded in x-scale around 0 28.2%
Simplified33.2%
Taylor expanded in a around inf 52.7%
times-frac55.1%
Simplified55.1%
associate-*r/55.1%
quot-tan55.1%
Applied egg-rr55.1%
if 7.0000000000000004e27 < b Initial program 7.4%
Simplified5.6%
Taylor expanded in y-scale around 0 3.7%
Simplified3.7%
Taylor expanded in a around 0 3.9%
times-frac3.9%
Simplified7.9%
Taylor expanded in angle around 0 56.4%
associate-*r/56.4%
associate-*r*56.5%
times-frac56.5%
Simplified56.5%
Final simplification55.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6e+26)
(*
180.0
(/
(atan (* y-scale (/ (tan (* 0.005555555555555556 (* angle PI))) x-scale)))
PI))
(* 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) {
double tmp;
if (b_m <= 6e+26) {
tmp = 180.0 * (atan((y_45_scale * (tan((0.005555555555555556 * (angle * ((double) M_PI)))) / x_45_scale))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / ((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 <= 6e+26) {
tmp = 180.0 * (Math.atan((y_45_scale * (Math.tan((0.005555555555555556 * (angle * Math.PI))) / x_45_scale))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 6e+26: tmp = 180.0 * (math.atan((y_45_scale * (math.tan((0.005555555555555556 * (angle * math.pi))) / x_45_scale))) / math.pi) else: tmp = 180.0 * (math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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 <= 6e+26) tmp = Float64(180.0 * Float64(atan(Float64(y_45_scale * Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) / x_45_scale))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(x_45_scale * angle)) * Float64(y_45_scale / 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 <= 6e+26) tmp = 180.0 * (atan((y_45_scale * (tan((0.005555555555555556 * (angle * pi))) / x_45_scale))) / pi); else tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / 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, 6e+26], N[(180.0 * N[(N[ArcTan[N[(y$45$scale * N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / Pi), $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^{+26}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(y-scale \cdot \frac{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}{x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot angle} \cdot \frac{y-scale}{\pi}\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.99999999999999994e26Initial program 12.4%
Simplified11.4%
Taylor expanded in x-scale around 0 28.2%
Simplified33.2%
Taylor expanded in a around inf 52.7%
times-frac55.1%
Simplified55.1%
associate-*l/52.7%
quot-tan52.7%
Applied egg-rr52.7%
associate-/l*53.1%
Simplified53.1%
if 5.99999999999999994e26 < b Initial program 7.4%
Simplified5.6%
Taylor expanded in y-scale around 0 3.7%
Simplified3.7%
Taylor expanded in a around 0 3.9%
times-frac3.9%
Simplified7.9%
Taylor expanded in angle around 0 56.4%
associate-*r/56.4%
associate-*r*56.5%
times-frac56.5%
Simplified56.5%
Final simplification53.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= a 3.3e-28)
(* 180.0 (/ (atan (* (/ -180.0 (* x-scale angle)) (/ y-scale PI))) PI))
(/
(*
180.0
(atan (* 0.005555555555555556 (* angle (/ (* y-scale 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 (a <= 3.3e-28) {
tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / ((double) M_PI)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((0.005555555555555556 * (angle * ((y_45_scale * ((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 (a <= 3.3e-28) {
tmp = 180.0 * (Math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / Math.PI))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((0.005555555555555556 * (angle * ((y_45_scale * 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 a <= 3.3e-28: tmp = 180.0 * (math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / math.pi))) / math.pi) else: tmp = (180.0 * math.atan((0.005555555555555556 * (angle * ((y_45_scale * 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 (a <= 3.3e-28) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(x_45_scale * angle)) * Float64(y_45_scale / pi))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(0.005555555555555556 * Float64(angle * Float64(Float64(y_45_scale * 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 (a <= 3.3e-28) tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / pi))) / pi); else tmp = (180.0 * atan((0.005555555555555556 * (angle * ((y_45_scale * 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[a, 3.3e-28], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.3 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot angle} \cdot \frac{y-scale}{\pi}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \frac{y-scale \cdot \pi}{x-scale}\right)\right)}{\pi}\\
\end{array}
\end{array}
if a < 3.3000000000000002e-28Initial program 12.5%
Simplified12.0%
Taylor expanded in y-scale around 0 7.1%
Simplified6.5%
Taylor expanded in a around 0 6.1%
times-frac5.4%
Simplified8.0%
Taylor expanded in angle around 0 44.2%
associate-*r/44.2%
associate-*r*44.2%
times-frac44.2%
Simplified44.2%
if 3.3000000000000002e-28 < a Initial program 8.3%
Simplified5.5%
Taylor expanded in x-scale around 0 25.4%
Simplified29.9%
Taylor expanded in a around inf 59.2%
times-frac60.4%
Simplified60.4%
Taylor expanded in angle around 0 52.6%
associate-*r/52.6%
associate-/l*59.9%
Applied egg-rr59.9%
Final simplification49.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= a 1.15e-29)
(* 180.0 (/ (atan (* (/ -180.0 (* x-scale angle)) (/ y-scale PI))) PI))
(*
180.0
(/
(atan (* 0.005555555555555556 (/ (* angle (* y-scale 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 (a <= 1.15e-29) {
tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / ((double) M_PI)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.005555555555555556 * ((angle * (y_45_scale * ((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 (a <= 1.15e-29) {
tmp = 180.0 * (Math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / Math.PI))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.005555555555555556 * ((angle * (y_45_scale * 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 a <= 1.15e-29: tmp = 180.0 * (math.atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / math.pi))) / math.pi) else: tmp = 180.0 * (math.atan((0.005555555555555556 * ((angle * (y_45_scale * 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 (a <= 1.15e-29) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(x_45_scale * angle)) * Float64(y_45_scale / pi))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(Float64(angle * Float64(y_45_scale * 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 (a <= 1.15e-29) tmp = 180.0 * (atan(((-180.0 / (x_45_scale * angle)) * (y_45_scale / pi))) / pi); else tmp = 180.0 * (atan((0.005555555555555556 * ((angle * (y_45_scale * 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[a, 1.15e-29], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.15 \cdot 10^{-29}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot angle} \cdot \frac{y-scale}{\pi}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \frac{angle \cdot \left(y-scale \cdot \pi\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 1.14999999999999996e-29Initial program 12.5%
Simplified12.0%
Taylor expanded in y-scale around 0 7.1%
Simplified6.5%
Taylor expanded in a around 0 6.1%
times-frac5.4%
Simplified8.0%
Taylor expanded in angle around 0 44.2%
associate-*r/44.2%
associate-*r*44.2%
times-frac44.2%
Simplified44.2%
if 1.14999999999999996e-29 < a Initial program 8.3%
Simplified5.5%
Taylor expanded in x-scale around 0 25.4%
Simplified29.9%
Taylor expanded in a around inf 59.2%
times-frac60.4%
Simplified60.4%
Taylor expanded in angle around 0 52.6%
Final simplification46.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= a 3.8e-28)
(* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale PI))))) PI))
(*
180.0
(/
(atan (* 0.005555555555555556 (/ (* angle (* y-scale 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 (a <= 3.8e-28) {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.005555555555555556 * ((angle * (y_45_scale * ((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 (a <= 3.8e-28) {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.005555555555555556 * ((angle * (y_45_scale * 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 a <= 3.8e-28: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan((0.005555555555555556 * ((angle * (y_45_scale * 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 (a <= 3.8e-28) tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(Float64(angle * Float64(y_45_scale * 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 (a <= 3.8e-28) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); else tmp = 180.0 * (atan((0.005555555555555556 * ((angle * (y_45_scale * 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[a, 3.8e-28], 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], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.8 \cdot 10^{-28}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \frac{angle \cdot \left(y-scale \cdot \pi\right)}{x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if a < 3.80000000000000009e-28Initial program 12.5%
Simplified12.0%
Taylor expanded in angle around 0 13.9%
associate-/l*13.9%
distribute-lft-out--13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in a around 0 44.2%
if 3.80000000000000009e-28 < a Initial program 8.3%
Simplified5.5%
Taylor expanded in x-scale around 0 25.4%
Simplified29.9%
Taylor expanded in a around inf 59.2%
times-frac60.4%
Simplified60.4%
Taylor expanded in angle around 0 52.6%
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 11.3%
Simplified10.1%
Taylor expanded in angle around 0 11.2%
associate-/l*11.2%
distribute-lft-out--11.2%
associate-*r*11.2%
Simplified11.2%
Taylor expanded in a around 0 39.1%
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 11.3%
Simplified10.1%
Taylor expanded in angle around 0 11.2%
associate-/l*11.2%
distribute-lft-out--11.2%
associate-*r*11.2%
Simplified11.2%
Taylor expanded in a around inf 10.8%
herbie shell --seed 2024119
(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)))