
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) (PI)))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
(PI)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
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)}{\mathsf{PI}\left(\right)}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) (PI)))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
(PI)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
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)}{\mathsf{PI}\left(\right)}
\end{array}
\end{array}
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3 (sqrt (PI))))
(if (<= a_m 1.58e-220)
(* (/ (atan (/ (* (- y-scale) t_1) (* t_2 x-scale))) (PI)) 180.0)
(if (<= a_m 3.4e+30)
(*
(/
(atan
(*
(*
(*
(/ t_1 (sin (* (* (* t_3 t_3) angle) 0.005555555555555556)))
2.0)
(/ y-scale x-scale))
-0.5))
(PI))
180.0)
(* (/ (atan (* (/ t_2 t_1) (/ y-scale x-scale))) (PI)) 180.0)))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;a\_m \leq 1.58 \cdot 10^{-220}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(-y-scale\right) \cdot t\_1}{t\_2 \cdot x-scale}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{elif}\;a\_m \leq 3.4 \cdot 10^{+30}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{t\_1}{\sin \left(\left(\left(t\_3 \cdot t\_3\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 2\right) \cdot \frac{y-scale}{x-scale}\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if a < 1.5800000000000001e-220Initial program 13.8%
Taylor expanded in b around inf
Applied rewrites28.8%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites27.6%
Taylor expanded in a around 0
Applied rewrites47.3%
if 1.5800000000000001e-220 < a < 3.4000000000000002e30Initial program 20.4%
Taylor expanded in b around inf
Applied rewrites36.5%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in a around 0
Applied rewrites55.3%
Applied rewrites59.8%
if 3.4000000000000002e30 < a Initial program 7.5%
Taylor expanded in b around inf
Applied rewrites20.0%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites29.0%
Taylor expanded in a around inf
Applied rewrites56.6%
Final simplification51.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)) (t_1 (sin t_0)))
(if (<= a_m 4.5e+29)
(*
(/
(atan
(*
(*
(*
(/
(cos (* (* (cbrt (pow (PI) 3.0)) angle) 0.005555555555555556))
t_1)
2.0)
(/ y-scale x-scale))
-0.5))
(PI))
180.0)
(* (/ (atan (* (/ t_1 (cos t_0)) (/ y-scale x-scale))) (PI)) 180.0))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
t_1 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 4.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos \left(\left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot angle\right) \cdot 0.005555555555555556\right)}{t\_1} \cdot 2\right) \cdot \frac{y-scale}{x-scale}\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{t\_1}{\cos t\_0} \cdot \frac{y-scale}{x-scale}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if a < 4.5000000000000002e29Initial program 15.3%
Taylor expanded in b around inf
Applied rewrites30.6%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in a around 0
Applied rewrites50.5%
Applied rewrites51.8%
if 4.5000000000000002e29 < a Initial program 7.5%
Taylor expanded in b around inf
Applied rewrites20.0%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites29.0%
Taylor expanded in a around inf
Applied rewrites56.6%
Final simplification52.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)))
(if (<= a_m 3.3e+31)
(/
180.0
(/ (PI) (atan (* (/ 2.0 (tan t_0)) (* (/ y-scale x-scale) -0.5)))))
(*
(/ (atan (* (/ (sin t_0) (cos t_0)) (/ y-scale x-scale))) (PI))
180.0))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;a\_m \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\frac{180}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{2}{\tan t\_0} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\sin t\_0}{\cos t\_0} \cdot \frac{y-scale}{x-scale}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if a < 3.29999999999999992e31Initial program 15.3%
Taylor expanded in b around inf
Applied rewrites30.6%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in a around 0
Applied rewrites50.5%
Applied rewrites50.6%
if 3.29999999999999992e31 < a Initial program 7.5%
Taylor expanded in b around inf
Applied rewrites20.0%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites29.0%
Taylor expanded in a around inf
Applied rewrites56.6%
Final simplification51.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)))
(if (<= y-scale 1.7e-126)
(/
1.0
(/
(PI)
(* (atan (* (/ 2.0 (tan t_0)) (* (/ y-scale x-scale) -0.5))) 180.0)))
(*
(/
(atan (* (* (* (/ 1.0 (sin t_0)) 2.0) (/ y-scale x-scale)) -0.5))
(PI))
180.0))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;y-scale \leq 1.7 \cdot 10^{-126}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{2}{\tan t\_0} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right) \cdot 180}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{1}{\sin t\_0} \cdot 2\right) \cdot \frac{y-scale}{x-scale}\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if y-scale < 1.7e-126Initial program 10.2%
Taylor expanded in b around inf
Applied rewrites25.3%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites30.7%
Taylor expanded in a around 0
Applied rewrites51.0%
Applied rewrites51.0%
if 1.7e-126 < y-scale Initial program 20.5%
Taylor expanded in b around inf
Applied rewrites34.4%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites28.3%
Taylor expanded in a around 0
Applied rewrites44.8%
Taylor expanded in angle around 0
Applied rewrites50.6%
Final simplification50.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)))
(if (<= y-scale 1.7e-126)
(/
180.0
(/ (PI) (atan (* (/ 2.0 (tan t_0)) (* (/ y-scale x-scale) -0.5)))))
(*
(/
(atan (* (* (* (/ 1.0 (sin t_0)) 2.0) (/ y-scale x-scale)) -0.5))
(PI))
180.0))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;y-scale \leq 1.7 \cdot 10^{-126}:\\
\;\;\;\;\frac{180}{\frac{\mathsf{PI}\left(\right)}{\tan^{-1} \left(\frac{2}{\tan t\_0} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{1}{\sin t\_0} \cdot 2\right) \cdot \frac{y-scale}{x-scale}\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if y-scale < 1.7e-126Initial program 10.2%
Taylor expanded in b around inf
Applied rewrites25.3%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites30.7%
Taylor expanded in a around 0
Applied rewrites51.0%
Applied rewrites51.0%
if 1.7e-126 < y-scale Initial program 20.5%
Taylor expanded in b around inf
Applied rewrites34.4%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites28.3%
Taylor expanded in a around 0
Applied rewrites44.8%
Taylor expanded in angle around 0
Applied rewrites50.6%
Final simplification50.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)))
(if (<= y-scale 1.7e-126)
(*
(/ (atan (* (/ 2.0 (tan t_0)) (* (/ y-scale x-scale) -0.5))) (PI))
180.0)
(*
(/
(atan (* (* (* (/ 1.0 (sin t_0)) 2.0) (/ y-scale x-scale)) -0.5))
(PI))
180.0))))\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;y-scale \leq 1.7 \cdot 10^{-126}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{2}{\tan t\_0} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{1}{\sin t\_0} \cdot 2\right) \cdot \frac{y-scale}{x-scale}\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if y-scale < 1.7e-126Initial program 10.2%
Taylor expanded in b around inf
Applied rewrites25.3%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites30.7%
Taylor expanded in a around 0
Applied rewrites51.0%
Applied rewrites51.0%
if 1.7e-126 < y-scale Initial program 20.5%
Taylor expanded in b around inf
Applied rewrites34.4%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites28.3%
Taylor expanded in a around 0
Applied rewrites44.8%
Taylor expanded in angle around 0
Applied rewrites50.6%
Final simplification50.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(/
(*
(atan
(*
(/ 2.0 (tan (* (* (PI) angle) 0.005555555555555556)))
(* (/ y-scale x-scale) -0.5)))
180.0)
(PI)))\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{2}{\tan \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right) \cdot 180}{\mathsf{PI}\left(\right)}
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites29.9%
Taylor expanded in a around 0
Applied rewrites48.9%
Applied rewrites48.9%
Final simplification48.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(*
(/
(atan
(*
(/ 2.0 (tan (* (* (PI) angle) 0.005555555555555556)))
(* (/ y-scale x-scale) -0.5)))
(PI))
180.0))\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{2}{\tan \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot \left(\frac{y-scale}{x-scale} \cdot -0.5\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Taylor expanded in x-scale around 0
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites29.9%
Taylor expanded in a around 0
Applied rewrites48.9%
Applied rewrites48.9%
Final simplification48.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(/
(*
(atan
(/
(* -2.0 (/ y-scale x-scale))
(sin (* 0.011111111111111112 (* (PI) angle)))))
180.0)
(PI)))\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale}{x-scale}}{\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Taylor expanded in angle around 0
Applied rewrites48.5%
Applied rewrites48.0%
Applied rewrites48.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
:precision binary64
(*
(/
(atan
(/
(* -2.0 (/ y-scale x-scale))
(sin (* 0.011111111111111112 (* (PI) angle)))))
(PI))
180.0))\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale}{x-scale}}{\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Taylor expanded in angle around 0
Applied rewrites48.5%
Applied rewrites48.0%
Applied rewrites48.5%
Final simplification48.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* (/ (atan (* (/ (/ y-scale (* (PI) x-scale)) angle) -180.0)) (PI)) 180.0))
\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{\frac{y-scale}{\mathsf{PI}\left(\right) \cdot x-scale}}{angle} \cdot -180\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Applied rewrites28.6%
Taylor expanded in angle around 0
Applied rewrites40.8%
Applied rewrites42.7%
Final simplification42.7%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* (/ (atan (* (/ y-scale (* (* x-scale angle) (PI))) -180.0)) (PI)) 180.0))
\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{y-scale}{\left(x-scale \cdot angle\right) \cdot \mathsf{PI}\left(\right)} \cdot -180\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Applied rewrites28.6%
Taylor expanded in angle around 0
Applied rewrites40.8%
Applied rewrites40.8%
Final simplification40.8%
a_m = (fabs.f64 a) (FPCore (a_m b angle x-scale y-scale) :precision binary64 (* (/ (atan (* (/ y-scale (* (* (PI) x-scale) angle)) -180.0)) (PI)) 180.0))
\begin{array}{l}
a_m = \left|a\right|
\\
\frac{\tan^{-1} \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -180\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.7%
Taylor expanded in b around inf
Applied rewrites28.3%
Applied rewrites28.6%
Taylor expanded in angle around 0
Applied rewrites40.8%
Final simplification40.8%
herbie shell --seed 2024332
(FPCore (a b angle x-scale y-scale)
:name "raw-angle from scale-rotated-ellipse"
:precision binary64
(* 180.0 (/ (atan (/ (- (- (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale) (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) (PI)))) (cos (* (/ angle 180.0) (PI)))) x-scale) y-scale) 2.0)))) (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) (PI)))) (cos (* (/ angle 180.0) (PI)))) x-scale) y-scale))) (PI))))