
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) (PI)))
(t_1 (cos t_0))
(t_2 (sin t_0))
(t_3
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
(t_5
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
(*
180.0
(/
(atan
(/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
(PI)))))\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}
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle))
(t_1 (cos (* t_0 -0.005555555555555556)))
(t_2 (cbrt (PI))))
(if (<= b_m 2400000000000.0)
(*
(/
(atan
(*
-0.5
(*
(* (/ (sin (* t_0 0.005555555555555556)) t_1) (/ y-scale x-scale))
-2.0)))
(PI))
180.0)
(*
(/
(atan
(*
0.5
(/
(* (/ (* (pow t_1 2.0) y-scale) x-scale) -2.0)
(*
(sin (* (* 0.005555555555555556 angle) (PI)))
(cos (* (* (* (pow t_2 2.0) t_2) angle) -0.005555555555555556))))))
(PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
t_2 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;b\_m \leq 2400000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(\left({t\_2}^{2} \cdot t\_2\right) \cdot angle\right) \cdot -0.005555555555555556\right)}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.4e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.4e12 < b Initial program 11.4%
Taylor expanded in b around inf
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites58.8%
Applied rewrites65.2%
Applied rewrites65.4%
Final simplification57.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (cbrt (PI)))
(t_1 (* (PI) angle))
(t_2 (sin (* t_1 0.005555555555555556))))
(if (<= b_m 2400000000000.0)
(*
(/
(atan
(*
-0.5
(*
(* (/ t_2 (cos (* t_1 -0.005555555555555556))) (/ y-scale x-scale))
-2.0)))
(PI))
180.0)
(*
(/
(atan
(*
(/
(* (/ (* (pow 1.0 2.0) y-scale) x-scale) -2.0)
(*
t_2
(cos (* (* (* (pow t_0 2.0) t_0) angle) -0.005555555555555556))))
0.5))
(PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
t_1 := \mathsf{PI}\left(\right) \cdot angle\\
t_2 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\
\mathbf{if}\;b\_m \leq 2400000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_2}{\cos \left(t\_1 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{1}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot \cos \left(\left(\left({t\_0}^{2} \cdot t\_0\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.4e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.4e12 < b Initial program 11.4%
Taylor expanded in b around inf
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites58.8%
Applied rewrites65.2%
Taylor expanded in angle around 0
Applied rewrites65.3%
Final simplification56.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle))
(t_1 (cos (* t_0 -0.005555555555555556)))
(t_2 (sqrt (PI))))
(if (<= b_m 2400000000000.0)
(*
(/
(atan
(*
-0.5
(*
(* (/ (sin (* t_0 0.005555555555555556)) t_1) (/ y-scale x-scale))
-2.0)))
(PI))
180.0)
(*
(/
(atan
(*
(/
(* (/ (* (pow t_1 2.0) y-scale) x-scale) -2.0)
(* (sin (* (* (* t_2 t_2) angle) 0.005555555555555556)) t_1))
0.5))
(PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
t_2 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;b\_m \leq 2400000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(\left(t\_2 \cdot t\_2\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.4e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.4e12 < b Initial program 11.4%
Taylor expanded in b around inf
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites58.8%
Applied rewrites60.5%
Final simplification55.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle))
(t_1 (sin (* t_0 0.005555555555555556)))
(t_2 (cos (* t_0 -0.005555555555555556))))
(if (<= b_m 2300000000000.0)
(*
(/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
180.0)
(*
(/
(atan
(*
(/
(*
(/
(*
(pow (sin (fma t_0 -0.005555555555555556 (* 0.5 (PI)))) 2.0)
y-scale)
x-scale)
-2.0)
(* t_2 t_1))
0.5))
(PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
\mathbf{if}\;b\_m \leq 2300000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\sin \left(\mathsf{fma}\left(t\_0, -0.005555555555555556, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.3e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.3e12 < b Initial program 11.4%
Taylor expanded in b around inf
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites58.8%
Applied rewrites58.9%
Final simplification55.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle))
(t_1 (sin (* t_0 0.005555555555555556)))
(t_2 (cos (* t_0 -0.005555555555555556))))
(if (<= b_m 2300000000000.0)
(*
(/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
180.0)
(*
(/
(atan
(* (/ (* (/ (* (pow t_2 2.0) y-scale) x-scale) -2.0) (* t_2 t_1)) 0.5))
(PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
\mathbf{if}\;b\_m \leq 2300000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_2}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.3e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.3e12 < b Initial program 11.4%
Taylor expanded in b around inf
Applied rewrites31.8%
Taylor expanded in x-scale around 0
Applied rewrites58.8%
Final simplification55.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle))
(t_1 (sin (* t_0 0.005555555555555556)))
(t_2 (cos (* t_0 -0.005555555555555556))))
(if (<= b_m 2300000000000.0)
(*
(/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
180.0)
(*
(/ (atan (* (* (* (/ t_2 t_1) (/ y-scale x-scale)) 2.0) -0.5)) (PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
\mathbf{if}\;b\_m \leq 2300000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.3e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.3e12 < b Initial program 11.4%
Taylor expanded in x-scale around 0
Applied rewrites22.6%
Taylor expanded in a around 0
Applied rewrites58.8%
Final simplification55.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (PI) angle)))
(if (<= b_m 2400000000000.0)
(*
(/
(atan
(*
-0.5
(*
(*
(/
(sin (* t_0 0.005555555555555556))
(cos (* t_0 -0.005555555555555556)))
(/ y-scale x-scale))
-2.0)))
(PI))
180.0)
(*
(/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
180.0))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
\mathbf{if}\;b\_m \leq 2400000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{\cos \left(t\_0 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.4e12Initial program 14.6%
Taylor expanded in x-scale around 0
Applied rewrites26.7%
Taylor expanded in a around inf
Applied rewrites54.2%
if 2.4e12 < b Initial program 11.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites14.4%
Taylor expanded in a around inf
Applied rewrites21.7%
Taylor expanded in a around 0
Applied rewrites58.3%
Final simplification55.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= a 0.55)
(*
(/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
180.0)
(*
(/
(atan
(*
(*
(* (/ y-scale (* (- b_m a) (PI))) (* (/ b_m (* x-scale x-scale)) -2.0))
(/ x-scale angle))
90.0))
(PI))
180.0)))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 0.55:\\
\;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{\left(b\_m - a\right) \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{b\_m}{x-scale \cdot x-scale} \cdot -2\right)\right) \cdot \frac{x-scale}{angle}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if a < 0.55000000000000004Initial program 15.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.1%
Taylor expanded in a around inf
Applied rewrites13.5%
Taylor expanded in a around 0
Applied rewrites40.0%
if 0.55000000000000004 < a Initial program 7.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.1%
Applied rewrites24.7%
Taylor expanded in a around 0
Applied rewrites40.0%
Final simplification40.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
:precision binary64
(if (<= b_m 2.02e+108)
(*
(/
(atan
(*
(/
(* (* (* b_m b_m) y-scale) 360.0)
(* (* (* (+ a b_m) (PI)) (- b_m a)) (* x-scale angle)))
-0.5))
(PI))
180.0)
(*
(/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
180.0)))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.02 \cdot 10^{+108}:\\
\;\;\;\;\frac{\tan^{-1} \left(\frac{\left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right) \cdot 360}{\left(\left(\left(a + b\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
\end{array}
\end{array}
if b < 2.02000000000000007e108Initial program 15.5%
Taylor expanded in x-scale around 0
Applied rewrites28.7%
Taylor expanded in angle around 0
Applied rewrites28.3%
if 2.02000000000000007e108 < b Initial program 6.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites8.6%
Taylor expanded in a around inf
Applied rewrites25.4%
Taylor expanded in a around 0
Applied rewrites60.5%
Final simplification34.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI)) 180.0))
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.1%
Taylor expanded in a around inf
Applied rewrites12.0%
Taylor expanded in a around 0
Applied rewrites38.2%
Final simplification38.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle x-scale y-scale) :precision binary64 (* (/ (atan (* (* (/ x-scale (* (* (PI) y-scale) angle)) -2.0) 90.0)) (PI)) 180.0))
\begin{array}{l}
b_m = \left|b\right|
\\
\frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(\mathsf{PI}\left(\right) \cdot y-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180
\end{array}
Initial program 13.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.1%
Taylor expanded in a around inf
Applied rewrites12.0%
Taylor expanded in a around inf
Applied rewrites12.1%
Final simplification12.1%
herbie shell --seed 2024312
(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))))