
(FPCore (a b) :precision binary64 (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
\begin{array}{l}
\\
\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
\begin{array}{l}
\\
\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= b 2.5e+77) (/ (* (* (/ (- b a) a) (PI)) (/ 0.5 (- b a))) (* (+ a b) b)) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.5 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(\frac{b - a}{a} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{0.5}{b - a}}{\left(a + b\right) \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if b < 2.50000000000000002e77Initial program 78.7%
Applied rewrites84.2%
Applied rewrites90.1%
if 2.50000000000000002e77 < b Initial program 59.3%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites70.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6499.8
Applied rewrites99.8%
Final simplification92.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (* (/ (/ 0.5 (- b a)) (* a b)) (/ (- b a) (/ (+ a b) (PI)))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\frac{\frac{0.5}{b - a}}{a \cdot b} \cdot \frac{b - a}{\frac{a + b}{\mathsf{PI}\left(\right)}}
\end{array}
Initial program 74.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites83.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Final simplification99.5%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= b 2.5e+77) (/ (* (* (/ (- b a) a) (PI)) 0.5) (* (* (+ a b) b) (- b a))) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.5 \cdot 10^{+77}:\\
\;\;\;\;\frac{\left(\frac{b - a}{a} \cdot \mathsf{PI}\left(\right)\right) \cdot 0.5}{\left(\left(a + b\right) \cdot b\right) \cdot \left(b - a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if b < 2.50000000000000002e77Initial program 78.7%
Applied rewrites84.2%
Applied rewrites85.4%
if 2.50000000000000002e77 < b Initial program 59.3%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites70.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6499.8
Applied rewrites99.8%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= b 2.8e+77) (/ 0.5 (* (/ (* (* (+ a b) b) a) (* (PI) (- b a))) (- b a))) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{+77}:\\
\;\;\;\;\frac{0.5}{\frac{\left(\left(a + b\right) \cdot b\right) \cdot a}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)} \cdot \left(b - a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if b < 2.8e77Initial program 78.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6498.9
Applied rewrites98.9%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites94.7%
if 2.8e77 < b Initial program 59.3%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites70.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6499.8
Applied rewrites99.8%
Final simplification95.9%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (* (/ (- b a) (* (* a b) (/ (+ a b) (PI)))) (/ 0.5 (- b a))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\frac{b - a}{\left(a \cdot b\right) \cdot \frac{a + b}{\mathsf{PI}\left(\right)}} \cdot \frac{0.5}{b - a}
\end{array}
Initial program 74.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites83.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Final simplification98.7%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -1.42e-49) (* (* (/ (PI) (+ a b)) (/ -1.0 b)) (/ 0.5 (- b a))) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{-49}:\\
\;\;\;\;\left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{-1}{b}\right) \cdot \frac{0.5}{b - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if a < -1.42e-49Initial program 70.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.6%
Taylor expanded in a around inf
Applied rewrites92.7%
if -1.42e-49 < a Initial program 75.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites80.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6477.0
Applied rewrites77.0%
Final simplification81.7%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -1.42e-49) (* (/ (/ (- (PI)) a) b) (/ 0.5 (- b a))) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{-\mathsf{PI}\left(\right)}{a}}{b} \cdot \frac{0.5}{b - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if a < -1.42e-49Initial program 70.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.6%
Taylor expanded in a around inf
mul-1-negN/A
associate-/r*N/A
distribute-neg-fracN/A
mul-1-negN/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-PI.f6492.6
Applied rewrites92.6%
if -1.42e-49 < a Initial program 75.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites80.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6477.0
Applied rewrites77.0%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -1.42e-49) (* (/ (- (PI)) (* a b)) (/ 0.5 (- b a))) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{-49}:\\
\;\;\;\;\frac{-\mathsf{PI}\left(\right)}{a \cdot b} \cdot \frac{0.5}{b - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if a < -1.42e-49Initial program 70.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.6%
Taylor expanded in a around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-PI.f6451.7
Applied rewrites51.7%
Taylor expanded in a around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-PI.f64N/A
lower-*.f6492.5
Applied rewrites92.5%
if -1.42e-49 < a Initial program 75.8%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites80.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6477.0
Applied rewrites77.0%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= b 1.92e-147) (/ (/ (* 0.5 (PI)) (* a b)) a) (* (PI) (/ (/ 0.5 (- b a)) (* a b)))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.92 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{\frac{0.5}{b - a}}{a \cdot b}\\
\end{array}
\end{array}
if b < 1.9200000000000001e-147Initial program 75.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.5
Applied rewrites57.5%
Applied rewrites57.4%
Applied rewrites70.4%
Applied rewrites71.2%
if 1.9200000000000001e-147 < b Initial program 71.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.6%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6498.6
Applied rewrites98.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in a around 0
lower-PI.f6490.4
Applied rewrites90.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= b 1.92e-147) (/ (/ (* 0.5 (PI)) (* a b)) a) (* (/ (PI) (* a b)) (/ 0.5 (- b a)))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.92 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot b} \cdot \frac{0.5}{b - a}\\
\end{array}
\end{array}
if b < 1.9200000000000001e-147Initial program 75.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.5
Applied rewrites57.5%
Applied rewrites57.4%
Applied rewrites70.4%
Applied rewrites71.2%
if 1.9200000000000001e-147 < b Initial program 71.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.6%
Taylor expanded in a around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-PI.f6490.4
Applied rewrites90.4%
Taylor expanded in a around 0
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f6490.3
Applied rewrites90.3%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (/ (* (/ (PI) a) 0.5) (* a b)) (/ (* (/ (PI) b) 0.5) (* a b))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites75.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6487.1
Applied rewrites87.1%
if -6e-15 < a Initial program 76.3%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6477.4
Applied rewrites77.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (/ (* (/ (PI) a) 0.5) (* a b)) (/ 0.5 (* (* (/ b (PI)) b) a))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\left(\frac{b}{\mathsf{PI}\left(\right)} \cdot b\right) \cdot a}\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites75.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6487.1
Applied rewrites87.1%
if -6e-15 < a Initial program 76.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites85.3%
Taylor expanded in a around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6464.1
Applied rewrites64.1%
Final simplification70.8%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (/ (/ (* 0.5 (PI)) (* a b)) a) (/ 0.5 (* (* (/ b (PI)) b) a))))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\left(\frac{b}{\mathsf{PI}\left(\right)} \cdot b\right) \cdot a}\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.8
Applied rewrites62.8%
Applied rewrites62.7%
Applied rewrites85.4%
Applied rewrites87.0%
if -6e-15 < a Initial program 76.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-/.f64N/A
div-invN/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
times-fracN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites85.3%
Taylor expanded in a around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6464.1
Applied rewrites64.1%
Final simplification70.7%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (/ (/ (* 0.5 (PI)) (* a b)) a) (* (/ (PI) (* (* b b) a)) 0.5)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.8
Applied rewrites62.8%
Applied rewrites62.7%
Applied rewrites85.4%
Applied rewrites87.0%
if -6e-15 < a Initial program 76.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.7
Applied rewrites63.7%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (* (/ 0.5 (* a b)) (/ (PI) a)) (* (/ (PI) (* (* b b) a)) 0.5)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.8
Applied rewrites62.8%
Applied rewrites87.0%
if -6e-15 < a Initial program 76.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.7
Applied rewrites63.7%
Final simplification70.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (* (/ (/ 0.5 a) (* a b)) (PI)) (* (/ (PI) (* (* b b) a)) 0.5)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{0.5}{a}}{a \cdot b} \cdot \mathsf{PI}\left(\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.8
Applied rewrites62.8%
Applied rewrites62.7%
Applied rewrites86.9%
if -6e-15 < a Initial program 76.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.7
Applied rewrites63.7%
Final simplification70.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -6e-15) (* (/ (PI) (* (* a b) a)) 0.5) (* (/ (PI) (* (* b b) a)) 0.5)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-15}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
\end{array}
\end{array}
if a < -6e-15Initial program 68.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.8
Applied rewrites62.8%
Applied rewrites85.4%
if -6e-15 < a Initial program 76.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.7
Applied rewrites63.7%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (* (/ (PI) (* (* a b) a)) 0.5))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5
\end{array}
Initial program 74.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
Applied rewrites58.0%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* a b) a)) (PI)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\frac{0.5}{\left(a \cdot b\right) \cdot a} \cdot \mathsf{PI}\left(\right)
\end{array}
Initial program 74.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
Applied rewrites49.2%
Applied rewrites58.0%
Final simplification58.0%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* a a) b)) (PI)))
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right)
\end{array}
Initial program 74.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
Applied rewrites49.2%
Final simplification49.2%
herbie shell --seed 2024327
(FPCore (a b)
:name "NMSE Section 6.1 mentioned, B"
:precision binary64
(* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))