
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(t_5 (* (* b a) (* b (- a))))
(t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
(/
(-
(sqrt
(*
(* (* 2.0 t_6) t_5)
(+
(+ t_4 t_3)
(sqrt
(+
(pow (- t_4 t_3) 2.0)
(pow
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)
2.0)))))))
t_6)))
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 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / pow((x_45_scale * y_45_scale), 2.0);
return -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((pow((t_4 - t_3), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / Math.pow((x_45_scale * y_45_scale), 2.0);
return -Math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + Math.sqrt((Math.pow((t_4 - t_3), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale t_5 = (b * a) * (b * -a) t_6 = (4.0 * t_5) / math.pow((x_45_scale * y_45_scale), 2.0) return -math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + math.sqrt((math.pow((t_4 - t_3), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale) t_5 = Float64(Float64(b * a) * Float64(b * Float64(-a))) t_6 = Float64(Float64(4.0 * t_5) / (Float64(x_45_scale * y_45_scale) ^ 2.0)) return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * t_6) * t_5) * Float64(Float64(t_4 + t_3) + sqrt(Float64((Float64(t_4 - t_3) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0))))))) / t_6) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = sin(t_0); t_2 = cos(t_0); t_3 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale; t_5 = (b * a) * (b * -a); t_6 = (4.0 * t_5) / ((x_45_scale * y_45_scale) ^ 2.0); tmp = -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((((t_4 - t_3) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0)))))) / t_6; 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = 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] / y$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] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(4.0 * t$95$5), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(N[(2.0 * t$95$6), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(N[(t$95$4 + t$95$3), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(t$95$4 - t$95$3), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(t_5 (* (* b a) (* b (- a))))
(t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
(/
(-
(sqrt
(*
(* (* 2.0 t_6) t_5)
(+
(+ t_4 t_3)
(sqrt
(+
(pow (- t_4 t_3) 2.0)
(pow
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)
2.0)))))))
t_6)))
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 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / pow((x_45_scale * y_45_scale), 2.0);
return -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((pow((t_4 - t_3), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / Math.pow((x_45_scale * y_45_scale), 2.0);
return -Math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + Math.sqrt((Math.pow((t_4 - t_3), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (angle / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale t_5 = (b * a) * (b * -a) t_6 = (4.0 * t_5) / math.pow((x_45_scale * y_45_scale), 2.0) return -math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + math.sqrt((math.pow((t_4 - t_3), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale) t_5 = Float64(Float64(b * a) * Float64(b * Float64(-a))) t_6 = Float64(Float64(4.0 * t_5) / (Float64(x_45_scale * y_45_scale) ^ 2.0)) return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * t_6) * t_5) * Float64(Float64(t_4 + t_3) + sqrt(Float64((Float64(t_4 - t_3) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0))))))) / t_6) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (angle / 180.0) * pi; t_1 = sin(t_0); t_2 = cos(t_0); t_3 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale; t_5 = (b * a) * (b * -a); t_6 = (4.0 * t_5) / ((x_45_scale * y_45_scale) ^ 2.0); tmp = -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((((t_4 - t_3) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0)))))) / t_6; 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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = 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] / y$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] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(4.0 * t$95$5), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(N[(2.0 * t$95$6), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(N[(t$95$4 + t$95$3), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(t$95$4 - t$95$3), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6}
\end{array}
\end{array}
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI))))
(t_1 (sin (fma 0.005555555555555556 (* angle PI) (/ PI 2.0)))))
(if (<= x-scale_m 6.6e+15)
(* 0.25 (* b_m (* y-scale_m 4.0)))
(*
0.25
(*
(* x-scale_m (pow 8.0 0.5))
(pow
(fma 2.0 (* (* a a) (* t_1 t_1)) (* 2.0 (* (* b_m b_m) (* t_0 t_0))))
0.5))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (((double) M_PI) / 2.0)));
double tmp;
if (x_45_scale_m <= 6.6e+15) {
tmp = 0.25 * (b_m * (y_45_scale_m * 4.0));
} else {
tmp = 0.25 * ((x_45_scale_m * pow(8.0, 0.5)) * pow(fma(2.0, ((a * a) * (t_1 * t_1)), (2.0 * ((b_m * b_m) * (t_0 * t_0)))), 0.5));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) t_1 = sin(fma(0.005555555555555556, Float64(angle * pi), Float64(pi / 2.0))) tmp = 0.0 if (x_45_scale_m <= 6.6e+15) tmp = Float64(0.25 * Float64(b_m * Float64(y_45_scale_m * 4.0))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale_m * (8.0 ^ 0.5)) * (fma(2.0, Float64(Float64(a * a) * Float64(t_1 * t_1)), Float64(2.0 * Float64(Float64(b_m * b_m) * Float64(t_0 * t_0)))) ^ 0.5))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$45$scale$95$m, 6.6e+15], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(x$45$scale$95$m * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision] * N[Power[N[(2.0 * N[(N[(a * a), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, \frac{\pi}{2}\right)\right)\\
\mathbf{if}\;x-scale\_m \leq 6.6 \cdot 10^{+15}:\\
\;\;\;\;0.25 \cdot \left(b\_m \cdot \left(y-scale\_m \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale\_m \cdot {8}^{0.5}\right) \cdot {\left(\mathsf{fma}\left(2, \left(a \cdot a\right) \cdot \left(t\_1 \cdot t\_1\right), 2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(t\_0 \cdot t\_0\right)\right)\right)\right)}^{0.5}\right)\\
\end{array}
\end{array}
if x-scale < 6.6e15Initial program 2.4%
Taylor expanded in angle around 0
Applied rewrites23.3%
if 6.6e15 < x-scale Initial program 2.2%
Taylor expanded in y-scale around 0
Applied rewrites64.9%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= x-scale_m 6.6e+15)
(* 0.25 (* b_m (* y-scale_m 4.0)))
(*
0.25
(*
(* x-scale_m (sqrt 8.0))
(sqrt
(fma
2.0
(* (pow a 2.0) (pow (cos t_0) 2.0))
(* 2.0 (* (pow b_m 2.0) (pow (sin t_0) 2.0))))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (x_45_scale_m <= 6.6e+15) {
tmp = 0.25 * (b_m * (y_45_scale_m * 4.0));
} else {
tmp = 0.25 * ((x_45_scale_m * sqrt(8.0)) * sqrt(fma(2.0, (pow(a, 2.0) * pow(cos(t_0), 2.0)), (2.0 * (pow(b_m, 2.0) * pow(sin(t_0), 2.0))))));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (x_45_scale_m <= 6.6e+15) tmp = Float64(0.25 * Float64(b_m * Float64(y_45_scale_m * 4.0))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale_m * sqrt(8.0)) * sqrt(fma(2.0, Float64((a ^ 2.0) * (cos(t_0) ^ 2.0)), Float64(2.0 * Float64((b_m ^ 2.0) * (sin(t_0) ^ 2.0))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale$95$m, 6.6e+15], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(x$45$scale$95$m * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;x-scale\_m \leq 6.6 \cdot 10^{+15}:\\
\;\;\;\;0.25 \cdot \left(b\_m \cdot \left(y-scale\_m \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale\_m \cdot \sqrt{8}\right) \cdot \sqrt{\mathsf{fma}\left(2, {a}^{2} \cdot {\cos t\_0}^{2}, 2 \cdot \left({b\_m}^{2} \cdot {\sin t\_0}^{2}\right)\right)}\right)\\
\end{array}
\end{array}
if x-scale < 6.6e15Initial program 2.4%
Taylor expanded in angle around 0
Applied rewrites23.3%
if 6.6e15 < x-scale Initial program 2.2%
Taylor expanded in x-scale around 0
Applied rewrites21.0%
Taylor expanded in y-scale around 0
Applied rewrites64.8%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin t_0))
(t_2 (* t_1 t_1))
(t_3 (cos t_0)))
(if (<= b_m 4.4e+24)
(*
0.25
(fma
b_m
(* y-scale_m (* t_3 4.0))
(/
(* (* a a) (* y-scale_m (* t_2 (pow 8.0 0.5))))
(* b_m (* t_3 (pow 2.0 0.5))))))
(if (<= b_m 1.1e+30)
(*
0.25
(*
(* b_m (* x-scale_m (* y-scale_m (pow 8.0 0.5))))
(pow
(+
(/ t_2 (* y-scale_m y-scale_m))
(+
(/ (pow t_1 2.0) (pow y-scale_m 2.0))
(/
(pow (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))) 2.0)
(pow x-scale_m 2.0))))
0.5)))
(* 0.25 (* b_m (* y-scale_m 4.0)))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = t_1 * t_1;
double t_3 = cos(t_0);
double tmp;
if (b_m <= 4.4e+24) {
tmp = 0.25 * fma(b_m, (y_45_scale_m * (t_3 * 4.0)), (((a * a) * (y_45_scale_m * (t_2 * pow(8.0, 0.5)))) / (b_m * (t_3 * pow(2.0, 0.5)))));
} else if (b_m <= 1.1e+30) {
tmp = 0.25 * ((b_m * (x_45_scale_m * (y_45_scale_m * pow(8.0, 0.5)))) * pow(((t_2 / (y_45_scale_m * y_45_scale_m)) + ((pow(t_1, 2.0) / pow(y_45_scale_m, 2.0)) + (pow(sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI)))), 2.0) / pow(x_45_scale_m, 2.0)))), 0.5));
} else {
tmp = 0.25 * (b_m * (y_45_scale_m * 4.0));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = Float64(t_1 * t_1) t_3 = cos(t_0) tmp = 0.0 if (b_m <= 4.4e+24) tmp = Float64(0.25 * fma(b_m, Float64(y_45_scale_m * Float64(t_3 * 4.0)), Float64(Float64(Float64(a * a) * Float64(y_45_scale_m * Float64(t_2 * (8.0 ^ 0.5)))) / Float64(b_m * Float64(t_3 * (2.0 ^ 0.5)))))); elseif (b_m <= 1.1e+30) tmp = Float64(0.25 * Float64(Float64(b_m * Float64(x_45_scale_m * Float64(y_45_scale_m * (8.0 ^ 0.5)))) * (Float64(Float64(t_2 / Float64(y_45_scale_m * y_45_scale_m)) + Float64(Float64((t_1 ^ 2.0) / (y_45_scale_m ^ 2.0)) + Float64((sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) ^ 2.0) / (x_45_scale_m ^ 2.0)))) ^ 0.5))); else tmp = Float64(0.25 * Float64(b_m * Float64(y_45_scale_m * 4.0))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 4.4e+24], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$3 * 4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * a), $MachinePrecision] * N[(y$45$scale$95$m * N[(t$95$2 * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b$95$m * N[(t$95$3 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.1e+30], N[(0.25 * N[(N[(b$95$m * N[(x$45$scale$95$m * N[(y$45$scale$95$m * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(t$95$2 / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] / N[Power[y$45$scale$95$m, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[x$45$scale$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := t\_1 \cdot t\_1\\
t_3 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 4.4 \cdot 10^{+24}:\\
\;\;\;\;0.25 \cdot \mathsf{fma}\left(b\_m, y-scale\_m \cdot \left(t\_3 \cdot 4\right), \frac{\left(a \cdot a\right) \cdot \left(y-scale\_m \cdot \left(t\_2 \cdot {8}^{0.5}\right)\right)}{b\_m \cdot \left(t\_3 \cdot {2}^{0.5}\right)}\right)\\
\mathbf{elif}\;b\_m \leq 1.1 \cdot 10^{+30}:\\
\;\;\;\;0.25 \cdot \left(\left(b\_m \cdot \left(x-scale\_m \cdot \left(y-scale\_m \cdot {8}^{0.5}\right)\right)\right) \cdot {\left(\frac{t\_2}{y-scale\_m \cdot y-scale\_m} + \left(\frac{{t\_1}^{2}}{{y-scale\_m}^{2}} + \frac{{\sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)}^{2}}{{x-scale\_m}^{2}}\right)\right)}^{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(b\_m \cdot \left(y-scale\_m \cdot 4\right)\right)\\
\end{array}
\end{array}
if b < 4.40000000000000003e24Initial program 1.8%
Taylor expanded in x-scale around 0
Applied rewrites20.4%
Taylor expanded in x-scale around 0
Applied rewrites20.3%
Taylor expanded in a around 0
lower-fma.f64N/A
Applied rewrites21.1%
if 4.40000000000000003e24 < b < 1.1e30Initial program 0.0%
Taylor expanded in b around inf
Applied rewrites0.0%
Taylor expanded in x-scale around inf
lower-+.f64N/A
Applied rewrites0.0%
Taylor expanded in x-scale around inf
Applied rewrites0.0%
if 1.1e30 < b Initial program 4.1%
Taylor expanded in angle around 0
Applied rewrites28.1%
Final simplification22.5%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin t_0))
(t_2 (cos t_0)))
(if (<= b_m 2.7e+23)
(*
0.25
(fma
b_m
(* y-scale_m (* t_2 4.0))
(/
(* (* a a) (* y-scale_m (* (* t_1 t_1) (pow 8.0 0.5))))
(* b_m (* t_2 (pow 2.0 0.5))))))
(* 0.25 (* b_m (* y-scale_m 4.0))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double tmp;
if (b_m <= 2.7e+23) {
tmp = 0.25 * fma(b_m, (y_45_scale_m * (t_2 * 4.0)), (((a * a) * (y_45_scale_m * ((t_1 * t_1) * pow(8.0, 0.5)))) / (b_m * (t_2 * pow(2.0, 0.5)))));
} else {
tmp = 0.25 * (b_m * (y_45_scale_m * 4.0));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = cos(t_0) tmp = 0.0 if (b_m <= 2.7e+23) tmp = Float64(0.25 * fma(b_m, Float64(y_45_scale_m * Float64(t_2 * 4.0)), Float64(Float64(Float64(a * a) * Float64(y_45_scale_m * Float64(Float64(t_1 * t_1) * (8.0 ^ 0.5)))) / Float64(b_m * Float64(t_2 * (2.0 ^ 0.5)))))); else tmp = Float64(0.25 * Float64(b_m * Float64(y_45_scale_m * 4.0))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[b$95$m, 2.7e+23], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$2 * 4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * a), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b$95$m * N[(t$95$2 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
\mathbf{if}\;b\_m \leq 2.7 \cdot 10^{+23}:\\
\;\;\;\;0.25 \cdot \mathsf{fma}\left(b\_m, y-scale\_m \cdot \left(t\_2 \cdot 4\right), \frac{\left(a \cdot a\right) \cdot \left(y-scale\_m \cdot \left(\left(t\_1 \cdot t\_1\right) \cdot {8}^{0.5}\right)\right)}{b\_m \cdot \left(t\_2 \cdot {2}^{0.5}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(b\_m \cdot \left(y-scale\_m \cdot 4\right)\right)\\
\end{array}
\end{array}
if b < 2.6999999999999999e23Initial program 1.8%
Taylor expanded in x-scale around 0
Applied rewrites20.5%
Taylor expanded in x-scale around 0
Applied rewrites20.4%
Taylor expanded in a around 0
lower-fma.f64N/A
Applied rewrites21.2%
if 2.6999999999999999e23 < b Initial program 3.9%
Taylor expanded in angle around 0
Applied rewrites26.8%
Final simplification22.5%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* t_1 (pow 2.0 0.5)))
(t_3
(*
(pow b_m 2.0)
(*
y-scale_m
(*
(pow (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))) 2.0)
(sqrt 8.0)))))
(t_4 (sin t_0))
(t_5 (* t_4 (sqrt 2.0)))
(t_6 (* t_1 4.0))
(t_7 (* (* a a) (* y-scale_m (* (* t_4 t_4) (pow 8.0 0.5)))))
(t_8 (* t_4 (* (sqrt 2.0) (sqrt 8.0)))))
(if (<= angle 1.4e+30)
(* 0.25 (fma b_m (* y-scale_m t_6) (/ t_7 (* b_m t_2))))
(if (<= angle 8e+75)
(*
0.25
(* (* -1.0 b_m) (fma y-scale_m t_6 (/ t_7 (* (* b_m b_m) t_2)))))
(if (<= angle 8.5e+160)
(*
0.25
(* (* -1.0 a) (fma y-scale_m t_8 (/ t_3 (* (pow a 2.0) t_5)))))
(* 0.25 (fma a (* y-scale_m t_8) (/ t_3 (* a t_5)))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = t_1 * pow(2.0, 0.5);
double t_3 = pow(b_m, 2.0) * (y_45_scale_m * (pow(sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI)))), 2.0) * sqrt(8.0)));
double t_4 = sin(t_0);
double t_5 = t_4 * sqrt(2.0);
double t_6 = t_1 * 4.0;
double t_7 = (a * a) * (y_45_scale_m * ((t_4 * t_4) * pow(8.0, 0.5)));
double t_8 = t_4 * (sqrt(2.0) * sqrt(8.0));
double tmp;
if (angle <= 1.4e+30) {
tmp = 0.25 * fma(b_m, (y_45_scale_m * t_6), (t_7 / (b_m * t_2)));
} else if (angle <= 8e+75) {
tmp = 0.25 * ((-1.0 * b_m) * fma(y_45_scale_m, t_6, (t_7 / ((b_m * b_m) * t_2))));
} else if (angle <= 8.5e+160) {
tmp = 0.25 * ((-1.0 * a) * fma(y_45_scale_m, t_8, (t_3 / (pow(a, 2.0) * t_5))));
} else {
tmp = 0.25 * fma(a, (y_45_scale_m * t_8), (t_3 / (a * t_5)));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(t_1 * (2.0 ^ 0.5)) t_3 = Float64((b_m ^ 2.0) * Float64(y_45_scale_m * Float64((sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) ^ 2.0) * sqrt(8.0)))) t_4 = sin(t_0) t_5 = Float64(t_4 * sqrt(2.0)) t_6 = Float64(t_1 * 4.0) t_7 = Float64(Float64(a * a) * Float64(y_45_scale_m * Float64(Float64(t_4 * t_4) * (8.0 ^ 0.5)))) t_8 = Float64(t_4 * Float64(sqrt(2.0) * sqrt(8.0))) tmp = 0.0 if (angle <= 1.4e+30) tmp = Float64(0.25 * fma(b_m, Float64(y_45_scale_m * t_6), Float64(t_7 / Float64(b_m * t_2)))); elseif (angle <= 8e+75) tmp = Float64(0.25 * Float64(Float64(-1.0 * b_m) * fma(y_45_scale_m, t_6, Float64(t_7 / Float64(Float64(b_m * b_m) * t_2))))); elseif (angle <= 8.5e+160) tmp = Float64(0.25 * Float64(Float64(-1.0 * a) * fma(y_45_scale_m, t_8, Float64(t_3 / Float64((a ^ 2.0) * t_5))))); else tmp = Float64(0.25 * fma(a, Float64(y_45_scale_m * t_8), Float64(t_3 / Float64(a * t_5)))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] * N[(y$45$scale$95$m * N[(N[Power[N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * 4.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(a * a), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[(t$95$4 * t$95$4), $MachinePrecision] * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 1.4e+30], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * t$95$6), $MachinePrecision] + N[(t$95$7 / N[(b$95$m * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 8e+75], N[(0.25 * N[(N[(-1.0 * b$95$m), $MachinePrecision] * N[(y$45$scale$95$m * t$95$6 + N[(t$95$7 / N[(N[(b$95$m * b$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 8.5e+160], N[(0.25 * N[(N[(-1.0 * a), $MachinePrecision] * N[(y$45$scale$95$m * t$95$8 + N[(t$95$3 / N[(N[Power[a, 2.0], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(a * N[(y$45$scale$95$m * t$95$8), $MachinePrecision] + N[(t$95$3 / N[(a * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t\_0\\
t_2 := t\_1 \cdot {2}^{0.5}\\
t_3 := {b\_m}^{2} \cdot \left(y-scale\_m \cdot \left({\sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)}^{2} \cdot \sqrt{8}\right)\right)\\
t_4 := \sin t\_0\\
t_5 := t\_4 \cdot \sqrt{2}\\
t_6 := t\_1 \cdot 4\\
t_7 := \left(a \cdot a\right) \cdot \left(y-scale\_m \cdot \left(\left(t\_4 \cdot t\_4\right) \cdot {8}^{0.5}\right)\right)\\
t_8 := t\_4 \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\\
\mathbf{if}\;angle \leq 1.4 \cdot 10^{+30}:\\
\;\;\;\;0.25 \cdot \mathsf{fma}\left(b\_m, y-scale\_m \cdot t\_6, \frac{t\_7}{b\_m \cdot t\_2}\right)\\
\mathbf{elif}\;angle \leq 8 \cdot 10^{+75}:\\
\;\;\;\;0.25 \cdot \left(\left(-1 \cdot b\_m\right) \cdot \mathsf{fma}\left(y-scale\_m, t\_6, \frac{t\_7}{\left(b\_m \cdot b\_m\right) \cdot t\_2}\right)\right)\\
\mathbf{elif}\;angle \leq 8.5 \cdot 10^{+160}:\\
\;\;\;\;0.25 \cdot \left(\left(-1 \cdot a\right) \cdot \mathsf{fma}\left(y-scale\_m, t\_8, \frac{t\_3}{{a}^{2} \cdot t\_5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \mathsf{fma}\left(a, y-scale\_m \cdot t\_8, \frac{t\_3}{a \cdot t\_5}\right)\\
\end{array}
\end{array}
if angle < 1.39999999999999992e30Initial program 3.0%
Taylor expanded in x-scale around 0
Applied rewrites22.6%
Taylor expanded in x-scale around 0
Applied rewrites22.5%
Taylor expanded in a around 0
lower-fma.f64N/A
Applied rewrites24.6%
if 1.39999999999999992e30 < angle < 7.99999999999999941e75Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites23.2%
Taylor expanded in x-scale around 0
Applied rewrites23.2%
Taylor expanded in b around -inf
Applied rewrites29.7%
if 7.99999999999999941e75 < angle < 8.49999999999999982e160Initial program 0.1%
Taylor expanded in x-scale around 0
Applied rewrites20.6%
Taylor expanded in a around -inf
Applied rewrites26.7%
if 8.49999999999999982e160 < angle Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites24.8%
Taylor expanded in b around 0
lower-fma.f64N/A
Applied rewrites20.9%
Final simplification24.7%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin t_0))
(t_2 (cos t_0)))
(*
0.25
(fma
b_m
(* y-scale_m (* t_2 4.0))
(/
(* (* a a) (* y-scale_m (* (* t_1 t_1) (pow 8.0 0.5))))
(* b_m (* t_2 (pow 2.0 0.5))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = cos(t_0);
return 0.25 * fma(b_m, (y_45_scale_m * (t_2 * 4.0)), (((a * a) * (y_45_scale_m * ((t_1 * t_1) * pow(8.0, 0.5)))) / (b_m * (t_2 * pow(2.0, 0.5)))));
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = cos(t_0) return Float64(0.25 * fma(b_m, Float64(y_45_scale_m * Float64(t_2 * 4.0)), Float64(Float64(Float64(a * a) * Float64(y_45_scale_m * Float64(Float64(t_1 * t_1) * (8.0 ^ 0.5)))) / Float64(b_m * Float64(t_2 * (2.0 ^ 0.5)))))) end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$2 * 4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * a), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[Power[8.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b$95$m * N[(t$95$2 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
0.25 \cdot \mathsf{fma}\left(b\_m, y-scale\_m \cdot \left(t\_2 \cdot 4\right), \frac{\left(a \cdot a\right) \cdot \left(y-scale\_m \cdot \left(\left(t\_1 \cdot t\_1\right) \cdot {8}^{0.5}\right)\right)}{b\_m \cdot \left(t\_2 \cdot {2}^{0.5}\right)}\right)
\end{array}
\end{array}
Initial program 2.3%
Taylor expanded in x-scale around 0
Applied rewrites22.7%
Taylor expanded in x-scale around 0
Applied rewrites22.6%
Taylor expanded in a around 0
lower-fma.f64N/A
Applied rewrites23.7%
Final simplification23.7%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin t_0))
(t_2 (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))))
(t_3 (* t_2 (pow 2.0 0.5)))
(t_4 (pow t_3 2.0))
(t_5 (* t_1 t_1))
(t_6 (* t_2 t_2))
(t_7 (/ (* t_5 t_6) (* y-scale_m y-scale_m)))
(t_8 (fma -2.0 t_7 (* 4.0 t_7)))
(t_9 (fma 0.5 (/ t_8 t_6) (/ t_5 (* y-scale_m y-scale_m))))
(t_10
(-
(/ (pow t_1 4.0) (pow y-scale_m 4.0))
(* 0.25 (/ (* t_8 t_8) (pow t_2 4.0)))))
(t_11 (- (* 0.5 (/ t_10 t_6)) (* 0.25 (/ (* t_9 t_9) t_4)))))
(if (<= x-scale_m 1.9e+142)
(fma
0.25
(* b_m (* y-scale_m (* t_2 4.0)))
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_9))) t_3)
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_11))) t_3)
(*
0.125
(/
(*
b_m
(*
(* x-scale_m x-scale_m)
(*
y-scale_m
(*
(pow 8.0 0.5)
(-
(* -0.25 (/ (* t_8 t_10) (pow t_2 6.0)))
(* 0.5 (/ (* t_9 t_11) t_4)))))))
t_3)))))))
(* 0.25 (* b_m (* x-scale_m (* t_0 (* (sqrt 2.0) (sqrt 8.0)))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI))));
double t_3 = t_2 * pow(2.0, 0.5);
double t_4 = pow(t_3, 2.0);
double t_5 = t_1 * t_1;
double t_6 = t_2 * t_2;
double t_7 = (t_5 * t_6) / (y_45_scale_m * y_45_scale_m);
double t_8 = fma(-2.0, t_7, (4.0 * t_7));
double t_9 = fma(0.5, (t_8 / t_6), (t_5 / (y_45_scale_m * y_45_scale_m)));
double t_10 = (pow(t_1, 4.0) / pow(y_45_scale_m, 4.0)) - (0.25 * ((t_8 * t_8) / pow(t_2, 4.0)));
double t_11 = (0.5 * (t_10 / t_6)) - (0.25 * ((t_9 * t_9) / t_4));
double tmp;
if (x_45_scale_m <= 1.9e+142) {
tmp = fma(0.25, (b_m * (y_45_scale_m * (t_2 * 4.0))), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_9))) / t_3), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_11))) / t_3), (0.125 * ((b_m * ((x_45_scale_m * x_45_scale_m) * (y_45_scale_m * (pow(8.0, 0.5) * ((-0.25 * ((t_8 * t_10) / pow(t_2, 6.0))) - (0.5 * ((t_9 * t_11) / t_4))))))) / t_3)))))));
} else {
tmp = 0.25 * (b_m * (x_45_scale_m * (t_0 * (sqrt(2.0) * sqrt(8.0)))));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) t_3 = Float64(t_2 * (2.0 ^ 0.5)) t_4 = t_3 ^ 2.0 t_5 = Float64(t_1 * t_1) t_6 = Float64(t_2 * t_2) t_7 = Float64(Float64(t_5 * t_6) / Float64(y_45_scale_m * y_45_scale_m)) t_8 = fma(-2.0, t_7, Float64(4.0 * t_7)) t_9 = fma(0.5, Float64(t_8 / t_6), Float64(t_5 / Float64(y_45_scale_m * y_45_scale_m))) t_10 = Float64(Float64((t_1 ^ 4.0) / (y_45_scale_m ^ 4.0)) - Float64(0.25 * Float64(Float64(t_8 * t_8) / (t_2 ^ 4.0)))) t_11 = Float64(Float64(0.5 * Float64(t_10 / t_6)) - Float64(0.25 * Float64(Float64(t_9 * t_9) / t_4))) tmp = 0.0 if (x_45_scale_m <= 1.9e+142) tmp = fma(0.25, Float64(b_m * Float64(y_45_scale_m * Float64(t_2 * 4.0))), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_9))) / t_3), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_11))) / t_3), Float64(0.125 * Float64(Float64(b_m * Float64(Float64(x_45_scale_m * x_45_scale_m) * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * Float64(Float64(-0.25 * Float64(Float64(t_8 * t_10) / (t_2 ^ 6.0))) - Float64(0.5 * Float64(Float64(t_9 * t_11) / t_4))))))) / t_3))))))); else tmp = Float64(0.25 * Float64(b_m * Float64(x_45_scale_m * Float64(t_0 * Float64(sqrt(2.0) * sqrt(8.0)))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$3, 2.0], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * t$95$2), $MachinePrecision]}, Block[{t$95$7 = N[(N[(t$95$5 * t$95$6), $MachinePrecision] / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(-2.0 * t$95$7 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(0.5 * N[(t$95$8 / t$95$6), $MachinePrecision] + N[(t$95$5 / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[(N[Power[t$95$1, 4.0], $MachinePrecision] / N[Power[y$45$scale$95$m, 4.0], $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$8 * t$95$8), $MachinePrecision] / N[Power[t$95$2, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$11 = N[(N[(0.5 * N[(t$95$10 / t$95$6), $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$9 * t$95$9), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale$95$m, 1.9e+142], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$2 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$11), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(0.125 * N[(N[(b$95$m * N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * N[(N[(-0.25 * N[(N[(t$95$8 * t$95$10), $MachinePrecision] / N[Power[t$95$2, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[(N[(t$95$9 * t$95$11), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(b$95$m * N[(x$45$scale$95$m * N[(t$95$0 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)\\
t_3 := t\_2 \cdot {2}^{0.5}\\
t_4 := {t\_3}^{2}\\
t_5 := t\_1 \cdot t\_1\\
t_6 := t\_2 \cdot t\_2\\
t_7 := \frac{t\_5 \cdot t\_6}{y-scale\_m \cdot y-scale\_m}\\
t_8 := \mathsf{fma}\left(-2, t\_7, 4 \cdot t\_7\right)\\
t_9 := \mathsf{fma}\left(0.5, \frac{t\_8}{t\_6}, \frac{t\_5}{y-scale\_m \cdot y-scale\_m}\right)\\
t_10 := \frac{{t\_1}^{4}}{{y-scale\_m}^{4}} - 0.25 \cdot \frac{t\_8 \cdot t\_8}{{t\_2}^{4}}\\
t_11 := 0.5 \cdot \frac{t\_10}{t\_6} - 0.25 \cdot \frac{t\_9 \cdot t\_9}{t\_4}\\
\mathbf{if}\;x-scale\_m \leq 1.9 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(0.25, b\_m \cdot \left(y-scale\_m \cdot \left(t\_2 \cdot 4\right)\right), \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_9\right)\right)}{t\_3}, \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_11\right)\right)}{t\_3}, 0.125 \cdot \frac{b\_m \cdot \left(\left(x-scale\_m \cdot x-scale\_m\right) \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot \left(-0.25 \cdot \frac{t\_8 \cdot t\_10}{{t\_2}^{6}} - 0.5 \cdot \frac{t\_9 \cdot t\_11}{t\_4}\right)\right)\right)\right)}{t\_3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(b\_m \cdot \left(x-scale\_m \cdot \left(t\_0 \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)\\
\end{array}
\end{array}
if x-scale < 1.89999999999999995e142Initial program 2.1%
Taylor expanded in b around inf
Applied rewrites5.3%
Taylor expanded in x-scale around inf
Applied rewrites9.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6410.2
Applied rewrites10.2%
Taylor expanded in x-scale around 0
Applied rewrites16.3%
if 1.89999999999999995e142 < x-scale Initial program 3.6%
Taylor expanded in b around inf
Applied rewrites5.9%
Taylor expanded in x-scale around inf
Applied rewrites20.3%
Taylor expanded in angle around 0
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f6425.4
Applied rewrites25.4%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI))))
(t_1 (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))))
(t_2 (* t_1 (pow 2.0 0.5)))
(t_3 (pow t_2 2.0))
(t_4 (* t_0 t_0))
(t_5 (* t_1 t_1))
(t_6 (/ (* t_4 t_5) (* y-scale_m y-scale_m)))
(t_7 (fma -2.0 t_6 (* 4.0 t_6)))
(t_8 (fma 0.5 (/ t_7 t_5) (/ t_4 (* y-scale_m y-scale_m))))
(t_9
(-
(/ (pow t_0 4.0) (pow y-scale_m 4.0))
(* 0.25 (/ (* t_7 t_7) (pow t_1 4.0)))))
(t_10 (- (* 0.5 (/ t_9 t_5)) (* 0.25 (/ (* t_8 t_8) t_3)))))
(if (<= x-scale_m 1.75e+142)
(fma
0.25
(* b_m (* y-scale_m (* t_1 4.0)))
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_8))) t_2)
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_10))) t_2)
(*
0.125
(/
(*
b_m
(*
(* x-scale_m x-scale_m)
(*
y-scale_m
(*
(pow 8.0 0.5)
(-
(* -0.25 (/ (* t_7 t_9) (pow t_1 6.0)))
(* 0.5 (/ (* t_8 t_10) t_3)))))))
t_2)))))))
(*
0.25
(*
0.005555555555555556
(* angle (* b_m (* x-scale_m (* PI (* (sqrt 2.0) (sqrt 8.0)))))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI))));
double t_2 = t_1 * pow(2.0, 0.5);
double t_3 = pow(t_2, 2.0);
double t_4 = t_0 * t_0;
double t_5 = t_1 * t_1;
double t_6 = (t_4 * t_5) / (y_45_scale_m * y_45_scale_m);
double t_7 = fma(-2.0, t_6, (4.0 * t_6));
double t_8 = fma(0.5, (t_7 / t_5), (t_4 / (y_45_scale_m * y_45_scale_m)));
double t_9 = (pow(t_0, 4.0) / pow(y_45_scale_m, 4.0)) - (0.25 * ((t_7 * t_7) / pow(t_1, 4.0)));
double t_10 = (0.5 * (t_9 / t_5)) - (0.25 * ((t_8 * t_8) / t_3));
double tmp;
if (x_45_scale_m <= 1.75e+142) {
tmp = fma(0.25, (b_m * (y_45_scale_m * (t_1 * 4.0))), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_8))) / t_2), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_10))) / t_2), (0.125 * ((b_m * ((x_45_scale_m * x_45_scale_m) * (y_45_scale_m * (pow(8.0, 0.5) * ((-0.25 * ((t_7 * t_9) / pow(t_1, 6.0))) - (0.5 * ((t_8 * t_10) / t_3))))))) / t_2)))))));
} else {
tmp = 0.25 * (0.005555555555555556 * (angle * (b_m * (x_45_scale_m * (((double) M_PI) * (sqrt(2.0) * sqrt(8.0)))))));
}
return tmp;
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) t_1 = sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) t_2 = Float64(t_1 * (2.0 ^ 0.5)) t_3 = t_2 ^ 2.0 t_4 = Float64(t_0 * t_0) t_5 = Float64(t_1 * t_1) t_6 = Float64(Float64(t_4 * t_5) / Float64(y_45_scale_m * y_45_scale_m)) t_7 = fma(-2.0, t_6, Float64(4.0 * t_6)) t_8 = fma(0.5, Float64(t_7 / t_5), Float64(t_4 / Float64(y_45_scale_m * y_45_scale_m))) t_9 = Float64(Float64((t_0 ^ 4.0) / (y_45_scale_m ^ 4.0)) - Float64(0.25 * Float64(Float64(t_7 * t_7) / (t_1 ^ 4.0)))) t_10 = Float64(Float64(0.5 * Float64(t_9 / t_5)) - Float64(0.25 * Float64(Float64(t_8 * t_8) / t_3))) tmp = 0.0 if (x_45_scale_m <= 1.75e+142) tmp = fma(0.25, Float64(b_m * Float64(y_45_scale_m * Float64(t_1 * 4.0))), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_8))) / t_2), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_10))) / t_2), Float64(0.125 * Float64(Float64(b_m * Float64(Float64(x_45_scale_m * x_45_scale_m) * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * Float64(Float64(-0.25 * Float64(Float64(t_7 * t_9) / (t_1 ^ 6.0))) - Float64(0.5 * Float64(Float64(t_8 * t_10) / t_3))))))) / t_2))))))); else tmp = Float64(0.25 * Float64(0.005555555555555556 * Float64(angle * Float64(b_m * Float64(x_45_scale_m * Float64(pi * Float64(sqrt(2.0) * sqrt(8.0)))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$2, 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$4 * t$95$5), $MachinePrecision] / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(-2.0 * t$95$6 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(0.5 * N[(t$95$7 / t$95$5), $MachinePrecision] + N[(t$95$4 / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(N[(N[Power[t$95$0, 4.0], $MachinePrecision] / N[Power[y$45$scale$95$m, 4.0], $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$7 * t$95$7), $MachinePrecision] / N[Power[t$95$1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[(0.5 * N[(t$95$9 / t$95$5), $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$8 * t$95$8), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale$95$m, 1.75e+142], N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$1 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(0.125 * N[(N[(b$95$m * N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * N[(N[(-0.25 * N[(N[(t$95$7 * t$95$9), $MachinePrecision] / N[Power[t$95$1, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[(N[(t$95$8 * t$95$10), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(0.005555555555555556 * N[(angle * N[(b$95$m * N[(x$45$scale$95$m * N[(Pi * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)\\
t_2 := t\_1 \cdot {2}^{0.5}\\
t_3 := {t\_2}^{2}\\
t_4 := t\_0 \cdot t\_0\\
t_5 := t\_1 \cdot t\_1\\
t_6 := \frac{t\_4 \cdot t\_5}{y-scale\_m \cdot y-scale\_m}\\
t_7 := \mathsf{fma}\left(-2, t\_6, 4 \cdot t\_6\right)\\
t_8 := \mathsf{fma}\left(0.5, \frac{t\_7}{t\_5}, \frac{t\_4}{y-scale\_m \cdot y-scale\_m}\right)\\
t_9 := \frac{{t\_0}^{4}}{{y-scale\_m}^{4}} - 0.25 \cdot \frac{t\_7 \cdot t\_7}{{t\_1}^{4}}\\
t_10 := 0.5 \cdot \frac{t\_9}{t\_5} - 0.25 \cdot \frac{t\_8 \cdot t\_8}{t\_3}\\
\mathbf{if}\;x-scale\_m \leq 1.75 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(0.25, b\_m \cdot \left(y-scale\_m \cdot \left(t\_1 \cdot 4\right)\right), \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_8\right)\right)}{t\_2}, \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_10\right)\right)}{t\_2}, 0.125 \cdot \frac{b\_m \cdot \left(\left(x-scale\_m \cdot x-scale\_m\right) \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot \left(-0.25 \cdot \frac{t\_7 \cdot t\_9}{{t\_1}^{6}} - 0.5 \cdot \frac{t\_8 \cdot t\_10}{t\_3}\right)\right)\right)\right)}{t\_2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(b\_m \cdot \left(x-scale\_m \cdot \left(\pi \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x-scale < 1.74999999999999999e142Initial program 2.1%
Taylor expanded in b around inf
Applied rewrites5.3%
Taylor expanded in x-scale around inf
Applied rewrites9.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6410.2
Applied rewrites10.2%
Taylor expanded in x-scale around 0
Applied rewrites16.3%
if 1.74999999999999999e142 < x-scale Initial program 3.6%
Taylor expanded in b around inf
Applied rewrites5.9%
Taylor expanded in x-scale around inf
Applied rewrites20.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6433.8
Applied rewrites33.8%
b_m = (fabs.f64 b)
x-scale_m = (fabs.f64 x-scale)
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b_m angle x-scale_m y-scale_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI))))
(t_1 (sin (fma 0.005555555555555556 (* angle PI) (* 0.5 PI))))
(t_2 (* t_1 (pow 2.0 0.5)))
(t_3 (pow t_2 2.0))
(t_4 (* t_0 t_0))
(t_5 (* t_1 t_1))
(t_6 (/ (* t_4 t_5) (* y-scale_m y-scale_m)))
(t_7 (fma -2.0 t_6 (* 4.0 t_6)))
(t_8 (fma 0.5 (/ t_7 t_5) (/ t_4 (* y-scale_m y-scale_m))))
(t_9
(-
(/ (pow t_0 4.0) (pow y-scale_m 4.0))
(* 0.25 (/ (* t_7 t_7) (pow t_1 4.0)))))
(t_10 (- (* 0.5 (/ t_9 t_5)) (* 0.25 (/ (* t_8 t_8) t_3)))))
(fma
0.25
(* b_m (* y-scale_m (* t_1 4.0)))
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_8))) t_2)
(*
(* x-scale_m x-scale_m)
(fma
0.125
(/ (* b_m (* y-scale_m (* (pow 8.0 0.5) t_10))) t_2)
(*
0.125
(/
(*
b_m
(*
(* x-scale_m x-scale_m)
(*
y-scale_m
(*
(pow 8.0 0.5)
(-
(* -0.25 (/ (* t_7 t_9) (pow t_1 6.0)))
(* 0.5 (/ (* t_8 t_10) t_3)))))))
t_2)))))))))b_m = fabs(b);
x-scale_m = fabs(x_45_scale);
y-scale_m = fabs(y_45_scale);
double code(double a, double b_m, double angle, double x_45_scale_m, double y_45_scale_m) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = sin(fma(0.005555555555555556, (angle * ((double) M_PI)), (0.5 * ((double) M_PI))));
double t_2 = t_1 * pow(2.0, 0.5);
double t_3 = pow(t_2, 2.0);
double t_4 = t_0 * t_0;
double t_5 = t_1 * t_1;
double t_6 = (t_4 * t_5) / (y_45_scale_m * y_45_scale_m);
double t_7 = fma(-2.0, t_6, (4.0 * t_6));
double t_8 = fma(0.5, (t_7 / t_5), (t_4 / (y_45_scale_m * y_45_scale_m)));
double t_9 = (pow(t_0, 4.0) / pow(y_45_scale_m, 4.0)) - (0.25 * ((t_7 * t_7) / pow(t_1, 4.0)));
double t_10 = (0.5 * (t_9 / t_5)) - (0.25 * ((t_8 * t_8) / t_3));
return fma(0.25, (b_m * (y_45_scale_m * (t_1 * 4.0))), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_8))) / t_2), ((x_45_scale_m * x_45_scale_m) * fma(0.125, ((b_m * (y_45_scale_m * (pow(8.0, 0.5) * t_10))) / t_2), (0.125 * ((b_m * ((x_45_scale_m * x_45_scale_m) * (y_45_scale_m * (pow(8.0, 0.5) * ((-0.25 * ((t_7 * t_9) / pow(t_1, 6.0))) - (0.5 * ((t_8 * t_10) / t_3))))))) / t_2)))))));
}
b_m = abs(b) x-scale_m = abs(x_45_scale) y-scale_m = abs(y_45_scale) function code(a, b_m, angle, x_45_scale_m, y_45_scale_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) t_1 = sin(fma(0.005555555555555556, Float64(angle * pi), Float64(0.5 * pi))) t_2 = Float64(t_1 * (2.0 ^ 0.5)) t_3 = t_2 ^ 2.0 t_4 = Float64(t_0 * t_0) t_5 = Float64(t_1 * t_1) t_6 = Float64(Float64(t_4 * t_5) / Float64(y_45_scale_m * y_45_scale_m)) t_7 = fma(-2.0, t_6, Float64(4.0 * t_6)) t_8 = fma(0.5, Float64(t_7 / t_5), Float64(t_4 / Float64(y_45_scale_m * y_45_scale_m))) t_9 = Float64(Float64((t_0 ^ 4.0) / (y_45_scale_m ^ 4.0)) - Float64(0.25 * Float64(Float64(t_7 * t_7) / (t_1 ^ 4.0)))) t_10 = Float64(Float64(0.5 * Float64(t_9 / t_5)) - Float64(0.25 * Float64(Float64(t_8 * t_8) / t_3))) return fma(0.25, Float64(b_m * Float64(y_45_scale_m * Float64(t_1 * 4.0))), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_8))) / t_2), Float64(Float64(x_45_scale_m * x_45_scale_m) * fma(0.125, Float64(Float64(b_m * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * t_10))) / t_2), Float64(0.125 * Float64(Float64(b_m * Float64(Float64(x_45_scale_m * x_45_scale_m) * Float64(y_45_scale_m * Float64((8.0 ^ 0.5) * Float64(Float64(-0.25 * Float64(Float64(t_7 * t_9) / (t_1 ^ 6.0))) - Float64(0.5 * Float64(Float64(t_8 * t_10) / t_3))))))) / t_2))))))) end
b_m = N[Abs[b], $MachinePrecision]
x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$2, 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$4 * t$95$5), $MachinePrecision] / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(-2.0 * t$95$6 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(0.5 * N[(t$95$7 / t$95$5), $MachinePrecision] + N[(t$95$4 / N[(y$45$scale$95$m * y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(N[(N[Power[t$95$0, 4.0], $MachinePrecision] / N[Power[y$45$scale$95$m, 4.0], $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$7 * t$95$7), $MachinePrecision] / N[Power[t$95$1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[(0.5 * N[(t$95$9 / t$95$5), $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(N[(t$95$8 * t$95$8), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(0.25 * N[(b$95$m * N[(y$45$scale$95$m * N[(t$95$1 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(0.125 * N[(N[(b$95$m * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(0.125 * N[(N[(b$95$m * N[(N[(x$45$scale$95$m * x$45$scale$95$m), $MachinePrecision] * N[(y$45$scale$95$m * N[(N[Power[8.0, 0.5], $MachinePrecision] * N[(N[(-0.25 * N[(N[(t$95$7 * t$95$9), $MachinePrecision] / N[Power[t$95$1, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[(N[(t$95$8 * t$95$10), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
x-scale_m = \left|x-scale\right|
\\
y-scale_m = \left|y-scale\right|
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(0.005555555555555556, angle \cdot \pi, 0.5 \cdot \pi\right)\right)\\
t_2 := t\_1 \cdot {2}^{0.5}\\
t_3 := {t\_2}^{2}\\
t_4 := t\_0 \cdot t\_0\\
t_5 := t\_1 \cdot t\_1\\
t_6 := \frac{t\_4 \cdot t\_5}{y-scale\_m \cdot y-scale\_m}\\
t_7 := \mathsf{fma}\left(-2, t\_6, 4 \cdot t\_6\right)\\
t_8 := \mathsf{fma}\left(0.5, \frac{t\_7}{t\_5}, \frac{t\_4}{y-scale\_m \cdot y-scale\_m}\right)\\
t_9 := \frac{{t\_0}^{4}}{{y-scale\_m}^{4}} - 0.25 \cdot \frac{t\_7 \cdot t\_7}{{t\_1}^{4}}\\
t_10 := 0.5 \cdot \frac{t\_9}{t\_5} - 0.25 \cdot \frac{t\_8 \cdot t\_8}{t\_3}\\
\mathsf{fma}\left(0.25, b\_m \cdot \left(y-scale\_m \cdot \left(t\_1 \cdot 4\right)\right), \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_8\right)\right)}{t\_2}, \left(x-scale\_m \cdot x-scale\_m\right) \cdot \mathsf{fma}\left(0.125, \frac{b\_m \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot t\_10\right)\right)}{t\_2}, 0.125 \cdot \frac{b\_m \cdot \left(\left(x-scale\_m \cdot x-scale\_m\right) \cdot \left(y-scale\_m \cdot \left({8}^{0.5} \cdot \left(-0.25 \cdot \frac{t\_7 \cdot t\_9}{{t\_1}^{6}} - 0.5 \cdot \frac{t\_8 \cdot t\_10}{t\_3}\right)\right)\right)\right)}{t\_2}\right)\right)\right)
\end{array}
\end{array}
Initial program 2.3%
Taylor expanded in b around inf
Applied rewrites5.4%
Taylor expanded in x-scale around inf
Applied rewrites10.5%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x-scale around 0
Applied rewrites14.5%
herbie shell --seed 2025065
(FPCore (a b angle x-scale y-scale)
:name "a from scale-rotated-ellipse"
:precision binary64
(/ (- (sqrt (* (* (* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))) (* (* b a) (* b (- a)))) (+ (+ (/ (/ (+ (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)) (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))))))) (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))