
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2 (- (pow b 2) (pow a 2))) t_2) t_1) x-scale)
y-scale))
(t_4
(/
(/ (+ (pow (* a t_1) 2) (pow (* b t_2) 2)) y-scale)
y-scale))
(t_5
(/
(/ (+ (pow (* a t_2) 2) (pow (* b t_1) 2)) x-scale)
x-scale)))
(*
180
(/
(atan
(/
(- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2) (pow t_3 2))))
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), $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 * N[(N[Power[b, 2], $MachinePrecision] - N[Power[a, 2], $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], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2], $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], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180 * 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], $MachinePrecision] + N[Power[t$95$3, 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\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}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180) PI))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2 (- (pow b 2) (pow a 2))) t_2) t_1) x-scale)
y-scale))
(t_4
(/
(/ (+ (pow (* a t_1) 2) (pow (* b t_2) 2)) y-scale)
y-scale))
(t_5
(/
(/ (+ (pow (* a t_2) 2) (pow (* b t_1) 2)) x-scale)
x-scale)))
(*
180
(/
(atan
(/
(- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2) (pow t_3 2))))
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), $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 * N[(N[Power[b, 2], $MachinePrecision] - N[Power[a, 2], $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], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2], $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], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180 * 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], $MachinePrecision] + N[Power[t$95$3, 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\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}
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 1/180 (* angle PI))) (t_1 (cos t_0)))
(if (<=
(fabs a)
1209490110948601/127314748520905380391777855525586135065716774604121015664758778084648831235208544136462336)
(*
180
(/
(atan
(*
-1/2
(/
(* y-scale (+ (sqrt (pow t_1 4)) (pow t_1 2)))
(* x-scale (* t_1 (sin t_0))))))
PI))
(*
180
(/
(atan
(*
90
(*
(/
(*
(-
(sqrt (* 1/1049760000 (pow PI 4)))
(* -1/32400 (* PI PI)))
y-scale)
x-scale)
(/ angle PI))))
PI)))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double tmp;
if (fabs(a) <= 9.5e-75) {
tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt(pow(t_1, 4.0)) + pow(t_1, 2.0))) / (x_45_scale * (t_1 * sin(t_0)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0))) - (-3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))) * y_45_scale) / x_45_scale) * (angle / ((double) M_PI))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double tmp;
if (Math.abs(a) <= 9.5e-75) {
tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_1, 4.0)) + Math.pow(t_1, 2.0))) / (x_45_scale * (t_1 * Math.sin(t_0)))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((90.0 * ((((Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0))) - (-3.08641975308642e-5 * (Math.PI * Math.PI))) * y_45_scale) / x_45_scale) * (angle / Math.PI)))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.cos(t_0) tmp = 0 if math.fabs(a) <= 9.5e-75: tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (math.sqrt(math.pow(t_1, 4.0)) + math.pow(t_1, 2.0))) / (x_45_scale * (t_1 * math.sin(t_0)))))) / math.pi) else: tmp = 180.0 * (math.atan((90.0 * ((((math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0))) - (-3.08641975308642e-5 * (math.pi * math.pi))) * y_45_scale) / x_45_scale) * (angle / math.pi)))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if (abs(a) <= 9.5e-75) tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_1 ^ 4.0)) + (t_1 ^ 2.0))) / Float64(x_45_scale * Float64(t_1 * sin(t_0)))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0))) - Float64(-3.08641975308642e-5 * Float64(pi * pi))) * y_45_scale) / x_45_scale) * Float64(angle / pi)))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = cos(t_0); tmp = 0.0; if (abs(a) <= 9.5e-75) tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt((t_1 ^ 4.0)) + (t_1 ^ 2.0))) / (x_45_scale * (t_1 * sin(t_0)))))) / pi); else tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * (pi ^ 4.0))) - (-3.08641975308642e-5 * (pi * pi))) * y_45_scale) / x_45_scale) * (angle / pi)))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(1/180 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 1209490110948601/127314748520905380391777855525586135065716774604121015664758778084648831235208544136462336], N[(180 * N[(N[ArcTan[N[(-1/2 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$1, 4], $MachinePrecision]], $MachinePrecision] + N[Power[t$95$1, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180 * N[(N[ArcTan[N[(90 * N[(N[(N[(N[(N[Sqrt[N[(1/1049760000 * N[Power[Pi, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-1/32400 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * N[(angle / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{1}{180} \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;\left|a\right| \leq \frac{1209490110948601}{127314748520905380391777855525586135065716774604121015664758778084648831235208544136462336}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{t\_1}^{4}} + {t\_1}^{2}\right)}{x-scale \cdot \left(t\_1 \cdot \sin t\_0\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{\left(\sqrt{\frac{1}{1049760000} \cdot {\pi}^{4}} - \frac{-1}{32400} \cdot \left(\pi \cdot \pi\right)\right) \cdot y-scale}{x-scale} \cdot \frac{angle}{\pi}\right)\right)}{\pi}\\
\end{array}
if a < 9.4999999999999991e-75Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6421.9%
Applied rewrites21.9%
Taylor expanded in b around inf
lower-/.f64N/A
Applied rewrites43.7%
if 9.4999999999999991e-75 < a Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
Applied rewrites37.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites46.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 1/180 (* angle PI))))
(if (<=
(fabs a)
2118010469031163/353001744838527187118638605275578482918919238981447190585425241357836728795149812488234240124403749621362233187285499572265412108234798868453319136060868263303849511435339515071579009061587940965469669934854316295716864)
(*
180
(/
1
(/
PI
(atan
(*
(/
(* y-scale (- 1/2 (* -1/2 (cos (* 1/90 (* angle PI))))))
(* x-scale (* (cos t_0) (sin t_0))))
-1/2)))))
(*
180
(/
(atan
(*
90
(*
(/
(*
(-
(sqrt (* 1/1049760000 (pow PI 4)))
(* -1/32400 (* PI PI)))
y-scale)
x-scale)
(/ angle PI))))
PI)))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (fabs(a) <= 6e-204) {
tmp = 180.0 * (1.0 / (((double) M_PI) / atan((((y_45_scale * (0.5 - (-0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI))))))) / (x_45_scale * (cos(t_0) * sin(t_0)))) * -0.5))));
} else {
tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0))) - (-3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))) * y_45_scale) / x_45_scale) * (angle / ((double) M_PI))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (Math.abs(a) <= 6e-204) {
tmp = 180.0 * (1.0 / (Math.PI / Math.atan((((y_45_scale * (0.5 - (-0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI)))))) / (x_45_scale * (Math.cos(t_0) * Math.sin(t_0)))) * -0.5))));
} else {
tmp = 180.0 * (Math.atan((90.0 * ((((Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0))) - (-3.08641975308642e-5 * (Math.PI * Math.PI))) * y_45_scale) / x_45_scale) * (angle / Math.PI)))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if math.fabs(a) <= 6e-204: tmp = 180.0 * (1.0 / (math.pi / math.atan((((y_45_scale * (0.5 - (-0.5 * math.cos((0.011111111111111112 * (angle * math.pi)))))) / (x_45_scale * (math.cos(t_0) * math.sin(t_0)))) * -0.5)))) else: tmp = 180.0 * (math.atan((90.0 * ((((math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0))) - (-3.08641975308642e-5 * (math.pi * math.pi))) * y_45_scale) / x_45_scale) * (angle / math.pi)))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (abs(a) <= 6e-204) tmp = Float64(180.0 * Float64(1.0 / Float64(pi / atan(Float64(Float64(Float64(y_45_scale * Float64(0.5 - Float64(-0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi)))))) / Float64(x_45_scale * Float64(cos(t_0) * sin(t_0)))) * -0.5))))); else tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0))) - Float64(-3.08641975308642e-5 * Float64(pi * pi))) * y_45_scale) / x_45_scale) * Float64(angle / pi)))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (abs(a) <= 6e-204) tmp = 180.0 * (1.0 / (pi / atan((((y_45_scale * (0.5 - (-0.5 * cos((0.011111111111111112 * (angle * pi)))))) / (x_45_scale * (cos(t_0) * sin(t_0)))) * -0.5)))); else tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * (pi ^ 4.0))) - (-3.08641975308642e-5 * (pi * pi))) * y_45_scale) / x_45_scale) * (angle / pi)))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(1/180 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 2118010469031163/353001744838527187118638605275578482918919238981447190585425241357836728795149812488234240124403749621362233187285499572265412108234798868453319136060868263303849511435339515071579009061587940965469669934854316295716864], N[(180 * N[(1 / N[(Pi / N[ArcTan[N[(N[(N[(y$45$scale * N[(1/2 - N[(-1/2 * N[Cos[N[(1/90 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1/2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(180 * N[(N[ArcTan[N[(90 * N[(N[(N[(N[(N[Sqrt[N[(1/1049760000 * N[Power[Pi, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-1/32400 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * N[(angle / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{1}{180} \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;\left|a\right| \leq \frac{2118010469031163}{353001744838527187118638605275578482918919238981447190585425241357836728795149812488234240124403749621362233187285499572265412108234798868453319136060868263303849511435339515071579009061587940965469669934854316295716864}:\\
\;\;\;\;180 \cdot \frac{1}{\frac{\pi}{\tan^{-1} \left(\frac{y-scale \cdot \left(\frac{1}{2} - \frac{-1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos t\_0 \cdot \sin t\_0\right)} \cdot \frac{-1}{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{\left(\sqrt{\frac{1}{1049760000} \cdot {\pi}^{4}} - \frac{-1}{32400} \cdot \left(\pi \cdot \pi\right)\right) \cdot y-scale}{x-scale} \cdot \frac{angle}{\pi}\right)\right)}{\pi}\\
\end{array}
if a < 5.9999999999999997e-204Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Applied rewrites28.1%
Taylor expanded in b around inf
lower-/.f64N/A
Applied rewrites40.1%
if 5.9999999999999997e-204 < a Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
Applied rewrites37.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites46.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<=
(fabs b)
200000000000000010633203932531929807120677891504902019467139459740877830445843311891900085826986098180514433636250241879259008902761073077463384326180408077533983407946684470268995013675256664624709275670582961344224738611407182763130880)
(*
180
(/
(atan
(*
90
(*
(/
(*
(- (sqrt (* 1/1049760000 (pow PI 4))) (* -1/32400 (* PI PI)))
y-scale)
x-scale)
(/ angle PI))))
PI))
(*
180
(/
(atan
(*
-90
(/
(*
x-scale
(*
y-scale
(+ (sqrt (/ 1 (pow x-scale 4))) (/ 1 (pow x-scale 2)))))
(* angle PI))))
PI))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (fabs(b) <= 2e+236) {
tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0))) - (-3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))) * y_45_scale) / x_45_scale) * (angle / ((double) M_PI))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((-90.0 * ((x_45_scale * (y_45_scale * (sqrt((1.0 / pow(x_45_scale, 4.0))) + (1.0 / pow(x_45_scale, 2.0))))) / (angle * ((double) M_PI))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (Math.abs(b) <= 2e+236) {
tmp = 180.0 * (Math.atan((90.0 * ((((Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0))) - (-3.08641975308642e-5 * (Math.PI * Math.PI))) * y_45_scale) / x_45_scale) * (angle / Math.PI)))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((-90.0 * ((x_45_scale * (y_45_scale * (Math.sqrt((1.0 / Math.pow(x_45_scale, 4.0))) + (1.0 / Math.pow(x_45_scale, 2.0))))) / (angle * Math.PI)))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if math.fabs(b) <= 2e+236: tmp = 180.0 * (math.atan((90.0 * ((((math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0))) - (-3.08641975308642e-5 * (math.pi * math.pi))) * y_45_scale) / x_45_scale) * (angle / math.pi)))) / math.pi) else: tmp = 180.0 * (math.atan((-90.0 * ((x_45_scale * (y_45_scale * (math.sqrt((1.0 / math.pow(x_45_scale, 4.0))) + (1.0 / math.pow(x_45_scale, 2.0))))) / (angle * math.pi)))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (abs(b) <= 2e+236) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0))) - Float64(-3.08641975308642e-5 * Float64(pi * pi))) * y_45_scale) / x_45_scale) * Float64(angle / pi)))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(x_45_scale * Float64(y_45_scale * Float64(sqrt(Float64(1.0 / (x_45_scale ^ 4.0))) + Float64(1.0 / (x_45_scale ^ 2.0))))) / Float64(angle * pi)))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (abs(b) <= 2e+236) tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * (pi ^ 4.0))) - (-3.08641975308642e-5 * (pi * pi))) * y_45_scale) / x_45_scale) * (angle / pi)))) / pi); else tmp = 180.0 * (atan((-90.0 * ((x_45_scale * (y_45_scale * (sqrt((1.0 / (x_45_scale ^ 4.0))) + (1.0 / (x_45_scale ^ 2.0))))) / (angle * pi)))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[b], $MachinePrecision], 200000000000000010633203932531929807120677891504902019467139459740877830445843311891900085826986098180514433636250241879259008902761073077463384326180408077533983407946684470268995013675256664624709275670582961344224738611407182763130880], N[(180 * N[(N[ArcTan[N[(90 * N[(N[(N[(N[(N[Sqrt[N[(1/1049760000 * N[Power[Pi, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-1/32400 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * N[(angle / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180 * N[(N[ArcTan[N[(-90 * N[(N[(x$45$scale * N[(y$45$scale * N[(N[Sqrt[N[(1 / N[Power[x$45$scale, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1 / N[Power[x$45$scale, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|b\right| \leq 200000000000000010633203932531929807120677891504902019467139459740877830445843311891900085826986098180514433636250241879259008902761073077463384326180408077533983407946684470268995013675256664624709275670582961344224738611407182763130880:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{\left(\sqrt{\frac{1}{1049760000} \cdot {\pi}^{4}} - \frac{-1}{32400} \cdot \left(\pi \cdot \pi\right)\right) \cdot y-scale}{x-scale} \cdot \frac{angle}{\pi}\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\sqrt{\frac{1}{{x-scale}^{4}}} + \frac{1}{{x-scale}^{2}}\right)\right)}{angle \cdot \pi}\right)}{\pi}\\
\end{array}
if b < 2.0000000000000001e236Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
Applied rewrites37.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites46.3%
if 2.0000000000000001e236 < b Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites39.6%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<=
(fabs a)
4075359992289361/194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232)
(* 180 (/ (atan (* -90 (/ y-scale (* angle (* x-scale PI))))) PI))
(*
180
(/
(atan
(*
90
(*
(/
(*
(- (sqrt (* 1/1049760000 (pow PI 4))) (* -1/32400 (* PI PI)))
y-scale)
x-scale)
(/ angle PI))))
PI))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (fabs(a) <= 2.1e-215) {
tmp = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0))) - (-3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))) * y_45_scale) / x_45_scale) * (angle / ((double) M_PI))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (Math.abs(a) <= 2.1e-215) {
tmp = 180.0 * (Math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((90.0 * ((((Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0))) - (-3.08641975308642e-5 * (Math.PI * Math.PI))) * y_45_scale) / x_45_scale) * (angle / Math.PI)))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if math.fabs(a) <= 2.1e-215: tmp = 180.0 * (math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan((90.0 * ((((math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0))) - (-3.08641975308642e-5 * (math.pi * math.pi))) * y_45_scale) / x_45_scale) * (angle / math.pi)))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (abs(a) <= 2.1e-215) tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0))) - Float64(-3.08641975308642e-5 * Float64(pi * pi))) * y_45_scale) / x_45_scale) * Float64(angle / pi)))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (abs(a) <= 2.1e-215) tmp = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); else tmp = 180.0 * (atan((90.0 * ((((sqrt((9.525986892242036e-10 * (pi ^ 4.0))) - (-3.08641975308642e-5 * (pi * pi))) * y_45_scale) / x_45_scale) * (angle / pi)))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[a], $MachinePrecision], 4075359992289361/194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232], N[(180 * N[(N[ArcTan[N[(-90 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180 * N[(N[ArcTan[N[(90 * N[(N[(N[(N[(N[Sqrt[N[(1/1049760000 * N[Power[Pi, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-1/32400 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * N[(angle / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|a\right| \leq \frac{4075359992289361}{194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(\frac{\left(\sqrt{\frac{1}{1049760000} \cdot {\pi}^{4}} - \frac{-1}{32400} \cdot \left(\pi \cdot \pi\right)\right) \cdot y-scale}{x-scale} \cdot \frac{angle}{\pi}\right)\right)}{\pi}\\
\end{array}
if a < 2.1e-215Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6434.0%
Applied rewrites34.0%
if 2.1e-215 < a Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
Applied rewrites37.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites46.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<=
(fabs a)
4075359992289361/194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232)
(* 180 (/ (atan (* -90 (/ y-scale (* angle (* x-scale PI))))) PI))
(*
180
(/
(atan
(*
90
(*
angle
(/
(*
(- (sqrt (* 1/1049760000 (pow PI 4))) (* -1/32400 (* PI PI)))
y-scale)
(* x-scale PI)))))
PI))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (fabs(a) <= 2.1e-215) {
tmp = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = 180.0 * (atan((90.0 * (angle * (((sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0))) - (-3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))) * y_45_scale) / (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (Math.abs(a) <= 2.1e-215) {
tmp = 180.0 * (Math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = 180.0 * (Math.atan((90.0 * (angle * (((Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0))) - (-3.08641975308642e-5 * (Math.PI * Math.PI))) * y_45_scale) / (x_45_scale * Math.PI))))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if math.fabs(a) <= 2.1e-215: tmp = 180.0 * (math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi) else: tmp = 180.0 * (math.atan((90.0 * (angle * (((math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0))) - (-3.08641975308642e-5 * (math.pi * math.pi))) * y_45_scale) / (x_45_scale * math.pi))))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (abs(a) <= 2.1e-215) tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)); else tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(angle * Float64(Float64(Float64(sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0))) - Float64(-3.08641975308642e-5 * Float64(pi * pi))) * y_45_scale) / Float64(x_45_scale * pi))))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (abs(a) <= 2.1e-215) tmp = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); else tmp = 180.0 * (atan((90.0 * (angle * (((sqrt((9.525986892242036e-10 * (pi ^ 4.0))) - (-3.08641975308642e-5 * (pi * pi))) * y_45_scale) / (x_45_scale * pi))))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[a], $MachinePrecision], 4075359992289361/194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232], N[(180 * N[(N[ArcTan[N[(-90 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180 * N[(N[ArcTan[N[(90 * N[(angle * N[(N[(N[(N[Sqrt[N[(1/1049760000 * N[Power[Pi, 4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(-1/32400 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|a\right| \leq \frac{4075359992289361}{194064761537588616893622436057812819407110752139587076392381504753256369085797110791359801103580809743810966337141384150771447505514351798930535909380147642400556872002606238193783160703949805603157874899214558593861605856727007232}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(angle \cdot \frac{\left(\sqrt{\frac{1}{1049760000} \cdot {\pi}^{4}} - \frac{-1}{32400} \cdot \left(\pi \cdot \pi\right)\right) \cdot y-scale}{x-scale \cdot \pi}\right)\right)}{\pi}\\
\end{array}
if a < 2.1e-215Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6434.0%
Applied rewrites34.0%
if 2.1e-215 < a Initial program 13.7%
Taylor expanded in x-scale around 0
Applied rewrites24.2%
Taylor expanded in a around inf
lower-*.f64N/A
Applied rewrites37.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites40.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.3%
Applied rewrites46.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0
(*
180
(/ (atan (* -90 (/ y-scale (* angle (* x-scale PI))))) PI))))
(if (<=
y-scale
-3156916489989175/20769187434139310514121985316880384)
t_0
(if (<=
y-scale
4980610507814139/95780971304118053647396689196894323976171195136475136)
(* 0 (/ (atan (* -90 (/ x-scale (* angle (* y-scale PI))))) PI))
t_0))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
double tmp;
if (y_45_scale <= -1.52e-19) {
tmp = t_0;
} else if (y_45_scale <= 5.2e-38) {
tmp = 0.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 180.0 * (Math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
double tmp;
if (y_45_scale <= -1.52e-19) {
tmp = t_0;
} else if (y_45_scale <= 5.2e-38) {
tmp = 0.0 * (Math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 180.0 * (math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi) tmp = 0 if y_45_scale <= -1.52e-19: tmp = t_0 elif y_45_scale <= 5.2e-38: tmp = 0.0 * (math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi) else: tmp = t_0 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)) tmp = 0.0 if (y_45_scale <= -1.52e-19) tmp = t_0; elseif (y_45_scale <= 5.2e-38) tmp = Float64(0.0 * Float64(atan(Float64(-90.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi)); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); tmp = 0.0; if (y_45_scale <= -1.52e-19) tmp = t_0; elseif (y_45_scale <= 5.2e-38) tmp = 0.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(180 * N[(N[ArcTan[N[(-90 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -3156916489989175/20769187434139310514121985316880384], t$95$0, If[LessEqual[y$45$scale, 4980610507814139/95780971304118053647396689196894323976171195136475136], N[(0 * N[(N[ArcTan[N[(-90 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{if}\;y-scale \leq \frac{-3156916489989175}{20769187434139310514121985316880384}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y-scale \leq \frac{4980610507814139}{95780971304118053647396689196894323976171195136475136}:\\
\;\;\;\;0 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y-scale < -1.5199999999999999e-19 or 5.2000000000000002e-38 < y-scale Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6434.0%
Applied rewrites34.0%
if -1.5199999999999999e-19 < y-scale < 5.2000000000000002e-38Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in undef-var around zero
Applied rewrites18.7%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<=
(fabs a)
42000000000000000351583831030549269903796902894653394480255339529473772181379582700118932702124264040861857535299247642262987419711358338910380662332576962881039932366025777456359669760)
(*
180
(/
(atan
(*
90
(*
x-scale
(* -1 (/ y-scale (* angle (* (pow x-scale 2) PI)))))))
PI))
(* 0 (/ (atan (* -90 (/ x-scale (* angle (* y-scale PI))))) PI))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (fabs(a) <= 4.2e+184) {
tmp = 180.0 * (atan((90.0 * (x_45_scale * (-1.0 * (y_45_scale / (angle * (pow(x_45_scale, 2.0) * ((double) M_PI)))))))) / ((double) M_PI));
} else {
tmp = 0.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (Math.abs(a) <= 4.2e+184) {
tmp = 180.0 * (Math.atan((90.0 * (x_45_scale * (-1.0 * (y_45_scale / (angle * (Math.pow(x_45_scale, 2.0) * Math.PI))))))) / Math.PI);
} else {
tmp = 0.0 * (Math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if math.fabs(a) <= 4.2e+184: tmp = 180.0 * (math.atan((90.0 * (x_45_scale * (-1.0 * (y_45_scale / (angle * (math.pow(x_45_scale, 2.0) * math.pi))))))) / math.pi) else: tmp = 0.0 * (math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (abs(a) <= 4.2e+184) tmp = Float64(180.0 * Float64(atan(Float64(90.0 * Float64(x_45_scale * Float64(-1.0 * Float64(y_45_scale / Float64(angle * Float64((x_45_scale ^ 2.0) * pi))))))) / pi)); else tmp = Float64(0.0 * Float64(atan(Float64(-90.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (abs(a) <= 4.2e+184) tmp = 180.0 * (atan((90.0 * (x_45_scale * (-1.0 * (y_45_scale / (angle * ((x_45_scale ^ 2.0) * pi))))))) / pi); else tmp = 0.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[a], $MachinePrecision], 42000000000000000351583831030549269903796902894653394480255339529473772181379582700118932702124264040861857535299247642262987419711358338910380662332576962881039932366025777456359669760], N[(180 * N[(N[ArcTan[N[(90 * N[(x$45$scale * N[(-1 * N[(y$45$scale / N[(angle * N[(N[Power[x$45$scale, 2], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(0 * N[(N[ArcTan[N[(-90 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 42000000000000000351583831030549269903796902894653394480255339529473772181379582700118932702124264040861857535299247642262987419711358338910380662332576962881039932366025777456359669760:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(x-scale \cdot \left(-1 \cdot \frac{y-scale}{angle \cdot \left({x-scale}^{2} \cdot \pi\right)}\right)\right)\right)}{\pi}\\
\mathbf{else}:\\
\;\;\;\;0 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}\\
\end{array}
if a < 4.2e184Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-PI.f6436.6%
Applied rewrites36.6%
if 4.2e184 < a Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in undef-var around zero
Applied rewrites18.7%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* 180 (/ (atan (* -90 (/ y-scale (* angle (* x-scale PI))))) PI)))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-90.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-90.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180 * N[(N[ArcTan[N[(-90 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6434.0%
Applied rewrites34.0%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* 180 (/ (atan (* -90 (/ x-scale (* angle (* y-scale PI))))) PI)))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 180.0 * (Math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale): return 180.0 * (math.atan((-90.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi)) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 180.0 * (atan((-90.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180 * N[(N[ArcTan[N[(-90 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}
Initial program 13.7%
Taylor expanded in angle around 0
Applied rewrites11.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites12.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6411.7%
Applied rewrites11.7%
herbie shell --seed 2025285 -o generate:evaluate
(FPCore (a b angle x-scale y-scale)
:name "raw-angle from scale-rotated-ellipse"
:precision binary64
(* 180 (/ (atan (/ (- (- (/ (/ (+ (pow (* a (cos (* (/ angle 180) PI))) 2) (pow (* b (sin (* (/ angle 180) PI))) 2)) y-scale) y-scale) (/ (/ (+ (pow (* a (sin (* (/ angle 180) PI))) 2) (pow (* b (cos (* (/ angle 180) PI))) 2)) x-scale) x-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180) PI))) 2) (pow (* b (cos (* (/ angle 180) PI))) 2)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180) PI))) 2) (pow (* b (sin (* (/ angle 180) PI))) 2)) y-scale) y-scale)) 2) (pow (/ (/ (* (* (* 2 (- (pow b 2) (pow a 2))) (sin (* (/ angle 180) PI))) (cos (* (/ angle 180) PI))) x-scale) y-scale) 2)))) (/ (/ (* (* (* 2 (- (pow b 2) (pow a 2))) (sin (* (/ angle 180) PI))) (cos (* (/ angle 180) PI))) x-scale) y-scale))) PI)))