
(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 17 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 (* angle (* 0.005555555555555556 PI)))
(t_2 (cos (* 2.0 t_1))))
(if (<= b_m 1.3e-56)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(if (<= b_m 1.5e+113)
(/
(*
180.0
(atan
(/
(*
-0.5
(*
(* 2.0 y-scale)
(fma
a
(* a (+ 0.5 (* -0.5 t_2)))
(* (fma 0.5 t_2 0.5) (* b_m b_m)))))
(* x-scale (* (* (cos t_1) (sin t_1)) (* (+ b_m a) (- b_m a)))))))
PI)
(*
180.0
(/
(atan
(/
-1.0
(*
(/ x-scale y-scale)
(tan (* PI (* angle 0.005555555555555556))))))
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 = angle * (0.005555555555555556 * ((double) M_PI));
double t_2 = cos((2.0 * t_1));
double tmp;
if (b_m <= 1.3e-56) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else if (b_m <= 1.5e+113) {
tmp = (180.0 * atan(((-0.5 * ((2.0 * y_45_scale) * fma(a, (a * (0.5 + (-0.5 * t_2))), (fma(0.5, t_2, 0.5) * (b_m * b_m))))) / (x_45_scale * ((cos(t_1) * sin(t_1)) * ((b_m + a) * (b_m - a))))))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((((double) M_PI) * (angle * 0.005555555555555556)))))) / ((double) M_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 = Float64(angle * Float64(0.005555555555555556 * pi)) t_2 = cos(Float64(2.0 * t_1)) tmp = 0.0 if (b_m <= 1.3e-56) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); elseif (b_m <= 1.5e+113) tmp = Float64(Float64(180.0 * atan(Float64(Float64(-0.5 * Float64(Float64(2.0 * y_45_scale) * fma(a, Float64(a * Float64(0.5 + Float64(-0.5 * t_2))), Float64(fma(0.5, t_2, 0.5) * Float64(b_m * b_m))))) / Float64(x_45_scale * Float64(Float64(cos(t_1) * sin(t_1)) * Float64(Float64(b_m + a) * Float64(b_m - a))))))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(pi * Float64(angle * 0.005555555555555556)))))) / 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[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 1.3e-56], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.5e+113], N[(N[(180.0 * N[ArcTan[N[(N[(-0.5 * N[(N[(2.0 * y$45$scale), $MachinePrecision] * N[(a * N[(a * N[(0.5 + N[(-0.5 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * t$95$2 + 0.5), $MachinePrecision] * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\
t_2 := \cos \left(2 \cdot t\_1\right)\\
\mathbf{if}\;b\_m \leq 1.3 \cdot 10^{-56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.5 \cdot 10^{+113}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-0.5 \cdot \left(\left(2 \cdot y-scale\right) \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 + -0.5 \cdot t\_2\right), \mathsf{fma}\left(0.5, t\_2, 0.5\right) \cdot \left(b\_m \cdot b\_m\right)\right)\right)}{x-scale \cdot \left(\left(\cos t\_1 \cdot \sin t\_1\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.29999999999999998e-56Initial program 22.4%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites32.6%
Taylor expanded in b around 0
Applied rewrites53.1%
if 1.29999999999999998e-56 < b < 1.5e113Initial program 50.4%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites70.4%
Applied rewrites73.9%
if 1.5e113 < b Initial program 5.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites7.1%
Taylor expanded in b around inf
Applied rewrites72.4%
Applied rewrites70.0%
Applied rewrites72.8%
Final simplification58.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 (* angle (* 0.005555555555555556 PI)))
(t_2 (cos (* 2.0 t_1))))
(if (<= b_m 1.4e-56)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(if (<= b_m 7.2e+112)
(*
(/ 180.0 (sqrt PI))
(/
(atan
(/
(*
-0.5
(*
(* 2.0 y-scale)
(fma
a
(* a (+ 0.5 (* -0.5 t_2)))
(* (fma 0.5 t_2 0.5) (* b_m b_m)))))
(* x-scale (* (* (+ b_m a) (- b_m a)) (* (sin t_1) 1.0)))))
(sqrt PI)))
(*
180.0
(/
(atan
(/
-1.0
(*
(/ x-scale y-scale)
(tan (* PI (* angle 0.005555555555555556))))))
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 = angle * (0.005555555555555556 * ((double) M_PI));
double t_2 = cos((2.0 * t_1));
double tmp;
if (b_m <= 1.4e-56) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else if (b_m <= 7.2e+112) {
tmp = (180.0 / sqrt(((double) M_PI))) * (atan(((-0.5 * ((2.0 * y_45_scale) * fma(a, (a * (0.5 + (-0.5 * t_2))), (fma(0.5, t_2, 0.5) * (b_m * b_m))))) / (x_45_scale * (((b_m + a) * (b_m - a)) * (sin(t_1) * 1.0))))) / sqrt(((double) M_PI)));
} else {
tmp = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((((double) M_PI) * (angle * 0.005555555555555556)))))) / ((double) M_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 = Float64(angle * Float64(0.005555555555555556 * pi)) t_2 = cos(Float64(2.0 * t_1)) tmp = 0.0 if (b_m <= 1.4e-56) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); elseif (b_m <= 7.2e+112) tmp = Float64(Float64(180.0 / sqrt(pi)) * Float64(atan(Float64(Float64(-0.5 * Float64(Float64(2.0 * y_45_scale) * fma(a, Float64(a * Float64(0.5 + Float64(-0.5 * t_2))), Float64(fma(0.5, t_2, 0.5) * Float64(b_m * b_m))))) / Float64(x_45_scale * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(sin(t_1) * 1.0))))) / sqrt(pi))); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(pi * Float64(angle * 0.005555555555555556)))))) / 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[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e-56], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 7.2e+112], N[(N[(180.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[ArcTan[N[(N[(-0.5 * N[(N[(2.0 * y$45$scale), $MachinePrecision] * N[(a * N[(a * N[(0.5 + N[(-0.5 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * t$95$2 + 0.5), $MachinePrecision] * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 := angle \cdot \left(0.005555555555555556 \cdot \pi\right)\\
t_2 := \cos \left(2 \cdot t\_1\right)\\
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{-56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 7.2 \cdot 10^{+112}:\\
\;\;\;\;\frac{180}{\sqrt{\pi}} \cdot \frac{\tan^{-1} \left(\frac{-0.5 \cdot \left(\left(2 \cdot y-scale\right) \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 + -0.5 \cdot t\_2\right), \mathsf{fma}\left(0.5, t\_2, 0.5\right) \cdot \left(b\_m \cdot b\_m\right)\right)\right)}{x-scale \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\sin t\_1 \cdot 1\right)\right)}\right)}{\sqrt{\pi}}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.39999999999999997e-56Initial program 22.4%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites32.6%
Taylor expanded in b around 0
Applied rewrites53.1%
if 1.39999999999999997e-56 < b < 7.20000000000000001e112Initial program 50.4%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites70.4%
Applied rewrites72.9%
Taylor expanded in angle around 0
Applied rewrites68.5%
if 7.20000000000000001e112 < b Initial program 5.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites7.1%
Taylor expanded in b around inf
Applied rewrites72.4%
Applied rewrites70.0%
Applied rewrites72.8%
Final simplification58.2%
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 4.8e-41)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(if (<= b_m 9e+61)
(*
180.0
(/
(atan
(/
(* -180.0 (* y-scale (* b_m b_m)))
(* angle (* (* (+ b_m a) (- b_m a)) (* x-scale PI)))))
PI))
(*
180.0
(/
(atan
(/
-1.0
(*
(/ x-scale y-scale)
(tan (* PI (* angle 0.005555555555555556))))))
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 <= 4.8e-41) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else if (b_m <= 9e+61) {
tmp = 180.0 * (atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((((double) M_PI) * (angle * 0.005555555555555556)))))) / ((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 <= 4.8e-41) {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.sin(t_0)) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
} else if (b_m <= 9e+61) {
tmp = 180.0 * (Math.atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-1.0 / ((x_45_scale / y_45_scale) * Math.tan((Math.PI * (angle * 0.005555555555555556)))))) / 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 <= 4.8e-41: tmp = 180.0 * (math.atan(((y_45_scale * math.sin(t_0)) / (x_45_scale * math.cos(t_0)))) / math.pi) elif b_m <= 9e+61: tmp = 180.0 * (math.atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan((-1.0 / ((x_45_scale / y_45_scale) * math.tan((math.pi * (angle * 0.005555555555555556)))))) / 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 <= 4.8e-41) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); elseif (b_m <= 9e+61) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / Float64(angle * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(x_45_scale * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(pi * Float64(angle * 0.005555555555555556)))))) / 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 <= 4.8e-41) tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / pi); elseif (b_m <= 9e+61) tmp = 180.0 * (atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * pi))))) / pi); else tmp = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((pi * (angle * 0.005555555555555556)))))) / 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, 4.8e-41], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 9e+61], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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)\\
\mathbf{if}\;b\_m \leq 4.8 \cdot 10^{-41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 9 \cdot 10^{+61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{angle \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot \pi\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.80000000000000044e-41Initial program 22.3%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites32.8%
Taylor expanded in b around 0
Applied rewrites53.2%
if 4.80000000000000044e-41 < b < 9e61Initial program 50.2%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites41.9%
Taylor expanded in a around inf
Applied rewrites13.9%
Taylor expanded in x-scale around 0
Applied rewrites67.2%
if 9e61 < b Initial program 14.2%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites18.1%
Taylor expanded in b around inf
Applied rewrites71.6%
Applied rewrites69.7%
Applied rewrites70.5%
Final simplification57.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(/
-1.0
(*
(/ x-scale y-scale)
(tan (* PI (* angle 0.005555555555555556))))))
PI))))
(if (<= b_m 3.4e-181)
t_0
(if (<= b_m 6.7e-127)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
(if (<= b_m 9.5e+61)
(*
180.0
(/
(atan
(/
(* 90.0 (* -2.0 (/ (* y-scale (* b_m b_m)) x-scale)))
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
t_0)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((((double) M_PI) * (angle * 0.005555555555555556)))))) / ((double) M_PI));
double tmp;
if (b_m <= 3.4e-181) {
tmp = t_0;
} else if (b_m <= 6.7e-127) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else if (b_m <= 9.5e+61) {
tmp = 180.0 * (atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
} else {
tmp = t_0;
}
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 = 180.0 * (Math.atan((-1.0 / ((x_45_scale / y_45_scale) * Math.tan((Math.PI * (angle * 0.005555555555555556)))))) / Math.PI);
double tmp;
if (b_m <= 3.4e-181) {
tmp = t_0;
} else if (b_m <= 6.7e-127) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else if (b_m <= 9.5e+61) {
tmp = 180.0 * (Math.atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
} else {
tmp = t_0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 180.0 * (math.atan((-1.0 / ((x_45_scale / y_45_scale) * math.tan((math.pi * (angle * 0.005555555555555556)))))) / math.pi) tmp = 0 if b_m <= 3.4e-181: tmp = t_0 elif b_m <= 6.7e-127: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) elif b_m <= 9.5e+61: tmp = 180.0 * (math.atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi) else: tmp = t_0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(pi * Float64(angle * 0.005555555555555556)))))) / pi)) tmp = 0.0 if (b_m <= 3.4e-181) tmp = t_0; elseif (b_m <= 6.7e-127) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); elseif (b_m <= 9.5e+61) tmp = Float64(180.0 * Float64(atan(Float64(Float64(90.0 * Float64(-2.0 * Float64(Float64(y_45_scale * Float64(b_m * b_m)) / x_45_scale))) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi)); else tmp = t_0; end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 180.0 * (atan((-1.0 / ((x_45_scale / y_45_scale) * tan((pi * (angle * 0.005555555555555556)))))) / pi); tmp = 0.0; if (b_m <= 3.4e-181) tmp = t_0; elseif (b_m <= 6.7e-127) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); elseif (b_m <= 9.5e+61) tmp = 180.0 * (atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi); else tmp = t_0; 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[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 3.4e-181], t$95$0, If[LessEqual[b$95$m, 6.7e-127], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 9.5e+61], N[(180.0 * N[(N[ArcTan[N[(N[(90.0 * N[(-2.0 * N[(N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}{\pi}\\
\mathbf{if}\;b\_m \leq 3.4 \cdot 10^{-181}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b\_m \leq 6.7 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 9.5 \cdot 10^{+61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \left(-2 \cdot \frac{y-scale \cdot \left(b\_m \cdot b\_m\right)}{x-scale}\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < 3.4e-181 or 9.49999999999999959e61 < b Initial program 18.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites27.3%
Taylor expanded in b around inf
Applied rewrites49.3%
Applied rewrites48.5%
Applied rewrites52.2%
if 3.4e-181 < b < 6.7000000000000001e-127Initial program 60.3%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites21.4%
Taylor expanded in a around inf
Applied rewrites2.6%
Taylor expanded in x-scale around inf
Applied rewrites2.6%
Taylor expanded in a around 0
Applied rewrites50.9%
if 6.7000000000000001e-127 < b < 9.49999999999999959e61Initial program 41.5%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.9%
Taylor expanded in x-scale around 0
Applied rewrites54.7%
Final simplification52.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 3.5e-133)
(*
180.0
(/
(atan
(/
(* y-scale 1.0)
(* (sin (* 0.005555555555555556 (* angle PI))) (- x-scale))))
PI))
(if (<= b_m 2.3e+60)
(*
180.0
(/
(atan
(/
(/ (* -180.0 (* y-scale (* b_m b_m))) x-scale)
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
(/
(*
180.0
(atan
(/
(* y-scale 1.0)
(* (sin (* PI (* angle 0.005555555555555556))) (- 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 <= 3.5e-133) {
tmp = 180.0 * (atan(((y_45_scale * 1.0) / (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * -x_45_scale))) / ((double) M_PI));
} else if (b_m <= 2.3e+60) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
} else {
tmp = (180.0 * atan(((y_45_scale * 1.0) / (sin((((double) M_PI) * (angle * 0.005555555555555556))) * -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 <= 3.5e-133) {
tmp = 180.0 * (Math.atan(((y_45_scale * 1.0) / (Math.sin((0.005555555555555556 * (angle * Math.PI))) * -x_45_scale))) / Math.PI);
} else if (b_m <= 2.3e+60) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
} else {
tmp = (180.0 * Math.atan(((y_45_scale * 1.0) / (Math.sin((Math.PI * (angle * 0.005555555555555556))) * -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 <= 3.5e-133: tmp = 180.0 * (math.atan(((y_45_scale * 1.0) / (math.sin((0.005555555555555556 * (angle * math.pi))) * -x_45_scale))) / math.pi) elif b_m <= 2.3e+60: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi) else: tmp = (180.0 * math.atan(((y_45_scale * 1.0) / (math.sin((math.pi * (angle * 0.005555555555555556))) * -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 <= 3.5e-133) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * 1.0) / Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-x_45_scale)))) / pi)); elseif (b_m <= 2.3e+60) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(Float64(y_45_scale * 1.0) / Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 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) tmp = 0.0; if (b_m <= 3.5e-133) tmp = 180.0 * (atan(((y_45_scale * 1.0) / (sin((0.005555555555555556 * (angle * pi))) * -x_45_scale))) / pi); elseif (b_m <= 2.3e+60) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi); else tmp = (180.0 * atan(((y_45_scale * 1.0) / (sin((pi * (angle * 0.005555555555555556))) * -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, 3.5e-133], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * 1.0), $MachinePrecision] / N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.3e+60], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(N[(y$45$scale * 1.0), $MachinePrecision] / N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-133}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot 1}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale \cdot 1}{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.50000000000000003e-133Initial program 22.0%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.8%
Taylor expanded in b around inf
Applied rewrites40.3%
Taylor expanded in angle around 0
Applied rewrites43.2%
if 3.50000000000000003e-133 < b < 2.30000000000000017e60Initial program 40.3%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.0%
Applied rewrites30.0%
Taylor expanded in x-scale around 0
Applied rewrites53.1%
if 2.30000000000000017e60 < b Initial program 13.9%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites19.6%
Taylor expanded in b around inf
Applied rewrites72.2%
Taylor expanded in angle around 0
Applied rewrites70.0%
Applied rewrites70.3%
Final simplification50.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(/
(* y-scale 1.0)
(* (sin (* 0.005555555555555556 (* angle PI))) (- x-scale))))
PI))))
(if (<= b_m 3.5e-133)
t_0
(if (<= b_m 3.05e+60)
(*
180.0
(/
(atan
(/
(/ (* -180.0 (* y-scale (* b_m b_m))) x-scale)
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
t_0))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 180.0 * (atan(((y_45_scale * 1.0) / (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * -x_45_scale))) / ((double) M_PI));
double tmp;
if (b_m <= 3.5e-133) {
tmp = t_0;
} else if (b_m <= 3.05e+60) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
} else {
tmp = t_0;
}
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 = 180.0 * (Math.atan(((y_45_scale * 1.0) / (Math.sin((0.005555555555555556 * (angle * Math.PI))) * -x_45_scale))) / Math.PI);
double tmp;
if (b_m <= 3.5e-133) {
tmp = t_0;
} else if (b_m <= 3.05e+60) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
} else {
tmp = t_0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 180.0 * (math.atan(((y_45_scale * 1.0) / (math.sin((0.005555555555555556 * (angle * math.pi))) * -x_45_scale))) / math.pi) tmp = 0 if b_m <= 3.5e-133: tmp = t_0 elif b_m <= 3.05e+60: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi) else: tmp = t_0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * 1.0) / Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-x_45_scale)))) / pi)) tmp = 0.0 if (b_m <= 3.5e-133) tmp = t_0; elseif (b_m <= 3.05e+60) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi)); else tmp = t_0; end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 180.0 * (atan(((y_45_scale * 1.0) / (sin((0.005555555555555556 * (angle * pi))) * -x_45_scale))) / pi); tmp = 0.0; if (b_m <= 3.5e-133) tmp = t_0; elseif (b_m <= 3.05e+60) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi); else tmp = t_0; 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[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * 1.0), $MachinePrecision] / N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 3.5e-133], t$95$0, If[LessEqual[b$95$m, 3.05e+60], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot 1}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b\_m \leq 3.05 \cdot 10^{+60}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < 3.50000000000000003e-133 or 3.05e60 < b Initial program 20.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites28.9%
Taylor expanded in b around inf
Applied rewrites47.8%
Taylor expanded in angle around 0
Applied rewrites49.5%
if 3.50000000000000003e-133 < b < 3.05e60Initial program 40.3%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.0%
Applied rewrites30.0%
Taylor expanded in x-scale around 0
Applied rewrites53.1%
Final simplification50.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6.7e-127)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
(if (<= b_m 8e+112)
(*
180.0
(/
(atan
(/
(* 90.0 (* -2.0 (/ (* y-scale (* b_m b_m)) x-scale)))
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else if (b_m <= 8e+112) {
tmp = 180.0 * (atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else if (b_m <= 8e+112) {
tmp = 180.0 * (Math.atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6.7e-127: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) elif b_m <= 8e+112: tmp = 180.0 * (math.atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6.7e-127) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); elseif (b_m <= 8e+112) tmp = Float64(180.0 * Float64(atan(Float64(Float64(90.0 * Float64(-2.0 * Float64(Float64(y_45_scale * Float64(b_m * b_m)) / x_45_scale))) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 6.7e-127) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); elseif (b_m <= 8e+112) tmp = 180.0 * (atan(((90.0 * (-2.0 * ((y_45_scale * (b_m * b_m)) / x_45_scale))) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi); else tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 6.7e-127], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 8e+112], N[(180.0 * N[(N[ArcTan[N[(N[(90.0 * N[(-2.0 * N[(N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6.7 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 8 \cdot 10^{+112}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \left(-2 \cdot \frac{y-scale \cdot \left(b\_m \cdot b\_m\right)}{x-scale}\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.7000000000000001e-127Initial program 21.7%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.1%
Taylor expanded in a around inf
Applied rewrites12.9%
Taylor expanded in x-scale around inf
Applied rewrites2.1%
Taylor expanded in a around 0
Applied rewrites16.9%
if 6.7000000000000001e-127 < b < 7.9999999999999994e112Initial program 44.6%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites53.5%
if 7.9999999999999994e112 < b Initial program 5.1%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in a around 0
Applied rewrites69.9%
Applied rewrites67.7%
Final simplification31.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6.7e-127)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
(if (<= b_m 8e+112)
(*
180.0
(/
(atan
(/
(/ (* -180.0 (* y-scale (* b_m b_m))) x-scale)
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else if (b_m <= 8e+112) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else if (b_m <= 8e+112) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6.7e-127: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) elif b_m <= 8e+112: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6.7e-127) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); elseif (b_m <= 8e+112) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 6.7e-127) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); elseif (b_m <= 8e+112) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi); else tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 6.7e-127], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 8e+112], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6.7 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 8 \cdot 10^{+112}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.7000000000000001e-127Initial program 21.7%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.1%
Taylor expanded in a around inf
Applied rewrites12.9%
Taylor expanded in x-scale around inf
Applied rewrites2.1%
Taylor expanded in a around 0
Applied rewrites16.9%
if 6.7000000000000001e-127 < b < 7.9999999999999994e112Initial program 44.6%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.8%
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites53.5%
if 7.9999999999999994e112 < b Initial program 5.1%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in a around 0
Applied rewrites69.9%
Applied rewrites67.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6.7e-127)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
(if (<= b_m 2.5e+111)
(*
180.0
(/
(atan
(/
(* -180.0 (* y-scale (* b_m b_m)))
(* angle (* (* (+ b_m a) (- b_m a)) (* x-scale PI)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else if (b_m <= 2.5e+111) {
tmp = 180.0 * (atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else if (b_m <= 2.5e+111) {
tmp = 180.0 * (Math.atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6.7e-127: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) elif b_m <= 2.5e+111: tmp = 180.0 * (math.atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6.7e-127) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); elseif (b_m <= 2.5e+111) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / Float64(angle * Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * Float64(x_45_scale * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 6.7e-127) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); elseif (b_m <= 2.5e+111) tmp = 180.0 * (atan(((-180.0 * (y_45_scale * (b_m * b_m))) / (angle * (((b_m + a) * (b_m - a)) * (x_45_scale * pi))))) / pi); else tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 6.7e-127], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.5e+111], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6.7 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{angle \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot \pi\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.7000000000000001e-127Initial program 21.7%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.1%
Taylor expanded in a around inf
Applied rewrites12.9%
Taylor expanded in x-scale around inf
Applied rewrites2.1%
Taylor expanded in a around 0
Applied rewrites16.9%
if 6.7000000000000001e-127 < b < 2.4999999999999998e111Initial program 44.6%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.8%
Taylor expanded in a around inf
Applied rewrites11.2%
Taylor expanded in x-scale around 0
Applied rewrites55.6%
if 2.4999999999999998e111 < b Initial program 5.1%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in a around 0
Applied rewrites69.9%
Applied rewrites67.7%
Final simplification31.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 6.7e-127)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
(if (<= b_m 2.5e+111)
(*
180.0
(/
(atan
(*
-180.0
(/
(* y-scale (* b_m b_m))
(* angle (* x-scale (* PI (* (+ b_m a) (- b_m a))))))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else if (b_m <= 2.5e+111) {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale * (b_m * b_m)) / (angle * (x_45_scale * (((double) M_PI) * ((b_m + a) * (b_m - a)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 6.7e-127) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else if (b_m <= 2.5e+111) {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale * (b_m * b_m)) / (angle * (x_45_scale * (Math.PI * ((b_m + a) * (b_m - a)))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 6.7e-127: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) elif b_m <= 2.5e+111: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale * (b_m * b_m)) / (angle * (x_45_scale * (math.pi * ((b_m + a) * (b_m - a)))))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 6.7e-127) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); elseif (b_m <= 2.5e+111) tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale * Float64(b_m * b_m)) / Float64(angle * Float64(x_45_scale * Float64(pi * Float64(Float64(b_m + a) * Float64(b_m - a)))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 6.7e-127) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); elseif (b_m <= 2.5e+111) tmp = 180.0 * (atan((-180.0 * ((y_45_scale * (b_m * b_m)) / (angle * (x_45_scale * (pi * ((b_m + a) * (b_m - a)))))))) / pi); else tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 6.7e-127], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.5e+111], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(x$45$scale * N[(Pi * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 6.7 \cdot 10^{-127}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale \cdot \left(b\_m \cdot b\_m\right)}{angle \cdot \left(x-scale \cdot \left(\pi \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}\\
\end{array}
\end{array}
if b < 6.7000000000000001e-127Initial program 21.7%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites12.1%
Taylor expanded in a around inf
Applied rewrites12.9%
Taylor expanded in x-scale around inf
Applied rewrites2.1%
Taylor expanded in a around 0
Applied rewrites16.9%
if 6.7000000000000001e-127 < b < 2.4999999999999998e111Initial program 44.6%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites53.3%
if 2.4999999999999998e111 < b Initial program 5.1%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in a around 0
Applied rewrites69.9%
Applied rewrites67.7%
Final simplification31.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(*
180.0
(/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI))))
(if (<= a 6.8e+126)
t_0
(if (<= a 3e+207)
(*
180.0
(/
(atan
(/
(* 180.0 (* x-scale (* a a)))
(* (* angle (* b_m b_m)) (* y-scale PI))))
PI))
t_0))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
double tmp;
if (a <= 6.8e+126) {
tmp = t_0;
} else if (a <= 3e+207) {
tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * ((double) M_PI))))) / ((double) M_PI));
} else {
tmp = t_0;
}
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 = 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
double tmp;
if (a <= 6.8e+126) {
tmp = t_0;
} else if (a <= 3e+207) {
tmp = 180.0 * (Math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * Math.PI)))) / Math.PI);
} else {
tmp = t_0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi) tmp = 0 if a <= 6.8e+126: tmp = t_0 elif a <= 3e+207: tmp = 180.0 * (math.atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * math.pi)))) / math.pi) else: tmp = t_0 return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)) tmp = 0.0 if (a <= 6.8e+126) tmp = t_0; elseif (a <= 3e+207) tmp = Float64(180.0 * Float64(atan(Float64(Float64(180.0 * Float64(x_45_scale * Float64(a * a))) / Float64(Float64(angle * Float64(b_m * b_m)) * Float64(y_45_scale * pi)))) / pi)); else tmp = t_0; end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); tmp = 0.0; if (a <= 6.8e+126) tmp = t_0; elseif (a <= 3e+207) tmp = 180.0 * (atan(((180.0 * (x_45_scale * (a * a))) / ((angle * (b_m * b_m)) * (y_45_scale * pi)))) / pi); else tmp = t_0; 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[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 6.8e+126], t$95$0, If[LessEqual[a, 3e+207], N[(180.0 * N[(N[ArcTan[N[(N[(180.0 * N[(x$45$scale * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}\\
\mathbf{if}\;a \leq 6.8 \cdot 10^{+126}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+207}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{180 \cdot \left(x-scale \cdot \left(a \cdot a\right)\right)}{\left(angle \cdot \left(b\_m \cdot b\_m\right)\right) \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < 6.79999999999999979e126 or 2.99999999999999983e207 < a Initial program 23.3%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.8%
Taylor expanded in a around 0
Applied rewrites45.5%
Applied rewrites47.4%
if 6.79999999999999979e126 < a < 2.99999999999999983e207Initial program 16.7%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites7.2%
Taylor expanded in a around inf
Applied rewrites2.4%
Taylor expanded in x-scale around inf
Applied rewrites0.9%
Taylor expanded in a around 0
Applied rewrites51.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ (/ y-scale (* x-scale PI)) angle))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * ((double) M_PI))) / angle))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * ((y_45_scale / (x_45_scale * Math.PI)) / angle))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * ((y_45_scale / (x_45_scale * math.pi)) / angle))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(y_45_scale / Float64(x_45_scale * pi)) / angle))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * ((y_45_scale / (x_45_scale * pi)) / angle))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(y$45$scale / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\frac{y-scale}{x-scale \cdot \pi}}{angle}\right)}{\pi}
\end{array}
Initial program 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around 0
Applied rewrites42.4%
Applied rewrites44.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (atan (/ (* y-scale -180.0) (* angle (* x-scale PI)))) (* 180.0 (/ 1.0 PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return atan(((y_45_scale * -180.0) / (angle * (x_45_scale * ((double) M_PI))))) * (180.0 * (1.0 / ((double) M_PI)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return Math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * Math.PI)))) * (180.0 * (1.0 / Math.PI));
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return math.atan(((y_45_scale * -180.0) / (angle * (x_45_scale * math.pi)))) * (180.0 * (1.0 / math.pi))
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(atan(Float64(Float64(y_45_scale * -180.0) / Float64(angle * Float64(x_45_scale * pi)))) * Float64(180.0 * Float64(1.0 / pi))) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = atan(((y_45_scale * -180.0) / (angle * (x_45_scale * pi)))) * (180.0 * (1.0 / pi)); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[ArcTan[N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 * N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right) \cdot \left(180 \cdot \frac{1}{\pi}\right)
\end{array}
Initial program 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around 0
Applied rewrites42.4%
Applied rewrites42.5%
Final simplification42.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (* y-scale -180.0) (* PI (* angle 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(((y_45_scale * -180.0) / (((double) M_PI) * (angle * 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(((y_45_scale * -180.0) / (Math.PI * (angle * 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(((y_45_scale * -180.0) / (math.pi * (angle * 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(Float64(y_45_scale * -180.0) / Float64(pi * Float64(angle * 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(((y_45_scale * -180.0) / (pi * (angle * 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[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * N[(angle * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{\pi \cdot \left(angle \cdot x-scale\right)}\right)}{\pi}
\end{array}
Initial program 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in a around 0
Applied rewrites42.5%
Final simplification42.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (* y-scale -180.0) (* 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(((y_45_scale * -180.0) / (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(((y_45_scale * -180.0) / (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(((y_45_scale * -180.0) / (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(Float64(y_45_scale * -180.0) / 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(((y_45_scale * -180.0) / (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[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Initial program 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around inf
Applied rewrites16.0%
Taylor expanded in a around 0
Applied rewrites42.5%
Final simplification42.5%
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 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around 0
Applied rewrites42.4%
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 22.8%
Taylor expanded in angle around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites14.2%
Taylor expanded in a around inf
Applied rewrites16.0%
herbie shell --seed 2024226
(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)))