
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 1.4e+252)
(*
(cos (* (/ angle 180.0) (PI)))
(/
(* (* (- a b_m) 2.0) (sin (* angle (* 0.005555555555555556 (PI)))))
(/ -1.0 (+ a b_m))))
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+252}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{\left(\left(a - b\_m\right) \cdot 2\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right)\right)}{\frac{-1}{a + b\_m}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 1.40000000000000002e252Initial program 52.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6466.7
Applied rewrites67.5%
lift-+.f64N/A
+-commutativeN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lower-fma.f6431.2
Applied rewrites31.2%
Applied rewrites67.7%
if 1.40000000000000002e252 < b Initial program 20.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6490.9
Applied rewrites90.9%
Applied rewrites100.0%
Final simplification69.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 4.8e+238)
(*
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m))
(cos (* (/ angle 180.0) (PI))))
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 4.8 \cdot 10^{+238}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 4.8e238Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.0
Applied rewrites67.3%
if 4.8e238 < b Initial program 18.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6483.4
Applied rewrites83.4%
Applied rewrites94.1%
Final simplification69.1%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 1e+244)
(*
(cos (* (* angle (PI)) 0.005555555555555556))
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m)))
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 10^{+244}:\\
\;\;\;\;\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 1.00000000000000007e244Initial program 53.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.1
Applied rewrites67.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6466.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.8
Applied rewrites66.8%
if 1.00000000000000007e244 < b Initial program 16.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6493.0
Applied rewrites93.0%
Applied rewrites100.0%
Final simplification68.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (* angle 0.005555555555555556) (PI))))
(if (<= b_m 4.8e+238)
(* (* (cos t_0) (+ a b_m)) (* (* (sin t_0) (- b_m a)) 2.0))
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;b\_m \leq 4.8 \cdot 10^{+238}:\\
\;\;\;\;\left(\cos t\_0 \cdot \left(a + b\_m\right)\right) \cdot \left(\left(\sin t\_0 \cdot \left(b\_m - a\right)\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 4.8e238Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.0
Applied rewrites67.3%
lift-+.f64N/A
+-commutativeN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lower-fma.f6430.0
Applied rewrites30.0%
Applied rewrites67.2%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
associate-*l*N/A
lift-neg.f64N/A
metadata-evalN/A
frac-2negN/A
/-rgt-identityN/A
Applied rewrites66.3%
if 4.8e238 < b Initial program 18.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6483.4
Applied rewrites83.4%
Applied rewrites94.1%
Final simplification68.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -2e+119) (* (* (* (PI) a) angle) (* -0.011111111111111112 a)) (* (* (* (+ a b_m) (- b_m a)) 0.011111111111111112) (* angle (PI)))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -2 \cdot 10^{+119}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot 0.011111111111111112\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.99999999999999989e119Initial program 53.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6439.4
Applied rewrites39.4%
Taylor expanded in b around 0
Applied rewrites39.4%
Applied rewrites54.2%
Applied rewrites54.3%
if -1.99999999999999989e119 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.2
Applied rewrites55.2%
Applied rewrites55.2%
Final simplification55.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -2e+119) (* (* (* (PI) a) angle) (* -0.011111111111111112 a)) (* (* (+ a b_m) (- b_m a)) (* (* 0.011111111111111112 (PI)) angle))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -2 \cdot 10^{+119}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.99999999999999989e119Initial program 53.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6439.4
Applied rewrites39.4%
Taylor expanded in b around 0
Applied rewrites39.4%
Applied rewrites54.2%
Applied rewrites54.3%
if -1.99999999999999989e119 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.2
Applied rewrites55.2%
Final simplification55.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e-208) (* (* (* (PI) a) angle) (* -0.011111111111111112 a)) (* (fma 0.011111111111111112 (* angle (PI)) 0.0) (* b_m b_m))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{-208}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.011111111111111112, angle \cdot \mathsf{PI}\left(\right), 0\right) \cdot \left(b\_m \cdot b\_m\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999963e-208Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6443.7
Applied rewrites43.7%
Taylor expanded in b around 0
Applied rewrites43.3%
Applied rewrites52.7%
Applied rewrites52.8%
if -4.99999999999999963e-208 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 49.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.1
Applied rewrites56.1%
Taylor expanded in b around 0
Applied rewrites21.7%
Applied rewrites21.5%
Taylor expanded in b around inf
Applied rewrites52.9%
Final simplification52.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e-208) (* (* (* (PI) a) angle) (* -0.011111111111111112 a)) (* (* (* (* b_m b_m) (PI)) angle) 0.011111111111111112)))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{-208}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b\_m \cdot b\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999963e-208Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6443.7
Applied rewrites43.7%
Taylor expanded in b around 0
Applied rewrites43.3%
Applied rewrites52.7%
Applied rewrites52.8%
if -4.99999999999999963e-208 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 49.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.1
Applied rewrites56.1%
Taylor expanded in b around inf
Applied rewrites52.8%
Final simplification52.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 5e-301) (* (* b_m b_m) (sin (* (* angle (PI)) 0.011111111111111112))) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{-301}:\\
\;\;\;\;\left(b\_m \cdot b\_m\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5.00000000000000013e-301Initial program 67.1%
Applied rewrites10.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6466.3
Applied rewrites66.3%
if 5.00000000000000013e-301 < (pow.f64 a #s(literal 2 binary64)) Initial program 45.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6447.9
Applied rewrites47.9%
Applied rewrites59.8%
Final simplification61.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (/ angle 180.0) 5e-37) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m)) (* (* (+ a b_m) (- b_m a)) (sin (* (* angle (PI)) 0.011111111111111112)))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-37}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999997e-37Initial program 58.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.5
Applied rewrites59.5%
Applied rewrites71.7%
if 4.9999999999999997e-37 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites42.9%
Final simplification62.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= b_m 5e+238) (* (* (sin (* (* angle (PI)) 0.011111111111111112)) (- b_m a)) (+ a b_m)) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 5 \cdot 10^{+238}:\\
\;\;\;\;\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 4.99999999999999995e238Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.2%
if 4.99999999999999995e238 < b Initial program 18.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6483.4
Applied rewrites83.4%
Applied rewrites94.1%
Final simplification68.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= b_m 1.65e-127) (* (* (- a) a) (sin (* (* angle (PI)) 0.011111111111111112))) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.65 \cdot 10^{-127}:\\
\;\;\;\;\left(\left(-a\right) \cdot a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 1.6499999999999999e-127Initial program 56.5%
Applied rewrites8.8%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6442.2
Applied rewrites42.2%
if 1.6499999999999999e-127 < b Initial program 41.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.1
Applied rewrites49.1%
Applied rewrites57.9%
Final simplification47.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)
\end{array}
Initial program 51.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Applied rewrites59.4%
Final simplification59.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* (PI) a) angle) (* -0.011111111111111112 a)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\right)
\end{array}
Initial program 51.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites30.1%
Applied rewrites33.6%
Applied rewrites33.6%
Final simplification33.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* angle a) (PI)) (* -0.011111111111111112 a)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(-0.011111111111111112 \cdot a\right)
\end{array}
Initial program 51.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites30.1%
Applied rewrites33.6%
Applied rewrites33.6%
Final simplification33.6%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* angle (PI)) a) (* -0.011111111111111112 a)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)
\end{array}
Initial program 51.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites30.1%
Applied rewrites33.6%
Final simplification33.6%
herbie shell --seed 2024273
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (PI) (/ angle 180.0)))) (cos (* (PI) (/ angle 180.0)))))