
(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 (sin t_0))
(t_2 (* x-scale (cos t_0)))
(t_3 (cos (* PI (* angle 0.011111111111111112)))))
(if (<= b_m 3.5e-88)
(* 180.0 (/ (atan (/ (* y-scale t_1) t_2)) PI))
(if (<= b_m 5.2e+144)
(*
180.0
(/
(atan
(*
(/
(fma a (* a (fma -0.5 t_3 0.5)) (* (* b_m b_m) (fma 0.5 t_3 0.5)))
(* t_2 (* t_1 (+ b_m a))))
(/ y-scale (- a b_m))))
PI))
(/
1.0
(/ PI (* 180.0 (atan (* y-scale (/ -1.0 (* x-scale (tan 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = x_45_scale * cos(t_0);
double t_3 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
double tmp;
if (b_m <= 3.5e-88) {
tmp = 180.0 * (atan(((y_45_scale * t_1) / t_2)) / ((double) M_PI));
} else if (b_m <= 5.2e+144) {
tmp = 180.0 * (atan(((fma(a, (a * fma(-0.5, t_3, 0.5)), ((b_m * b_m) * fma(0.5, t_3, 0.5))) / (t_2 * (t_1 * (b_m + a)))) * (y_45_scale / (a - b_m)))) / ((double) M_PI));
} else {
tmp = 1.0 / (((double) M_PI) / (180.0 * atan((y_45_scale * (-1.0 / (x_45_scale * tan(t_0)))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = Float64(x_45_scale * cos(t_0)) t_3 = cos(Float64(pi * Float64(angle * 0.011111111111111112))) tmp = 0.0 if (b_m <= 3.5e-88) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / t_2)) / pi)); elseif (b_m <= 5.2e+144) tmp = Float64(180.0 * Float64(atan(Float64(Float64(fma(a, Float64(a * fma(-0.5, t_3, 0.5)), Float64(Float64(b_m * b_m) * fma(0.5, t_3, 0.5))) / Float64(t_2 * Float64(t_1 * Float64(b_m + a)))) * Float64(y_45_scale / Float64(a - b_m)))) / pi)); else tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(y_45_scale * Float64(-1.0 / Float64(x_45_scale * tan(t_0)))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 3.5e-88], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5.2e+144], N[(180.0 * N[(N[ArcTan[N[(N[(N[(a * N[(a * N[(-0.5 * t$95$3 + 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(0.5 * t$95$3 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * N[(t$95$1 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / N[(a - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(y$45$scale * N[(-1.0 / N[(x$45$scale * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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\\
t_2 := x-scale \cdot \cos t\_0\\
t_3 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-88}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{t\_2}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 5.2 \cdot 10^{+144}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_3, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_3, 0.5\right)\right)}{t\_2 \cdot \left(t\_1 \cdot \left(b\_m + a\right)\right)} \cdot \frac{y-scale}{a - b\_m}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan t\_0}\right)}}\\
\end{array}
\end{array}
if b < 3.5000000000000001e-88Initial program 14.3%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified26.2%
Taylor expanded in b around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6448.6
Simplified48.6%
if 3.5000000000000001e-88 < b < 5.1999999999999998e144Initial program 24.2%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified39.6%
Applied egg-rr36.3%
Applied egg-rr47.8%
if 5.1999999999999998e144 < b Initial program 0.0%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified3.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6485.0
Simplified85.0%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr77.5%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
associate-*l/N/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr87.8%
Final simplification52.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* PI (* angle 0.011111111111111112)))
(t_2 (cos t_1)))
(if (<= b_m 2.2e-88)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(if (<= b_m 5.9e+100)
(*
180.0
(/
(atan
(/
(*
(/
(*
y-scale
(fma
a
(* a (fma -0.5 t_2 0.5))
(* (* b_m b_m) (fma 0.5 t_2 0.5))))
(* (+ b_m a) (* (- b_m a) (sin t_1))))
-2.0)
x-scale))
PI))
(/ (* 180.0 (atan (/ -1.0 (* x-scale (/ (tan 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = ((double) M_PI) * (angle * 0.011111111111111112);
double t_2 = cos(t_1);
double tmp;
if (b_m <= 2.2e-88) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else if (b_m <= 5.9e+100) {
tmp = 180.0 * (atan(((((y_45_scale * fma(a, (a * fma(-0.5, t_2, 0.5)), ((b_m * b_m) * fma(0.5, t_2, 0.5)))) / ((b_m + a) * ((b_m - a) * sin(t_1)))) * -2.0) / x_45_scale)) / ((double) M_PI));
} else {
tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(t_0) / y_45_scale))))) / ((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(pi * Float64(angle * 0.011111111111111112)) t_2 = cos(t_1) tmp = 0.0 if (b_m <= 2.2e-88) 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 <= 5.9e+100) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(y_45_scale * fma(a, Float64(a * fma(-0.5, t_2, 0.5)), Float64(Float64(b_m * b_m) * fma(0.5, t_2, 0.5)))) / Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(t_1)))) * -2.0) / x_45_scale)) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(x_45_scale * Float64(tan(t_0) / y_45_scale))))) / pi); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[b$95$m, 2.2e-88], 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, 5.9e+100], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(y$45$scale * N[(a * N[(a * N[(-0.5 * t$95$2 + 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(0.5 * t$95$2 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(x$45$scale * N[(N[Tan[t$95$0], $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \pi \cdot \left(angle \cdot 0.011111111111111112\right)\\
t_2 := \cos t\_1\\
\mathbf{if}\;b\_m \leq 2.2 \cdot 10^{-88}:\\
\;\;\;\;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 5.9 \cdot 10^{+100}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot \mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_2, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_2, 0.5\right)\right)}{\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_1\right)} \cdot -2}{x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.20000000000000005e-88Initial program 14.3%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified26.2%
Taylor expanded in b around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6448.6
Simplified48.6%
if 2.20000000000000005e-88 < b < 5.90000000000000027e100Initial program 25.3%
Applied egg-rr16.6%
Taylor expanded in x-scale around 0
/-lowering-/.f64N/A
Simplified41.1%
Applied egg-rr46.4%
if 5.90000000000000027e100 < b Initial program 2.2%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified6.1%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.0
Simplified84.0%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr77.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6486.4
Applied egg-rr86.4%
Final simplification52.9%
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 1.5e+20)
(* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
(/ (* 180.0 (atan (/ -1.0 (* x-scale (/ (tan 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 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b_m <= 1.5e+20) {
tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
} else {
tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(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 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b_m <= 1.5e+20) {
tmp = 180.0 * (Math.atan(((y_45_scale * Math.sin(t_0)) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
} else {
tmp = (180.0 * Math.atan((-1.0 / (x_45_scale * (Math.tan(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 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b_m <= 1.5e+20: tmp = 180.0 * (math.atan(((y_45_scale * math.sin(t_0)) / (x_45_scale * math.cos(t_0)))) / math.pi) else: tmp = (180.0 * math.atan((-1.0 / (x_45_scale * (math.tan(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(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b_m <= 1.5e+20) tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(x_45_scale * Float64(tan(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 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b_m <= 1.5e+20) tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / pi); else tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.5e+20], 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], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(x$45$scale * N[(N[Tan[t$95$0], $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 1.5 \cdot 10^{+20}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 1.5e20Initial program 15.8%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified28.1%
Taylor expanded in b around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6448.7
Simplified48.7%
if 1.5e20 < b Initial program 10.0%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified18.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6471.8
Simplified71.8%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr67.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6473.4
Applied egg-rr73.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= x-scale -9e-14)
(/
(*
180.0
(atan
(/
-1.0
(*
(/ x-scale y-scale)
(tan (* (sqrt PI) (* (* 0.005555555555555556 angle) (sqrt PI))))))))
PI)
(if (<= x-scale 4.3e-201)
(*
180.0
(/
(atan
(/
(/
(/
(*
90.0
(fma
y-scale
(* (* b_m b_m) -2.0)
(* 2.0 (* a (/ (* a (* x-scale x-scale)) y-scale)))))
(* (* angle PI) x-scale))
(- b_m a))
(+ b_m a)))
PI))
(/
180.0
(/
PI
(atan
(/
-1.0
(*
(tan (* 0.005555555555555556 (* angle PI)))
(/ x-scale y-scale)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -9e-14) {
tmp = (180.0 * atan((-1.0 / ((x_45_scale / y_45_scale) * tan((sqrt(((double) M_PI)) * ((0.005555555555555556 * angle) * sqrt(((double) M_PI))))))))) / ((double) M_PI);
} else if (x_45_scale <= 4.3e-201) {
tmp = 180.0 * (atan(((((90.0 * fma(y_45_scale, ((b_m * b_m) * -2.0), (2.0 * (a * ((a * (x_45_scale * x_45_scale)) / y_45_scale))))) / ((angle * ((double) M_PI)) * x_45_scale)) / (b_m - a)) / (b_m + a))) / ((double) M_PI));
} else {
tmp = 180.0 / (((double) M_PI) / atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale)))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= -9e-14) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(sqrt(pi) * Float64(Float64(0.005555555555555556 * angle) * sqrt(pi)))))))) / pi); elseif (x_45_scale <= 4.3e-201) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(90.0 * fma(y_45_scale, Float64(Float64(b_m * b_m) * -2.0), Float64(2.0 * Float64(a * Float64(Float64(a * Float64(x_45_scale * x_45_scale)) / y_45_scale))))) / Float64(Float64(angle * pi) * x_45_scale)) / Float64(b_m - a)) / Float64(b_m + a))) / pi)); else tmp = Float64(180.0 / Float64(pi / atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale)))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, -9e-14], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[x$45$scale, 4.3e-201], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(90.0 * N[(y$45$scale * N[(N[(b$95$m * b$95$m), $MachinePrecision] * -2.0), $MachinePrecision] + N[(2.0 * N[(a * N[(N[(a * N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] / N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq -9 \cdot 10^{-14}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)}\right)}{\pi}\\
\mathbf{elif}\;x-scale \leq 4.3 \cdot 10^{-201}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{90 \cdot \mathsf{fma}\left(y-scale, \left(b\_m \cdot b\_m\right) \cdot -2, 2 \cdot \left(a \cdot \frac{a \cdot \left(x-scale \cdot x-scale\right)}{y-scale}\right)\right)}{\left(angle \cdot \pi\right) \cdot x-scale}}{b\_m - a}}{b\_m + a}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}}\\
\end{array}
\end{array}
if x-scale < -8.9999999999999995e-14Initial program 6.8%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified21.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.0
Simplified42.0%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr45.3%
associate-*r*N/A
add-sqr-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6446.9
Applied egg-rr46.9%
if -8.9999999999999995e-14 < x-scale < 4.2999999999999997e-201Initial program 24.2%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified20.0%
Taylor expanded in x-scale around 0
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.3
Simplified27.3%
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr54.3%
if 4.2999999999999997e-201 < x-scale Initial program 12.4%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified22.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6445.8
Simplified45.8%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
atan-lowering-atan.f64N/A
neg-mul-1N/A
clear-numN/A
Applied egg-rr50.2%
Final simplification50.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.35e-178)
(*
180.0
(/
(atan
(/
(fma
(* angle angle)
(* (/ (* y-scale PI) x-scale) 0.001851851851851852)
(* -180.0 (/ y-scale (* PI x-scale))))
angle))
PI))
(if (<= b_m 5.6e+98)
(*
180.0
(/
(atan
(/
(/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
(* (+ b_m a) (- b_m a))))
PI))
(*
(atan
(*
y-scale
(/ -1.0 (* x-scale (tan (* 0.005555555555555556 (* angle PI)))))))
(/ 180.0 PI)))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 2.35e-178) {
tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
} else if (b_m <= 5.6e+98) {
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 = atan((y_45_scale * (-1.0 / (x_45_scale * tan((0.005555555555555556 * (angle * ((double) M_PI)))))))) * (180.0 / ((double) M_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 <= 2.35e-178) tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi)); elseif (b_m <= 5.6e+98) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi)); else tmp = Float64(atan(Float64(y_45_scale * Float64(-1.0 / Float64(x_45_scale * tan(Float64(0.005555555555555556 * Float64(angle * pi))))))) * Float64(180.0 / pi)); end return 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, 2.35e-178], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5.6e+98], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(y$45$scale * N[(-1.0 / N[(x$45$scale * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.35 \cdot 10^{-178}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 5.6 \cdot 10^{+98}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \frac{180}{\pi}\\
\end{array}
\end{array}
if b < 2.35e-178Initial program 13.8%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified25.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.6
Simplified40.6%
Taylor expanded in angle around 0
/-lowering-/.f64N/A
Simplified37.3%
if 2.35e-178 < b < 5.6000000000000001e98Initial program 23.6%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified17.3%
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr17.4%
Taylor expanded in y-scale around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6440.3
Simplified40.3%
if 5.6000000000000001e98 < b Initial program 2.2%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified6.1%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.0
Simplified84.0%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr77.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr84.0%
Final simplification43.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= y-scale 5.5e-109)
(/
(*
180.0
(atan
(/
-1.0
(* (tan (* 0.005555555555555556 (* angle PI))) (/ x-scale y-scale)))))
PI)
(* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 5.5e-109) {
tmp = (180.0 * atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
} else {
tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 5.5e-109) {
tmp = (180.0 * Math.atan((-1.0 / (Math.tan((0.005555555555555556 * (angle * Math.PI))) * (x_45_scale / y_45_scale))))) / Math.PI;
} else {
tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= 5.5e-109: tmp = (180.0 * math.atan((-1.0 / (math.tan((0.005555555555555556 * (angle * math.pi))) * (x_45_scale / y_45_scale))))) / math.pi else: tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= 5.5e-109) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale))))) / pi); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= 5.5e-109) tmp = (180.0 * atan((-1.0 / (tan((0.005555555555555556 * (angle * pi))) * (x_45_scale / y_45_scale))))) / pi; else tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, 5.5e-109], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq 5.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if y-scale < 5.5000000000000003e-109Initial program 11.5%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified26.0%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.2
Simplified47.2%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr49.9%
if 5.5000000000000003e-109 < y-scale Initial program 21.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified16.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.1
Simplified44.1%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.3
Applied egg-rr47.3%
Final simplification49.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= y-scale 1.8e-104)
(*
180.0
(/
(atan
(/
-1.0
(* (tan (* 0.005555555555555556 (* angle PI))) (/ x-scale y-scale))))
PI))
(* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 1.8e-104) {
tmp = 180.0 * (atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= 1.8e-104) {
tmp = 180.0 * (Math.atan((-1.0 / (Math.tan((0.005555555555555556 * (angle * Math.PI))) * (x_45_scale / y_45_scale)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= 1.8e-104: tmp = 180.0 * (math.atan((-1.0 / (math.tan((0.005555555555555556 * (angle * math.pi))) * (x_45_scale / y_45_scale)))) / math.pi) else: tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= 1.8e-104) tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= 1.8e-104) tmp = 180.0 * (atan((-1.0 / (tan((0.005555555555555556 * (angle * pi))) * (x_45_scale / y_45_scale)))) / pi); else tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, 1.8e-104], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq 1.8 \cdot 10^{-104}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\
\end{array}
\end{array}
if y-scale < 1.7999999999999999e-104Initial program 11.5%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified26.0%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.2
Simplified47.2%
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr49.9%
if 1.7999999999999999e-104 < y-scale Initial program 21.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified16.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.1
Simplified44.1%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.3
Applied egg-rr47.3%
Final simplification49.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 4e-179)
(*
180.0
(/
(atan
(/
(fma
(* angle angle)
(* (/ (* y-scale PI) x-scale) 0.001851851851851852)
(* -180.0 (/ y-scale (* PI x-scale))))
angle))
PI))
(if (<= b_m 3.1e+98)
(*
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
(* (tan (* 0.005555555555555556 (* angle PI))) (- x-scale)))))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 4e-179) {
tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
} else if (b_m <= 3.1e+98) {
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 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * -x_45_scale)))) / ((double) M_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 <= 4e-179) tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi)); elseif (b_m <= 3.1e+98) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi)); else tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-x_45_scale))))) / pi); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 4e-179], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.1e+98], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $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 4 \cdot 10^{-179}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3.1 \cdot 10^{+98}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.0000000000000001e-179Initial program 13.8%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified25.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.6
Simplified40.6%
Taylor expanded in angle around 0
/-lowering-/.f64N/A
Simplified37.3%
if 4.0000000000000001e-179 < b < 3.10000000000000019e98Initial program 23.6%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified17.3%
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr17.4%
Taylor expanded in y-scale around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6440.3
Simplified40.3%
if 3.10000000000000019e98 < b Initial program 2.2%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified6.1%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.0
Simplified84.0%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr77.7%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified84.0%
Final simplification43.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 7.2e-179)
(*
180.0
(/
(atan
(/
(fma
(* angle angle)
(* (/ (* y-scale PI) x-scale) 0.001851851851851852)
(* -180.0 (/ y-scale (* PI x-scale))))
angle))
PI))
(if (<= b_m 3e+139)
(*
180.0
(/
(atan
(/
(/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
(* (+ b_m a) (- b_m a))))
PI))
(/
1.0
(/
PI
(* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))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.2e-179) {
tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
} else if (b_m <= 3e+139) {
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 = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
}
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.2e-179) tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi)); elseif (b_m <= 3e+139) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi)); else tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale))))))); end return 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.2e-179], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+139], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 7.2 \cdot 10^{-179}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+139}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\
\end{array}
\end{array}
if b < 7.20000000000000015e-179Initial program 13.8%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified25.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.6
Simplified40.6%
Taylor expanded in angle around 0
/-lowering-/.f64N/A
Simplified37.3%
if 7.20000000000000015e-179 < b < 3e139Initial program 22.9%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified16.0%
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr16.1%
Taylor expanded in y-scale around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6439.8
Simplified39.8%
if 3e139 < b Initial program 0.0%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified0.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6481.1
Simplified81.1%
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9
Applied egg-rr83.9%
Final simplification42.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.6e-253)
(* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))
(if (<= b_m 1.75e+141)
(*
180.0
(/
(atan
(/
(/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
(* (+ b_m a) (- b_m a))))
PI))
(/
1.0
(/
PI
(* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))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 <= 2.6e-253) {
tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
} else if (b_m <= 1.75e+141) {
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 = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
}
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 <= 2.6e-253) {
tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
} else if (b_m <= 1.75e+141) {
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 = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 2.6e-253: tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi) elif b_m <= 1.75e+141: 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 = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale)))))) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 2.6e-253) tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi)); elseif (b_m <= 1.75e+141) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi)); else tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale))))))); 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 <= 2.6e-253) tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi); elseif (b_m <= 1.75e+141) 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 = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale)))))); 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, 2.6e-253], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.75e+141], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-253}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 1.75 \cdot 10^{+141}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\
\end{array}
\end{array}
if b < 2.6e-253Initial program 15.9%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified13.5%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.5
Simplified44.5%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6447.2
Applied egg-rr47.2%
if 2.6e-253 < b < 1.75e141Initial program 17.2%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified12.1%
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr12.2%
Taylor expanded in y-scale around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6436.1
Simplified36.1%
if 1.75e141 < b Initial program 0.0%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified0.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6481.1
Simplified81.1%
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9
Applied egg-rr83.9%
Final simplification47.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 1.7e-24)
(/
(*
180.0
(atan
(/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
PI)
(if (<= b_m 8e+143)
(*
180.0
(/
(atan
(/
(/
(* -180.0 (* y-scale (* b_m b_m)))
(* (* angle PI) (* (+ b_m a) (- b_m a))))
x-scale))
PI))
(/
1.0
(/
PI
(* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))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 <= 1.7e-24) {
tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
} else if (b_m <= 8e+143) {
tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / ((double) M_PI));
} else {
tmp = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
}
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 <= 1.7e-24) {
tmp = (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
} else if (b_m <= 8e+143) {
tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * Math.PI) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / Math.PI);
} else {
tmp = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 1.7e-24: tmp = (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi elif b_m <= 8e+143: tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * math.pi) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / math.pi) else: tmp = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale)))))) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 1.7e-24) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi); elseif (b_m <= 8e+143) tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a)))) / x_45_scale)) / pi)); else tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale))))))); 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 <= 1.7e-24) tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi; elseif (b_m <= 8e+143) tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * pi) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / pi); else tmp = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale)))))); 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, 1.7e-24], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[b$95$m, 8e+143], 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] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 8 \cdot 10^{+143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}}{x-scale}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\
\end{array}
\end{array}
if b < 1.69999999999999996e-24Initial program 15.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified27.1%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6438.9
Simplified38.9%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr43.6%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.2
Simplified42.2%
if 1.69999999999999996e-24 < b < 8.0000000000000002e143Initial program 24.1%
Applied egg-rr12.8%
Taylor expanded in x-scale around 0
/-lowering-/.f64N/A
Simplified47.0%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
--lowering--.f6449.8
Simplified49.8%
if 8.0000000000000002e143 < b Initial program 0.0%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified0.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6481.1
Simplified81.1%
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9
Applied egg-rr83.9%
Final simplification47.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 3.5e-24)
(/
(*
180.0
(atan
(/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
PI)
(if (<= b_m 2.7e+140)
(*
180.0
(/
(atan
(/
(/ (* -180.0 (* y-scale (* b_m b_m))) x-scale)
(* (* angle PI) (* (+ b_m a) (- b_m a)))))
PI))
(/
1.0
(/
PI
(* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))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-24) {
tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
} else if (b_m <= 2.7e+140) {
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 = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
}
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-24) {
tmp = (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
} else if (b_m <= 2.7e+140) {
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 = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
}
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-24: tmp = (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi elif b_m <= 2.7e+140: 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 = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale)))))) 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-24) tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi); elseif (b_m <= 2.7e+140) 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(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale))))))); 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-24) tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi; elseif (b_m <= 2.7e+140) 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 = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale)))))); 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-24], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[b$95$m, 2.7e+140], 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[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\
\mathbf{elif}\;b\_m \leq 2.7 \cdot 10^{+140}:\\
\;\;\;\;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{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\
\end{array}
\end{array}
if b < 3.4999999999999996e-24Initial program 15.1%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified27.1%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6438.9
Simplified38.9%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr43.6%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.2
Simplified42.2%
if 3.4999999999999996e-24 < b < 2.70000000000000018e140Initial program 24.1%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified19.0%
Taylor expanded in x-scale around 0
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.2
Simplified28.2%
Taylor expanded in b around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6449.8
Simplified49.8%
if 2.70000000000000018e140 < b Initial program 0.0%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified0.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6481.1
Simplified81.1%
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
atan-lowering-atan.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9
Applied egg-rr83.9%
Final simplification47.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(/
(*
180.0
(atan
(/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
PI))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}
\end{array}
Initial program 14.7%
Taylor expanded in x-scale around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified26.4%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.2
Simplified44.2%
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr47.0%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6445.0
Simplified45.0%
Final simplification45.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (/ (/ (* y-scale -180.0) (* PI x-scale)) angle)) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((((y_45_scale * -180.0) / (((double) M_PI) * x_45_scale)) / angle)) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((((y_45_scale * -180.0) / (Math.PI * x_45_scale)) / angle)) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((((y_45_scale * -180.0) / (math.pi * x_45_scale)) / angle)) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * -180.0) / Float64(pi * x_45_scale)) / angle)) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((((y_45_scale * -180.0) / (pi * x_45_scale)) / angle)) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi}
\end{array}
Initial program 14.7%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.5
Simplified42.5%
associate-*r/N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.7
Applied egg-rr44.7%
Final simplification44.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * 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{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}
\end{array}
Initial program 14.7%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.5
Simplified42.5%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6444.6
Applied egg-rr44.6%
Final simplification44.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi)
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi)) end
b_m = abs(b); function tmp = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}
\end{array}
Initial program 14.7%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.5
Simplified42.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 (/ 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 14.7%
Taylor expanded in angle around 0
associate-*r/N/A
/-lowering-/.f64N/A
Simplified11.6%
Taylor expanded in a around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6413.5
Simplified13.5%
herbie shell --seed 2024198
(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)))