
(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 11 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 (* PI (* 0.005555555555555556 angle))))
(if (<= b_m 0.48)
(*
180.0
(/
(atan
(*
-0.5
(*
y-scale
(*
-2.0
(/
(sin (* 0.005555555555555556 (* angle (cbrt (pow PI 3.0)))))
(* x-scale (cos (* 0.005555555555555556 (* angle PI)))))))))
PI))
(*
180.0
(/ (atan (/ (/ (* y-scale (cos t_0)) x-scale) (- (sin 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 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 0.48) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * (-2.0 * (sin((0.005555555555555556 * (angle * cbrt(pow(((double) M_PI), 3.0))))) / (x_45_scale * cos((0.005555555555555556 * (angle * ((double) M_PI)))))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((y_45_scale * cos(t_0)) / x_45_scale) / -sin(t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 0.48) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * (-2.0 * (Math.sin((0.005555555555555556 * (angle * Math.cbrt(Math.pow(Math.PI, 3.0))))) / (x_45_scale * Math.cos((0.005555555555555556 * (angle * Math.PI))))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((y_45_scale * Math.cos(t_0)) / x_45_scale) / -Math.sin(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(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (b_m <= 0.48) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(-2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(angle * cbrt((pi ^ 3.0))))) / Float64(x_45_scale * cos(Float64(0.005555555555555556 * Float64(angle * pi))))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * cos(t_0)) / x_45_scale) / Float64(-sin(t_0)))) / pi)); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 0.48], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(-2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x$45$scale * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / (-N[Sin[t$95$0], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b\_m \leq 0.48:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(-2 \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right)}{x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot \cos t\_0}{x-scale}}{-\sin t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if b < 0.47999999999999998Initial program 15.5%
Simplified16.1%
Taylor expanded in x-scale around 0 28.2%
Simplified33.4%
Taylor expanded in a around inf 51.9%
add-cbrt-cube52.9%
pow352.9%
Applied egg-rr52.9%
if 0.47999999999999998 < b Initial program 9.1%
Simplified7.4%
Taylor expanded in x-scale around 0 18.3%
Simplified18.7%
add-log-exp20.5%
Applied egg-rr20.5%
Taylor expanded in a around 0 58.0%
mul-1-neg58.0%
associate-/r*57.8%
associate-*r*59.5%
associate-*r*59.5%
Simplified59.5%
Final simplification54.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle))))
(if (<= b_m 3.2e-8)
(*
180.0
(/ (atan (* -0.5 (* (* y-scale (/ -2.0 x-scale)) (tan t_0)))) PI))
(*
180.0
(/ (atan (/ (/ (* y-scale (cos t_0)) x-scale) (- (sin 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 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 3.2e-8) {
tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan(t_0)))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((y_45_scale * cos(t_0)) / x_45_scale) / -sin(t_0))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double tmp;
if (b_m <= 3.2e-8) {
tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * Math.tan(t_0)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((y_45_scale * Math.cos(t_0)) / x_45_scale) / -Math.sin(t_0))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): t_0 = math.pi * (0.005555555555555556 * angle) tmp = 0 if b_m <= 3.2e-8: tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * math.tan(t_0)))) / math.pi) else: tmp = 180.0 * (math.atan((((y_45_scale * math.cos(t_0)) / x_45_scale) / -math.sin(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(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (b_m <= 3.2e-8) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(-2.0 / x_45_scale)) * tan(t_0)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * cos(t_0)) / x_45_scale) / Float64(-sin(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 = pi * (0.005555555555555556 * angle); tmp = 0.0; if (b_m <= 3.2e-8) tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan(t_0)))) / pi); else tmp = 180.0 * (atan((((y_45_scale * cos(t_0)) / x_45_scale) / -sin(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[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 3.2e-8], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(-2.0 / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / (-N[Sin[t$95$0], $MachinePrecision])), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b\_m \leq 3.2 \cdot 10^{-8}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(y-scale \cdot \frac{-2}{x-scale}\right) \cdot \tan t\_0\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot \cos t\_0}{x-scale}}{-\sin t\_0}\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.2000000000000002e-8Initial program 15.7%
Simplified16.2%
Taylor expanded in x-scale around 0 28.1%
Simplified33.4%
Taylor expanded in a around inf 51.9%
add-cube-cbrt52.0%
pow252.0%
Applied egg-rr52.0%
associate-*r/52.0%
Applied egg-rr52.0%
associate-/l*51.9%
associate-*r*52.6%
associate-*r*53.3%
Simplified53.3%
if 3.2000000000000002e-8 < b Initial program 8.8%
Simplified7.3%
Taylor expanded in x-scale around 0 18.9%
Simplified19.2%
add-log-exp20.9%
Applied egg-rr20.9%
Taylor expanded in a around 0 56.1%
mul-1-neg56.1%
associate-/r*56.0%
associate-*r*57.7%
associate-*r*57.7%
Simplified57.7%
Final simplification54.3%
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 37000000000.0)
(*
180.0
(/
(atan
(*
-0.5
(*
(* y-scale (/ -2.0 x-scale))
(tan (* PI (* 0.005555555555555556 angle))))))
PI))
(*
180.0
(/ (atan (* (/ (/ (cos t_0) x-scale) (sin 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 <= 37000000000.0) {
tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan((((double) M_PI) * (0.005555555555555556 * angle)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((((cos(t_0) / x_45_scale) / sin(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 <= 37000000000.0) {
tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * Math.tan((Math.PI * (0.005555555555555556 * angle)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((((Math.cos(t_0) / x_45_scale) / Math.sin(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 <= 37000000000.0: tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * math.tan((math.pi * (0.005555555555555556 * angle)))))) / math.pi) else: tmp = 180.0 * (math.atan((((math.cos(t_0) / x_45_scale) / math.sin(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 <= 37000000000.0) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(-2.0 / x_45_scale)) * tan(Float64(pi * Float64(0.005555555555555556 * angle)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(cos(t_0) / x_45_scale) / sin(t_0)) * Float64(-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 <= 37000000000.0) tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan((pi * (0.005555555555555556 * angle)))))) / pi); else tmp = 180.0 * (atan((((cos(t_0) / x_45_scale) / sin(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, 37000000000.0], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(-2.0 / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / x$45$scale), $MachinePrecision] / N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * (-y$45$scale)), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 37000000000:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(y-scale \cdot \frac{-2}{x-scale}\right) \cdot \tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\cos t\_0}{x-scale}}{\sin t\_0} \cdot \left(-y-scale\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 3.7e10Initial program 15.4%
Simplified16.0%
Taylor expanded in x-scale around 0 28.0%
Simplified33.3%
Taylor expanded in a around inf 52.2%
add-cube-cbrt52.2%
pow252.2%
Applied egg-rr52.2%
associate-*r/52.3%
Applied egg-rr52.2%
associate-/l*52.2%
associate-*r*52.9%
associate-*r*53.0%
Simplified53.0%
if 3.7e10 < b Initial program 9.3%
Simplified7.6%
Taylor expanded in x-scale around 0 18.7%
Simplified19.0%
Taylor expanded in a around 0 59.0%
mul-1-neg59.0%
associate-/l*59.0%
associate-/r*59.0%
Simplified59.0%
Final simplification54.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 8.2e-10)
(*
180.0
(/
(atan
(*
-0.5
(*
(* y-scale (/ -2.0 x-scale))
(tan (* PI (* 0.005555555555555556 angle))))))
PI))
(*
180.0
(/
(atan (* -180.0 (/ y-scale (* angle (cbrt (pow (* PI x-scale) 3.0))))))
PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 8.2e-10) {
tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan((((double) M_PI) * (0.005555555555555556 * angle)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * cbrt(pow((((double) M_PI) * x_45_scale), 3.0)))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 8.2e-10) {
tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * Math.tan((Math.PI * (0.005555555555555556 * angle)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * Math.cbrt(Math.pow((Math.PI * x_45_scale), 3.0)))))) / 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 <= 8.2e-10) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(-2.0 / x_45_scale)) * tan(Float64(pi * Float64(0.005555555555555556 * angle)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * cbrt((Float64(pi * x_45_scale) ^ 3.0)))))) / pi)); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 8.2e-10], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(-2.0 / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[Power[N[Power[N[(Pi * x$45$scale), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 8.2 \cdot 10^{-10}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(y-scale \cdot \frac{-2}{x-scale}\right) \cdot \tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \sqrt[3]{{\left(\pi \cdot x-scale\right)}^{3}}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 8.1999999999999996e-10Initial program 15.8%
Simplified16.3%
Taylor expanded in x-scale around 0 27.8%
Simplified33.1%
Taylor expanded in a around inf 51.7%
add-cube-cbrt52.2%
pow252.2%
Applied egg-rr52.2%
associate-*r/52.3%
Applied egg-rr51.7%
associate-/l*51.7%
associate-*r*52.4%
associate-*r*53.0%
Simplified53.0%
if 8.1999999999999996e-10 < b Initial program 8.7%
Simplified7.2%
Taylor expanded in angle around 0 7.3%
associate-*r/7.3%
associate-*r*7.3%
distribute-lft-out--7.3%
associate-*r*7.3%
Simplified7.3%
Taylor expanded in a around 0 50.3%
add-cbrt-cube51.8%
pow351.8%
*-commutative51.8%
Applied egg-rr51.8%
Final simplification52.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.2e+41)
(*
180.0
(/
(atan
(*
-0.5
(*
(* y-scale (/ -2.0 x-scale))
(tan (* PI (* 0.005555555555555556 angle))))))
PI))
(*
180.0
(/ (atan (* -180.0 (/ 1.0 (* 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) {
double tmp;
if (b_m <= 2.2e+41) {
tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan((((double) M_PI) * (0.005555555555555556 * angle)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((((double) M_PI) * x_45_scale) / 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 tmp;
if (b_m <= 2.2e+41) {
tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * Math.tan((Math.PI * (0.005555555555555556 * angle)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (1.0 / (angle * ((Math.PI * x_45_scale) / y_45_scale))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 2.2e+41: tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * math.tan((math.pi * (0.005555555555555556 * angle)))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (1.0 / (angle * ((math.pi * x_45_scale) / y_45_scale))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 2.2e+41) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(-2.0 / x_45_scale)) * tan(Float64(pi * Float64(0.005555555555555556 * angle)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(1.0 / Float64(angle * Float64(Float64(pi * x_45_scale) / 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) tmp = 0.0; if (b_m <= 2.2e+41) tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (-2.0 / x_45_scale)) * tan((pi * (0.005555555555555556 * angle)))))) / pi); else tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((pi * x_45_scale) / 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_] := If[LessEqual[b$95$m, 2.2e+41], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(-2.0 / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(1.0 / N[(angle * N[(N[(Pi * x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.2 \cdot 10^{+41}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(y-scale \cdot \frac{-2}{x-scale}\right) \cdot \tan \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{1}{angle \cdot \frac{\pi \cdot x-scale}{y-scale}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.1999999999999999e41Initial program 15.7%
Simplified16.3%
Taylor expanded in x-scale around 0 27.3%
Simplified32.4%
Taylor expanded in a around inf 51.9%
add-cube-cbrt53.0%
pow253.0%
Applied egg-rr53.0%
associate-*r/53.0%
Applied egg-rr51.9%
associate-/l*51.9%
associate-*r*52.5%
associate-*r*52.7%
Simplified52.7%
if 2.1999999999999999e41 < b Initial program 6.7%
Simplified4.7%
Taylor expanded in angle around 0 4.8%
associate-*r/4.8%
associate-*r*4.8%
distribute-lft-out--4.8%
associate-*r*4.8%
Simplified4.8%
Taylor expanded in a around 0 55.3%
clear-num56.9%
inv-pow56.9%
*-commutative56.9%
Applied egg-rr56.9%
unpow-156.9%
associate-/l*55.1%
Simplified55.1%
Final simplification53.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 5.5e+39)
(*
180.0
(/
(atan
(*
-0.5
(*
y-scale
(* (/ -2.0 x-scale) (tan (* 0.005555555555555556 (* angle PI)))))))
PI))
(*
180.0
(/ (atan (* -180.0 (/ 1.0 (* 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) {
double tmp;
if (b_m <= 5.5e+39) {
tmp = 180.0 * (atan((-0.5 * (y_45_scale * ((-2.0 / x_45_scale) * tan((0.005555555555555556 * (angle * ((double) M_PI)))))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((((double) M_PI) * x_45_scale) / 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 tmp;
if (b_m <= 5.5e+39) {
tmp = 180.0 * (Math.atan((-0.5 * (y_45_scale * ((-2.0 / x_45_scale) * Math.tan((0.005555555555555556 * (angle * Math.PI))))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (1.0 / (angle * ((Math.PI * x_45_scale) / y_45_scale))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 5.5e+39: tmp = 180.0 * (math.atan((-0.5 * (y_45_scale * ((-2.0 / x_45_scale) * math.tan((0.005555555555555556 * (angle * math.pi))))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (1.0 / (angle * ((math.pi * x_45_scale) / y_45_scale))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 5.5e+39) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(y_45_scale * Float64(Float64(-2.0 / x_45_scale) * tan(Float64(0.005555555555555556 * Float64(angle * pi))))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(1.0 / Float64(angle * Float64(Float64(pi * x_45_scale) / 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) tmp = 0.0; if (b_m <= 5.5e+39) tmp = 180.0 * (atan((-0.5 * (y_45_scale * ((-2.0 / x_45_scale) * tan((0.005555555555555556 * (angle * pi))))))) / pi); else tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((pi * x_45_scale) / 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_] := If[LessEqual[b$95$m, 5.5e+39], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(y$45$scale * N[(N[(-2.0 / x$45$scale), $MachinePrecision] * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(1.0 / N[(angle * N[(N[(Pi * x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 5.5 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(y-scale \cdot \left(\frac{-2}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{1}{angle \cdot \frac{\pi \cdot x-scale}{y-scale}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 5.4999999999999997e39Initial program 15.7%
Simplified16.3%
Taylor expanded in x-scale around 0 27.3%
Simplified32.4%
Taylor expanded in a around inf 51.9%
add-cube-cbrt53.0%
pow253.0%
Applied egg-rr53.0%
associate-*r/53.0%
Applied egg-rr51.9%
associate-/l*51.9%
Simplified51.9%
if 5.4999999999999997e39 < b Initial program 6.7%
Simplified4.7%
Taylor expanded in angle around 0 4.8%
associate-*r/4.8%
associate-*r*4.8%
distribute-lft-out--4.8%
associate-*r*4.8%
Simplified4.8%
Taylor expanded in a around 0 55.3%
clear-num56.9%
inv-pow56.9%
*-commutative56.9%
Applied egg-rr56.9%
unpow-156.9%
associate-/l*55.1%
Simplified55.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.2e+52)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(*
180.0
(/ (atan (* -180.0 (/ 1.0 (* 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) {
double tmp;
if (b_m <= 2.2e+52) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((((double) M_PI) * x_45_scale) / 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 tmp;
if (b_m <= 2.2e+52) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (1.0 / (angle * ((Math.PI * x_45_scale) / y_45_scale))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 2.2e+52: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (1.0 / (angle * ((math.pi * x_45_scale) / y_45_scale))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 2.2e+52) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(1.0 / Float64(angle * Float64(Float64(pi * x_45_scale) / 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) tmp = 0.0; if (b_m <= 2.2e+52) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((-180.0 * (1.0 / (angle * ((pi * x_45_scale) / 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_] := If[LessEqual[b$95$m, 2.2e+52], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(1.0 / N[(angle * N[(N[(Pi * x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.2 \cdot 10^{+52}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{1}{angle \cdot \frac{\pi \cdot x-scale}{y-scale}}\right)}{\pi}\\
\end{array}
\end{array}
if b < 2.2e52Initial program 15.9%
Simplified16.4%
Taylor expanded in x-scale around 0 27.4%
Simplified32.3%
Taylor expanded in a around inf 51.4%
Taylor expanded in angle around 0 44.1%
associate-/l*49.5%
associate-/l*49.5%
Simplified49.5%
if 2.2e52 < b Initial program 4.9%
Simplified2.5%
Taylor expanded in angle around 0 2.7%
associate-*r/2.7%
associate-*r*2.7%
distribute-lft-out--2.7%
associate-*r*2.7%
Simplified2.7%
Taylor expanded in a around 0 57.8%
clear-num59.6%
inv-pow59.6%
*-commutative59.6%
Applied egg-rr59.6%
unpow-159.6%
associate-/l*57.6%
Simplified57.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 4.5e+56)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(*
180.0
(/ (atan (* -180.0 (* y-scale (/ 1.0 (* 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 <= 4.5e+56) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale * (1.0 / (angle * (((double) M_PI) * x_45_scale)))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 4.5e+56) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale * (1.0 / (angle * (Math.PI * x_45_scale)))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 4.5e+56: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale * (1.0 / (angle * (math.pi * x_45_scale)))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 4.5e+56) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale * Float64(1.0 / Float64(angle * Float64(pi * x_45_scale)))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 4.5e+56) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale * (1.0 / (angle * (pi * x_45_scale)))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 4.5e+56], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale * N[(1.0 / N[(angle * N[(Pi * x$45$scale), $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 4.5 \cdot 10^{+56}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \left(y-scale \cdot \frac{1}{angle \cdot \left(\pi \cdot x-scale\right)}\right)\right)}{\pi}\\
\end{array}
\end{array}
if b < 4.5000000000000003e56Initial program 15.9%
Simplified16.4%
Taylor expanded in x-scale around 0 27.2%
Simplified32.2%
Taylor expanded in a around inf 51.7%
Taylor expanded in angle around 0 44.4%
associate-/l*49.7%
associate-/l*49.7%
Simplified49.7%
if 4.5000000000000003e56 < b Initial program 5.0%
Simplified2.6%
Taylor expanded in angle around 0 2.8%
associate-*r/2.8%
associate-*r*2.8%
distribute-lft-out--2.8%
associate-*r*2.8%
Simplified2.8%
Taylor expanded in a around 0 58.6%
div-inv58.6%
*-commutative58.6%
Applied egg-rr58.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 9e+55)
(*
180.0
(/
(atan (* 0.005555555555555556 (* angle (* y-scale (/ PI x-scale)))))
PI))
(* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI))))b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 9e+55) {
tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (((double) M_PI) / x_45_scale))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (b_m <= 9e+55) {
tmp = 180.0 * (Math.atan((0.005555555555555556 * (angle * (y_45_scale * (Math.PI / x_45_scale))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle, x_45_scale, y_45_scale): tmp = 0 if b_m <= 9e+55: tmp = 180.0 * (math.atan((0.005555555555555556 * (angle * (y_45_scale * (math.pi / x_45_scale))))) / math.pi) else: tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi) return tmp
b_m = abs(b) function code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0 if (b_m <= 9e+55) tmp = Float64(180.0 * Float64(atan(Float64(0.005555555555555556 * Float64(angle * Float64(y_45_scale * Float64(pi / x_45_scale))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi)); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale) tmp = 0.0; if (b_m <= 9e+55) tmp = 180.0 * (atan((0.005555555555555556 * (angle * (y_45_scale * (pi / x_45_scale))))) / pi); else tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 9e+55], N[(180.0 * N[(N[ArcTan[N[(0.005555555555555556 * N[(angle * N[(y$45$scale * N[(Pi / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(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|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 9 \cdot 10^{+55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.005555555555555556 \cdot \left(angle \cdot \left(y-scale \cdot \frac{\pi}{x-scale}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}\\
\end{array}
\end{array}
if b < 8.99999999999999996e55Initial program 15.9%
Simplified16.4%
Taylor expanded in x-scale around 0 27.2%
Simplified32.2%
Taylor expanded in a around inf 51.7%
Taylor expanded in angle around 0 44.4%
associate-/l*49.7%
associate-/l*49.7%
Simplified49.7%
if 8.99999999999999996e55 < b Initial program 5.0%
Simplified2.6%
Taylor expanded in angle around 0 2.8%
associate-*r/2.8%
associate-*r*2.8%
distribute-lft-out--2.8%
associate-*r*2.8%
Simplified2.8%
Taylor expanded in a around 0 58.6%
Final simplification51.2%
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.1%
Simplified14.2%
Taylor expanded in angle around 0 10.7%
associate-*r/10.7%
associate-*r*9.8%
distribute-lft-out--9.8%
associate-*r*9.8%
Simplified9.8%
Taylor expanded in a around 0 33.2%
Final simplification33.2%
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.1%
Simplified14.2%
Taylor expanded in angle around 0 10.7%
associate-*r/10.7%
associate-*r*9.8%
distribute-lft-out--9.8%
associate-*r*9.8%
Simplified9.8%
Taylor expanded in a around inf 9.6%
herbie shell --seed 2024123
(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)))