
(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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (pow (cbrt (sqrt (PI))) 3.0))
(t_1
(*
(* (* (sin (* (PI) (* angle 0.005555555555555556))) 2.0) (- b a))
(+ b a))))
(if (<= (pow a 2.0) 2e-267)
(* (cos (* (/ angle 180.0) (* t_0 t_0))) t_1)
(* (cos (/ 1.0 (/ (/ 180.0 angle) (PI)))) t_1))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\\
t_1 := \left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{-267}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}}\right) \cdot t\_1\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 2e-267Initial program 62.0%
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-*.f6469.5
Applied rewrites69.7%
rem-cube-cbrtN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6475.5
Applied rewrites75.5%
if 2e-267 < (pow.f64 a #s(literal 2 binary64)) Initial program 47.6%
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-*.f6461.9
Applied rewrites61.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6466.6
Applied rewrites66.6%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6467.7
Applied rewrites67.7%
Final simplification69.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) (PI)))
(t_1 (* (* (sin t_0) (* (- (pow b 2.0) (pow a 2.0)) 2.0)) (cos t_0)))
(t_2 (* (* 0.011111111111111112 (PI)) angle))
(t_3 (* (* t_2 (- b a)) (+ b a))))
(if (<= t_1 -4e+280)
t_3
(if (<= t_1 4e+304) (* (* (- b a) (+ b a)) (sin t_2)) t_3))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := \left(\sin t\_0 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot 2\right)\right) \cdot \cos t\_0\\
t_2 := \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\\
t_3 := \left(t\_2 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+280}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -4.0000000000000001e280 or 3.9999999999999998e304 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 40.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--.f6450.1
Applied rewrites50.1%
Applied rewrites74.3%
if -4.0000000000000001e280 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 3.9999999999999998e304Initial program 59.6%
Applied rewrites12.5%
Applied rewrites60.0%
Final simplification65.8%
(FPCore (a b angle)
:precision binary64
(if (<= (- (pow b 2.0) (pow a 2.0)) 4e+304)
(*
(cos (* (* (PI) 0.005555555555555556) angle))
(*
(* (* (sin (* (PI) (* angle 0.005555555555555556))) 2.0) (- b a))
(+ b a)))
(*
(* (* 0.011111111111111112 (* (* (PI) (- b a)) angle)) (+ b a))
(cos (* (/ angle 180.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.011111111111111112 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right) \cdot angle\right)\right) \cdot \left(b + a\right)\right) \cdot \cos \left(\frac{angle}{180} \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))) < 3.9999999999999998e304Initial program 57.0%
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-*.f6461.3
Applied rewrites61.2%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6462.8
Applied rewrites62.8%
if 3.9999999999999998e304 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 33.4%
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-*.f6473.5
Applied rewrites73.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-PI.f6487.6
Applied rewrites87.6%
Final simplification68.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(if (<= (pow a 2.0) 1e-314)
(*
(cos (* (/ angle 180.0) (PI)))
(*
(* (* (sin (* (* t_0 t_0) (* angle 0.005555555555555556))) 2.0) (- b a))
(+ b a)))
(*
(cos (/ 1.0 (/ (/ 180.0 angle) (PI))))
(*
(* (* (sin (* (PI) (* angle 0.005555555555555556))) 2.0) (- b a))
(+ b a))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;{a}^{2} \leq 10^{-314}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(\left(\sin \left(\left(t\_0 \cdot t\_0\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}}\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 9.9999999996e-315Initial program 62.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-*.f6470.8
Applied rewrites70.7%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6476.8
Applied rewrites76.8%
if 9.9999999996e-315 < (pow.f64 a #s(literal 2 binary64)) Initial program 48.2%
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-*.f6461.8
Applied rewrites61.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6467.4
Applied rewrites67.4%
Final simplification69.8%
(FPCore (a b angle) :precision binary64 (* (cos (/ 1.0 (/ (/ 180.0 angle) (PI)))) (* (* (* (sin (* (PI) (* angle 0.005555555555555556))) 2.0) (- b a)) (+ b a))))
\begin{array}{l}
\\
\cos \left(\frac{1}{\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}}\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)
\end{array}
Initial program 51.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-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6468.0
Applied rewrites68.0%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6468.2
Applied rewrites68.2%
Final simplification68.2%
(FPCore (a b angle) :precision binary64 (* (cos (/ (PI) (/ 180.0 angle))) (* (* (* (sin (* (PI) (* angle 0.005555555555555556))) 2.0) (- b a)) (+ b a))))
\begin{array}{l}
\\
\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)
\end{array}
Initial program 51.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-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6468.0
Applied rewrites68.0%
Final simplification68.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) angle)))
(if (<= (- (pow b 2.0) (pow a 2.0)) -1e-26)
(* (* t_0 a) (* -0.011111111111111112 a))
(* (* (* (- b a) (+ b a)) 0.011111111111111112) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-26}:\\
\;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot 0.011111111111111112\right) \cdot t\_0\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-26Initial program 53.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--.f6450.2
Applied rewrites50.2%
Taylor expanded in b around 0
Applied rewrites50.2%
Applied rewrites59.7%
if -1e-26 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.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--.f6453.0
Applied rewrites53.0%
Applied rewrites53.5%
Final simplification55.7%
(FPCore (a b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a 2.0)) -1e+87) (* (* (* (PI) angle) a) (* -0.011111111111111112 a)) (* (* (- b a) (+ b a)) (* (* 0.011111111111111112 (PI)) angle))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{+87}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + 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))) < -9.9999999999999996e86Initial program 54.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--.f6452.3
Applied rewrites52.3%
Taylor expanded in b around 0
Applied rewrites52.3%
Applied rewrites64.3%
if -9.9999999999999996e86 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.5%
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.9
Applied rewrites51.9%
Final simplification55.3%
(FPCore (a b angle) :precision binary64 (if (<= (pow b 2.0) 5e+184) (* (* (sin (* (* (PI) angle) 0.011111111111111112)) (- b a)) (+ b a)) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b a)) (+ b a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{+184}:\\
\;\;\;\;\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 4.9999999999999999e184Initial program 57.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 rewrites62.5%
if 4.9999999999999999e184 < (pow.f64 b #s(literal 2 binary64)) Initial program 40.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--.f6451.7
Applied rewrites51.7%
Applied rewrites72.2%
Final simplification65.9%
(FPCore (a b angle) :precision binary64 (if (<= (pow b 2.0) 1e+49) (* (* (- b a) (+ b a)) (sin (* (* (PI) angle) 0.011111111111111112))) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b a)) (+ b a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{+49}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 9.99999999999999946e48Initial program 60.5%
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 rewrites61.1%
if 9.99999999999999946e48 < (pow.f64 b #s(literal 2 binary64)) Initial program 41.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--.f6448.7
Applied rewrites48.7%
Applied rewrites67.7%
Final simplification64.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) angle)))
(if (<= (- (pow b 2.0) (pow a 2.0)) -5e-133)
(* (* t_0 a) (* -0.011111111111111112 a))
(* (* b b) (fma 0.011111111111111112 t_0 0.0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{-133}:\\
\;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.011111111111111112, t\_0, 0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.9999999999999999e-133Initial program 53.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--.f6450.4
Applied rewrites50.4%
Taylor expanded in b around 0
Applied rewrites50.3%
Applied rewrites58.9%
if -4.9999999999999999e-133 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.5%
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--.f6453.1
Applied rewrites53.1%
Taylor expanded in b around 0
Applied rewrites23.7%
Taylor expanded in b around inf
Applied rewrites52.2%
Final simplification54.8%
(FPCore (a b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a 2.0)) -5e-133) (* (* (* (PI) angle) a) (* -0.011111111111111112 a)) (* (* (* (* b b) (PI)) angle) 0.011111111111111112)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{-133}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b \cdot b\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.9999999999999999e-133Initial program 53.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--.f6450.4
Applied rewrites50.4%
Taylor expanded in b around 0
Applied rewrites50.3%
Applied rewrites58.9%
if -4.9999999999999999e-133 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.5%
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--.f6453.1
Applied rewrites53.1%
Taylor expanded in b around inf
Applied rewrites52.2%
Final simplification54.8%
(FPCore (a b angle) :precision binary64 (if (<= (pow b 2.0) 1e-302) (* (* (- a) a) (sin (* (* (PI) angle) 0.011111111111111112))) (* (* (* (* 0.011111111111111112 (PI)) angle) (- b a)) (+ b a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{-302}:\\
\;\;\;\;\left(\left(-a\right) \cdot a\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 9.9999999999999996e-303Initial program 64.2%
Applied rewrites6.7%
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.f6466.4
Applied rewrites66.4%
if 9.9999999999999996e-303 < (pow.f64 b #s(literal 2 binary64)) Initial program 47.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--.f6449.8
Applied rewrites49.8%
Applied rewrites62.1%
Final simplification63.2%
(FPCore (a b angle)
:precision binary64
(if (<= b 6.2e+127)
(* (* (sin (* (* (PI) angle) 0.011111111111111112)) (- b a)) (+ b a))
(*
(* (* 0.011111111111111112 (* (* (PI) (- b a)) angle)) (+ b a))
(cos (* (/ angle 180.0) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.2 \cdot 10^{+127}:\\
\;\;\;\;\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.011111111111111112 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right) \cdot angle\right)\right) \cdot \left(b + a\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if b < 6.2000000000000005e127Initial program 53.5%
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 rewrites63.0%
if 6.2000000000000005e127 < b Initial program 40.1%
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-*.f6471.0
Applied rewrites71.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-PI.f6476.7
Applied rewrites76.7%
Final simplification64.8%
(FPCore (a b angle) :precision binary64 (* (* (* (* 0.011111111111111112 (PI)) angle) (- b a)) (+ b a)))
\begin{array}{l}
\\
\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)
\end{array}
Initial program 51.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--.f6452.0
Applied rewrites52.0%
Applied rewrites61.1%
Final simplification61.1%
(FPCore (a b angle) :precision binary64 (* (* (* (PI) angle) a) (* -0.011111111111111112 a)))
\begin{array}{l}
\\
\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)
\end{array}
Initial program 51.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--.f6452.0
Applied rewrites52.0%
Taylor expanded in b around 0
Applied rewrites34.0%
Applied rewrites37.2%
Final simplification37.2%
herbie shell --seed 2024264
(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)))))