
(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}
Herbie found 10 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 8e-61)
(* 180.0 (/ (atan (/ (* y-scale t_1) (* x-scale (cos t_0)))) PI))
(*
180.0
(/ (atan (* 0.5 (/ (* -2.0 (/ y-scale x-scale)) (* 1.0 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 <= 8e-61) {
tmp = 180.0 * (atan(((y_45_scale * t_1) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * 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 <= 8e-61) {
tmp = 180.0 * (Math.atan(((y_45_scale * t_1) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * 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 <= 8e-61: tmp = 180.0 * (math.atan(((y_45_scale * t_1) / (x_45_scale * math.cos(t_0)))) / math.pi) else: tmp = 180.0 * (math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * 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 <= 8e-61) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / Float64(x_45_scale * cos(t_0)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(-2.0 * Float64(y_45_scale / x_45_scale)) / Float64(1.0 * 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 <= 8e-61) tmp = 180.0 * (atan(((y_45_scale * t_1) / (x_45_scale * cos(t_0)))) / pi); else tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * 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, 8e-61], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(-2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(1.0 * t$95$1), $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 := \sin t\_0\\
\mathbf{if}\;b\_m \leq 8 \cdot 10^{-61}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale}{x-scale}}{1 \cdot t\_1}\right)}{\pi}\\
\end{array}
\end{array}
if b < 8.0000000000000003e-61Initial program 13.9%
Taylor expanded in x-scale around 0
Applied rewrites29.8%
Taylor expanded in a around inf
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
Applied rewrites45.1%
if 8.0000000000000003e-61 < b Initial program 13.9%
Taylor expanded in b around inf
Applied rewrites23.2%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites44.7%
Taylor expanded in angle around 0
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites45.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 1.0 (sin (* 0.005555555555555556 (* angle PI))))))
(if (<= x-scale 2.35e-166)
(*
180.0
(/
(atan
(*
0.5
(/
(*
-2.0
(/
(*
y-scale
(+ 1.0 (* -3.08641975308642e-5 (* (* angle angle) (* PI PI)))))
x-scale))
t_0)))
PI))
(* 180.0 (/ (atan (* 0.5 (/ (* -2.0 (/ y-scale x-scale)) t_0))) PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 1.0 * sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (x_45_scale <= 2.35e-166) {
tmp = 180.0 * (atan((0.5 * ((-2.0 * ((y_45_scale * (1.0 + (-3.08641975308642e-5 * ((angle * angle) * (((double) M_PI) * ((double) M_PI)))))) / x_45_scale)) / t_0))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 1.0 * Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (x_45_scale <= 2.35e-166) {
tmp = 180.0 * (Math.atan((0.5 * ((-2.0 * ((y_45_scale * (1.0 + (-3.08641975308642e-5 * ((angle * angle) * (Math.PI * Math.PI))))) / x_45_scale)) / t_0))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / t_0))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = 1.0 * math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if x_45_scale <= 2.35e-166: tmp = 180.0 * (math.atan((0.5 * ((-2.0 * ((y_45_scale * (1.0 + (-3.08641975308642e-5 * ((angle * angle) * (math.pi * math.pi))))) / x_45_scale)) / t_0))) / math.pi) else: tmp = 180.0 * (math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / t_0))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(1.0 * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) tmp = 0.0 if (x_45_scale <= 2.35e-166) tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * Float64(1.0 + Float64(-3.08641975308642e-5 * Float64(Float64(angle * angle) * Float64(pi * pi))))) / x_45_scale)) / t_0))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(-2.0 * Float64(y_45_scale / x_45_scale)) / t_0))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = 1.0 * sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (x_45_scale <= 2.35e-166) tmp = 180.0 * (atan((0.5 * ((-2.0 * ((y_45_scale * (1.0 + (-3.08641975308642e-5 * ((angle * angle) * (pi * pi))))) / x_45_scale)) / t_0))) / pi); else tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / t_0))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(1.0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, 2.35e-166], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(-2.0 * N[(N[(y$45$scale * N[(1.0 + N[(-3.08641975308642e-5 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(-2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;x-scale \leq 2.35 \cdot 10^{-166}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot \left(1 + -3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot \left(\pi \cdot \pi\right)\right)\right)}{x-scale}}{t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale}{x-scale}}{t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if x-scale < 2.35000000000000007e-166Initial program 13.9%
Taylor expanded in b around inf
Applied rewrites23.2%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites44.7%
Taylor expanded in angle around 0
Applied rewrites45.0%
Taylor expanded in angle around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f6439.1
Applied rewrites39.1%
if 2.35000000000000007e-166 < x-scale Initial program 13.9%
Taylor expanded in b around inf
Applied rewrites23.2%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites44.7%
Taylor expanded in angle around 0
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites45.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 7.7e-233)
(*
180.0
(/
(atan
(*
90.0
(*
2.0
(/ (* (* a a) x-scale) (* angle (* (* b_m b_m) (* y-scale PI)))))))
PI))
(*
180.0
(/
(atan
(*
0.5
(/
(* -2.0 (/ y-scale x-scale))
(* 1.0 (sin (* 0.005555555555555556 (* angle PI)))))))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 7.7e-233) {
tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * ((double) M_PI)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * sin((0.005555555555555556 * (angle * ((double) M_PI)))))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 7.7e-233) {
tmp = 180.0 * (Math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * Math.PI))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * Math.sin((0.005555555555555556 * (angle * Math.PI))))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 7.7e-233: tmp = 180.0 * (math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * math.pi))))))) / math.pi) else: tmp = 180.0 * (math.atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * math.sin((0.005555555555555556 * (angle * math.pi))))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 7.7e-233) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(2.0 * Float64(Float64(Float64(a * a) * x_45_scale) / Float64(angle * Float64(Float64(b_m * b_m) * Float64(y_45_scale * pi))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(-2.0 * Float64(y_45_scale / x_45_scale)) / Float64(1.0 * sin(Float64(0.005555555555555556 * Float64(angle * pi))))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 7.7e-233) tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * pi))))))) / pi); else tmp = 180.0 * (atan((0.5 * ((-2.0 * (y_45_scale / x_45_scale)) / (1.0 * sin((0.005555555555555556 * (angle * pi))))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 7.7e-233], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(2.0 * N[(N[(N[(a * a), $MachinePrecision] * x$45$scale), $MachinePrecision] / N[(angle * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(-2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(1.0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 7.7 \cdot 10^{-233}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(2 \cdot \frac{\left(a \cdot a\right) \cdot x-scale}{angle \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(y-scale \cdot \pi\right)\right)}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale}{x-scale}}{1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 7.70000000000000007e-233Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites23.7%
Taylor expanded in x-scale around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6413.1
Applied rewrites13.1%
if 7.70000000000000007e-233 < b Initial program 13.9%
Taylor expanded in b around inf
Applied rewrites23.2%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites44.7%
Taylor expanded in angle around 0
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites45.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0
(*
180.0
(/
(atan
(*
0.5
(/
(* -2.0 (/ (* y-scale (pow 1.0 2.0)) x-scale))
(* 0.005555555555555556 (* angle PI)))))
PI))))
(if (<= b_m 1.6e-202)
(*
180.0
(/
(atan
(*
90.0
(*
2.0
(/ (* (* a a) x-scale) (* angle (* (* b_m b_m) (* y-scale PI)))))))
PI))
(if (<= b_m 3.9e-175)
t_0
(if (<= b_m 1.8e+114)
(*
180.0
(/
(atan
(*
90.0
(/
(* -2.0 (/ (* (* b_m b_m) y-scale) x-scale))
(* angle (* PI (- (* b_m b_m) (* a 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((0.5 * ((-2.0 * ((y_45_scale * pow(1.0, 2.0)) / x_45_scale)) / (0.005555555555555556 * (angle * ((double) M_PI)))))) / ((double) M_PI));
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * ((double) M_PI)))))))) / ((double) M_PI));
} else if (b_m <= 3.9e-175) {
tmp = t_0;
} else if (b_m <= 1.8e+114) {
tmp = 180.0 * (atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (((double) M_PI) * ((b_m * b_m) - (a * 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((0.5 * ((-2.0 * ((y_45_scale * Math.pow(1.0, 2.0)) / x_45_scale)) / (0.005555555555555556 * (angle * Math.PI))))) / Math.PI);
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (Math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * Math.PI))))))) / Math.PI);
} else if (b_m <= 3.9e-175) {
tmp = t_0;
} else if (b_m <= 1.8e+114) {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (Math.PI * ((b_m * b_m) - (a * 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((0.5 * ((-2.0 * ((y_45_scale * math.pow(1.0, 2.0)) / x_45_scale)) / (0.005555555555555556 * (angle * math.pi))))) / math.pi) tmp = 0 if b_m <= 1.6e-202: tmp = 180.0 * (math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * math.pi))))))) / math.pi) elif b_m <= 3.9e-175: tmp = t_0 elif b_m <= 1.8e+114: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (math.pi * ((b_m * b_m) - (a * 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(0.5 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * (1.0 ^ 2.0)) / x_45_scale)) / Float64(0.005555555555555556 * Float64(angle * pi))))) / pi)) tmp = 0.0 if (b_m <= 1.6e-202) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(2.0 * Float64(Float64(Float64(a * a) * x_45_scale) / Float64(angle * Float64(Float64(b_m * b_m) * Float64(y_45_scale * pi))))))) / pi)); elseif (b_m <= 3.9e-175) tmp = t_0; elseif (b_m <= 1.8e+114) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale)) / Float64(angle * Float64(pi * Float64(Float64(b_m * b_m) - Float64(a * 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((0.5 * ((-2.0 * ((y_45_scale * (1.0 ^ 2.0)) / x_45_scale)) / (0.005555555555555556 * (angle * pi))))) / pi); tmp = 0.0; if (b_m <= 1.6e-202) tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * pi))))))) / pi); elseif (b_m <= 3.9e-175) tmp = t_0; elseif (b_m <= 1.8e+114) tmp = 180.0 * (atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (pi * ((b_m * b_m) - (a * 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[(0.5 * N[(N[(-2.0 * N[(N[(y$45$scale * N[Power[1.0, 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.6e-202], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(2.0 * N[(N[(N[(a * a), $MachinePrecision] * x$45$scale), $MachinePrecision] / N[(angle * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.9e-175], t$95$0, If[LessEqual[b$95$m, 1.8e+114], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(Pi * N[(N[(b$95$m * b$95$m), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $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(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {1}^{2}}{x-scale}}{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}{\pi}\\
\mathbf{if}\;b\_m \leq 1.6 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(2 \cdot \frac{\left(a \cdot a\right) \cdot x-scale}{angle \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(y-scale \cdot \pi\right)\right)}\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3.9 \cdot 10^{-175}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b\_m \leq 1.8 \cdot 10^{+114}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale}}{angle \cdot \left(\pi \cdot \left(b\_m \cdot b\_m - a \cdot a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < 1.6000000000000001e-202Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites23.7%
Taylor expanded in x-scale around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6413.1
Applied rewrites13.1%
if 1.6000000000000001e-202 < b < 3.89999999999999998e-175 or 1.8e114 < b Initial program 13.9%
Taylor expanded in b around inf
Applied rewrites23.2%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites45.0%
Taylor expanded in angle around 0
Applied rewrites44.7%
Taylor expanded in angle around 0
Applied rewrites45.0%
Taylor expanded in angle around 0
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6439.4
Applied rewrites39.4%
if 3.89999999999999998e-175 < b < 1.8e114Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.5
Applied rewrites24.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* x-scale PI))))
(if (<= b_m 1.6e-202)
(*
180.0
(/
(atan
(*
90.0
(*
2.0
(/ (* (* a a) x-scale) (* angle (* (* b_m b_m) (* y-scale PI)))))))
PI))
(if (<= b_m 3.9e-175)
(*
180.0
(/
(atan (* 90.0 (/ (* -2.0 (/ (* y-scale y-scale) t_0)) y-scale)))
PI))
(if (<= b_m 2.5e+113)
(*
180.0
(/
(atan
(*
90.0
(/
(* -2.0 (/ (* (* b_m b_m) y-scale) x-scale))
(* angle (* PI (- (* b_m b_m) (* a a)))))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale t_0))) PI)))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * ((double) M_PI));
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * ((double) M_PI)))))))) / ((double) M_PI));
} else if (b_m <= 3.9e-175) {
tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / ((double) M_PI));
} else if (b_m <= 2.5e+113) {
tmp = 180.0 * (atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (((double) M_PI) * ((b_m * b_m) - (a * a))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * Math.PI);
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (Math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * Math.PI))))))) / Math.PI);
} else if (b_m <= 3.9e-175) {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / Math.PI);
} else if (b_m <= 2.5e+113) {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (Math.PI * ((b_m * b_m) - (a * a))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / t_0))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = angle * (x_45_scale * math.pi) tmp = 0 if b_m <= 1.6e-202: tmp = 180.0 * (math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * math.pi))))))) / math.pi) elif b_m <= 3.9e-175: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / math.pi) elif b_m <= 2.5e+113: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (math.pi * ((b_m * b_m) - (a * a))))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / t_0))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(angle * Float64(x_45_scale * pi)) tmp = 0.0 if (b_m <= 1.6e-202) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(2.0 * Float64(Float64(Float64(a * a) * x_45_scale) / Float64(angle * Float64(Float64(b_m * b_m) * Float64(y_45_scale * pi))))))) / pi)); elseif (b_m <= 3.9e-175) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi)); elseif (b_m <= 2.5e+113) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale)) / Float64(angle * Float64(pi * Float64(Float64(b_m * b_m) - Float64(a * a))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / t_0))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = angle * (x_45_scale * pi); tmp = 0.0; if (b_m <= 1.6e-202) tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * pi))))))) / pi); elseif (b_m <= 3.9e-175) tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi); elseif (b_m <= 2.5e+113) tmp = 180.0 * (atan((90.0 * ((-2.0 * (((b_m * b_m) * y_45_scale) / x_45_scale)) / (angle * (pi * ((b_m * b_m) - (a * a))))))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.6e-202], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(2.0 * N[(N[(N[(a * a), $MachinePrecision] * x$45$scale), $MachinePrecision] / N[(angle * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.9e-175], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(y$45$scale * y$45$scale), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.5e+113], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(Pi * N[(N[(b$95$m * b$95$m), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(x-scale \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.6 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(2 \cdot \frac{\left(a \cdot a\right) \cdot x-scale}{angle \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(y-scale \cdot \pi\right)\right)}\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3.9 \cdot 10^{-175}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{y-scale \cdot y-scale}{t\_0}}{y-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.5 \cdot 10^{+113}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale}}{angle \cdot \left(\pi \cdot \left(b\_m \cdot b\_m - a \cdot a\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.6000000000000001e-202Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites23.7%
Taylor expanded in x-scale around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6413.1
Applied rewrites13.1%
if 1.6000000000000001e-202 < b < 3.89999999999999998e-175Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in y-scale around 0
Applied rewrites12.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if 3.89999999999999998e-175 < b < 2.5e113Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.5
Applied rewrites24.5%
if 2.5e113 < b Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6437.7
Applied rewrites37.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* x-scale PI))))
(if (<= b_m 1.6e-202)
(*
180.0
(/
(atan
(*
90.0
(*
2.0
(/ (* (* a a) x-scale) (* angle (* (* b_m b_m) (* y-scale PI)))))))
PI))
(if (<= b_m 1.15e-170)
(*
180.0
(/
(atan (* 90.0 (/ (* -2.0 (/ (* y-scale y-scale) t_0)) y-scale)))
PI))
(if (<= b_m 0.0026)
(*
180.0
(/
(atan
(*
-180.0
(/
(* (* b_m b_m) y-scale)
(* angle (* x-scale (* PI (- (* b_m b_m) (* a a))))))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale t_0))) PI)))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * ((double) M_PI));
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * ((double) M_PI)))))))) / ((double) M_PI));
} else if (b_m <= 1.15e-170) {
tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / ((double) M_PI));
} else if (b_m <= 0.0026) {
tmp = 180.0 * (atan((-180.0 * (((b_m * b_m) * y_45_scale) / (angle * (x_45_scale * (((double) M_PI) * ((b_m * b_m) - (a * a)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * Math.PI);
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (Math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * Math.PI))))))) / Math.PI);
} else if (b_m <= 1.15e-170) {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / Math.PI);
} else if (b_m <= 0.0026) {
tmp = 180.0 * (Math.atan((-180.0 * (((b_m * b_m) * y_45_scale) / (angle * (x_45_scale * (Math.PI * ((b_m * b_m) - (a * a)))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / t_0))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = angle * (x_45_scale * math.pi) tmp = 0 if b_m <= 1.6e-202: tmp = 180.0 * (math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * math.pi))))))) / math.pi) elif b_m <= 1.15e-170: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / math.pi) elif b_m <= 0.0026: tmp = 180.0 * (math.atan((-180.0 * (((b_m * b_m) * y_45_scale) / (angle * (x_45_scale * (math.pi * ((b_m * b_m) - (a * a)))))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / t_0))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(angle * Float64(x_45_scale * pi)) tmp = 0.0 if (b_m <= 1.6e-202) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(2.0 * Float64(Float64(Float64(a * a) * x_45_scale) / Float64(angle * Float64(Float64(b_m * b_m) * Float64(y_45_scale * pi))))))) / pi)); elseif (b_m <= 1.15e-170) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi)); elseif (b_m <= 0.0026) tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(Float64(Float64(b_m * b_m) * y_45_scale) / Float64(angle * Float64(x_45_scale * Float64(pi * Float64(Float64(b_m * b_m) - Float64(a * a)))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / t_0))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = angle * (x_45_scale * pi); tmp = 0.0; if (b_m <= 1.6e-202) tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * pi))))))) / pi); elseif (b_m <= 1.15e-170) tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi); elseif (b_m <= 0.0026) tmp = 180.0 * (atan((-180.0 * (((b_m * b_m) * y_45_scale) / (angle * (x_45_scale * (pi * ((b_m * b_m) - (a * a)))))))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.6e-202], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(2.0 * N[(N[(N[(a * a), $MachinePrecision] * x$45$scale), $MachinePrecision] / N[(angle * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.15e-170], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(y$45$scale * y$45$scale), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 0.0026], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / N[(angle * N[(x$45$scale * N[(Pi * N[(N[(b$95$m * b$95$m), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(x-scale \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.6 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(2 \cdot \frac{\left(a \cdot a\right) \cdot x-scale}{angle \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(y-scale \cdot \pi\right)\right)}\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.15 \cdot 10^{-170}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{y-scale \cdot y-scale}{t\_0}}{y-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 0.0026:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{angle \cdot \left(x-scale \cdot \left(\pi \cdot \left(b\_m \cdot b\_m - a \cdot a\right)\right)\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.6000000000000001e-202Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites23.7%
Taylor expanded in x-scale around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6413.1
Applied rewrites13.1%
if 1.6000000000000001e-202 < b < 1.14999999999999993e-170Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in y-scale around 0
Applied rewrites12.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if 1.14999999999999993e-170 < b < 0.0025999999999999999Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f6424.3
Applied rewrites24.3%
if 0.0025999999999999999 < b Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6437.7
Applied rewrites37.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* x-scale PI))))
(if (<= b_m 1.6e-202)
(*
180.0
(/
(atan
(*
90.0
(*
2.0
(/ (* (* a a) x-scale) (* angle (* (* b_m b_m) (* y-scale PI)))))))
PI))
(if (<= b_m 1.6e-7)
(*
180.0
(/
(atan (* 90.0 (/ (* -2.0 (/ (* y-scale y-scale) t_0)) y-scale)))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale t_0))) PI))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * ((double) M_PI));
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * ((double) M_PI)))))))) / ((double) M_PI));
} else if (b_m <= 1.6e-7) {
tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = angle * (x_45_scale * Math.PI);
double tmp;
if (b_m <= 1.6e-202) {
tmp = 180.0 * (Math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * Math.PI))))))) / Math.PI);
} else if (b_m <= 1.6e-7) {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / t_0))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = angle * (x_45_scale * math.pi) tmp = 0 if b_m <= 1.6e-202: tmp = 180.0 * (math.atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * math.pi))))))) / math.pi) elif b_m <= 1.6e-7: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / t_0))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(angle * Float64(x_45_scale * pi)) tmp = 0.0 if (b_m <= 1.6e-202) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(2.0 * Float64(Float64(Float64(a * a) * x_45_scale) / Float64(angle * Float64(Float64(b_m * b_m) * Float64(y_45_scale * pi))))))) / pi)); elseif (b_m <= 1.6e-7) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / t_0))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = angle * (x_45_scale * pi); tmp = 0.0; if (b_m <= 1.6e-202) tmp = 180.0 * (atan((90.0 * (2.0 * (((a * a) * x_45_scale) / (angle * ((b_m * b_m) * (y_45_scale * pi))))))) / pi); elseif (b_m <= 1.6e-7) tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_45_scale))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.6e-202], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(2.0 * N[(N[(N[(a * a), $MachinePrecision] * x$45$scale), $MachinePrecision] / N[(angle * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.6e-7], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(y$45$scale * y$45$scale), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(x-scale \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.6 \cdot 10^{-202}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(2 \cdot \frac{\left(a \cdot a\right) \cdot x-scale}{angle \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(y-scale \cdot \pi\right)\right)}\right)\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.6 \cdot 10^{-7}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{y-scale \cdot y-scale}{t\_0}}{y-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.6000000000000001e-202Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites23.7%
Taylor expanded in x-scale around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6413.1
Applied rewrites13.1%
if 1.6000000000000001e-202 < b < 1.6e-7Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in y-scale around 0
Applied rewrites12.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if 1.6e-7 < b Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6437.7
Applied rewrites37.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* angle (* x-scale PI))))
(if (<= x-scale 1.6e-59)
(* 180.0 (/ (atan (* -180.0 (/ y-scale t_0))) PI))
(*
180.0
(/
(atan (* 90.0 (/ (* -2.0 (/ (* y-scale y-scale) t_0)) y-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 = angle * (x_45_scale * ((double) M_PI));
double tmp;
if (x_45_scale <= 1.6e-59) {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_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 = angle * (x_45_scale * Math.PI);
double tmp;
if (x_45_scale <= 1.6e-59) {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / t_0))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_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 = angle * (x_45_scale * math.pi) tmp = 0 if x_45_scale <= 1.6e-59: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / t_0))) / math.pi) else: tmp = 180.0 * (math.atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_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(angle * Float64(x_45_scale * pi)) tmp = 0.0 if (x_45_scale <= 1.6e-59) tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / t_0))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(-2.0 * Float64(Float64(y_45_scale * y_45_scale) / t_0)) / y_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 = angle * (x_45_scale * pi); tmp = 0.0; if (x_45_scale <= 1.6e-59) tmp = 180.0 * (atan((-180.0 * (y_45_scale / t_0))) / pi); else tmp = 180.0 * (atan((90.0 * ((-2.0 * ((y_45_scale * y_45_scale) / t_0)) / y_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[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, 1.6e-59], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(90.0 * N[(N[(-2.0 * N[(N[(y$45$scale * y$45$scale), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(x-scale \cdot \pi\right)\\
\mathbf{if}\;x-scale \leq 1.6 \cdot 10^{-59}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \frac{-2 \cdot \frac{y-scale \cdot y-scale}{t\_0}}{y-scale}\right)}{\pi}\\
\end{array}
\end{array}
if x-scale < 1.6e-59Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6437.7
Applied rewrites37.7%
if 1.6e-59 < x-scale Initial program 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in y-scale around 0
Applied rewrites12.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
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 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6437.7
Applied rewrites37.7%
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 13.9%
Taylor expanded in angle around 0
Applied rewrites11.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6412.2
Applied rewrites12.2%
herbie shell --seed 2025124
(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)))