
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)) (t_1 (+ t_0 7.0)) (t_2 (+ t_1 0.5)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(* (* (sqrt (* (PI) 2.0)) (pow t_2 (+ t_0 0.5))) (exp (- t_2)))
(+
(+
(+
(+
(+
(+
(+
(+ 0.9999999999998099 (/ 676.5203681218851 (+ t_0 1.0)))
(/ -1259.1392167224028 (+ t_0 2.0)))
(/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 t_1))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
t_1 := t\_0 + 7\\
t_2 := t\_1 + 0.5\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot 2} \cdot {t\_2}^{\left(t\_0 + 0.5\right)}\right) \cdot e^{-t\_2}\right) \cdot \left(\left(\left(\left(\left(\left(\left(\left(0.9999999999998099 + \frac{676.5203681218851}{t\_0 + 1}\right) + \frac{-1259.1392167224028}{t\_0 + 2}\right) + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_1}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)) (t_1 (+ t_0 7.0)) (t_2 (+ t_1 0.5)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(* (* (sqrt (* (PI) 2.0)) (pow t_2 (+ t_0 0.5))) (exp (- t_2)))
(+
(+
(+
(+
(+
(+
(+
(+ 0.9999999999998099 (/ 676.5203681218851 (+ t_0 1.0)))
(/ -1259.1392167224028 (+ t_0 2.0)))
(/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 t_1))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
t_1 := t\_0 + 7\\
t_2 := t\_1 + 0.5\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot 2} \cdot {t\_2}^{\left(t\_0 + 0.5\right)}\right) \cdot e^{-t\_2}\right) \cdot \left(\left(\left(\left(\left(\left(\left(\left(0.9999999999998099 + \frac{676.5203681218851}{t\_0 + 1}\right) + \frac{-1259.1392167224028}{t\_0 + 2}\right) + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_1}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
(FPCore (z)
:precision binary64
(let* ((t_0 (/ (PI) (sin (* (PI) z))))
(t_1 (/ 676.5203681218851 (- 1.0 z)))
(t_2 (- (- 1.0 z) 1.0))
(t_3 (/ 12.507343278686905 (+ t_2 5.0)))
(t_4 (/ -0.13857109526572012 (+ t_2 6.0)))
(t_5 (/ 771.3234287776531 (+ t_2 3.0)))
(t_6 (/ -176.6150291621406 (+ t_2 4.0)))
(t_7 (/ 1.5056327351493116e-7 (+ t_2 8.0))))
(if (<= z -31.5)
(*
t_0
(*
(exp
(fma
(log (* (PI) 2.0))
0.5
(fma (log (- (- 1.0 z) -6.5)) (- (- 1.0 z) 0.5) (+ (+ -1.0 z) -6.5))))
(+
(+
(+
(+
(+
(+
(+
(+ (/ -1259.1392167224028 (- 3.0 (+ z 1.0))) t_1)
0.9999999999998099)
t_5)
t_6)
t_3)
t_4)
(/ 9.984369578019572e-6 (- 7.0 z)))
t_7)))
(*
t_0
(*
(*
(* (* (exp (+ -7.5 z)) (sqrt (PI))) (sqrt 2.0))
(pow (- 7.5 z) (- 0.5 z)))
(+
(+
(+
(+
(+
(+
(+
(+ (/ -1259.1392167224028 (- (- 1.0 z) -1.0)) t_1)
0.9999999999998099)
t_5)
t_6)
t_3)
t_4)
(/ 9.984369578019572e-6 (+ t_2 7.0)))
t_7))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)}\\
t_1 := \frac{676.5203681218851}{1 - z}\\
t_2 := \left(1 - z\right) - 1\\
t_3 := \frac{12.507343278686905}{t\_2 + 5}\\
t_4 := \frac{-0.13857109526572012}{t\_2 + 6}\\
t_5 := \frac{771.3234287776531}{t\_2 + 3}\\
t_6 := \frac{-176.6150291621406}{t\_2 + 4}\\
t_7 := \frac{1.5056327351493116 \cdot 10^{-7}}{t\_2 + 8}\\
\mathbf{if}\;z \leq -31.5:\\
\;\;\;\;t\_0 \cdot \left(e^{\mathsf{fma}\left(\log \left(\mathsf{PI}\left(\right) \cdot 2\right), 0.5, \mathsf{fma}\left(\log \left(\left(1 - z\right) - -6.5\right), \left(1 - z\right) - 0.5, \left(-1 + z\right) + -6.5\right)\right)} \cdot \left(\left(\left(\left(\left(\left(\left(\left(\frac{-1259.1392167224028}{3 - \left(z + 1\right)} + t\_1\right) + 0.9999999999998099\right) + t\_5\right) + t\_6\right) + t\_3\right) + t\_4\right) + \frac{9.984369578019572 \cdot 10^{-6}}{7 - z}\right) + t\_7\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\left(e^{-7.5 + z} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{2}\right) \cdot {\left(7.5 - z\right)}^{\left(0.5 - z\right)}\right) \cdot \left(\left(\left(\left(\left(\left(\left(\left(\frac{-1259.1392167224028}{\left(1 - z\right) - -1} + t\_1\right) + 0.9999999999998099\right) + t\_5\right) + t\_6\right) + t\_3\right) + t\_4\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_2 + 7}\right) + t\_7\right)\right)\\
\end{array}
\end{array}
if z < -31.5Initial program 17.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
lift-exp.f64N/A
prod-expN/A
Applied rewrites98.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
metadata-evalN/A
--rgt-identity98.7
lift--.f64N/A
flip3--N/A
lower-/.f64N/A
metadata-evalN/A
lower--.f64N/A
lower-pow.f64N/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
*-lft-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in z around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64100.0
Applied rewrites100.0%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.0%
if -31.5 < z Initial program 97.3%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites98.5%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.3%
Final simplification99.3%
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(exp
(fma
(log (* (PI) 2.0))
0.5
(fma (log (- (- 1.0 z) -6.5)) (- (- 1.0 z) 0.5) (+ (+ -1.0 z) -6.5))))
(+
(+
(+
(+
(+
(+
(+
(+
0.9999999999998099
(/ 676.5203681218851 (/ (- 1.0 (pow z 3.0)) (+ (fma z z z) 1.0))))
(/ -1259.1392167224028 (+ t_0 2.0)))
(/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (- 5.0 z)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 (- 7.0 z)))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(e^{\mathsf{fma}\left(\log \left(\mathsf{PI}\left(\right) \cdot 2\right), 0.5, \mathsf{fma}\left(\log \left(\left(1 - z\right) - -6.5\right), \left(1 - z\right) - 0.5, \left(-1 + z\right) + -6.5\right)\right)} \cdot \left(\left(\left(\left(\left(\left(\left(\left(0.9999999999998099 + \frac{676.5203681218851}{\frac{1 - {z}^{3}}{\mathsf{fma}\left(z, z, z\right) + 1}}\right) + \frac{-1259.1392167224028}{t\_0 + 2}\right) + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{5 - z}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{7 - z}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
lift-exp.f64N/A
prod-expN/A
Applied rewrites97.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
metadata-evalN/A
--rgt-identity97.8
lift--.f64N/A
flip3--N/A
lower-/.f64N/A
metadata-evalN/A
lower--.f64N/A
lower-pow.f64N/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
*-lft-identityN/A
lower-fma.f6497.9
Applied rewrites97.9%
Taylor expanded in z around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6497.9
Applied rewrites97.9%
Taylor expanded in z around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6497.9
Applied rewrites97.9%
Final simplification97.9%
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(exp
(fma
(log (* (PI) 2.0))
0.5
(fma (log (- (- 1.0 z) -6.5)) (- (- 1.0 z) 0.5) (+ (+ -1.0 z) -6.5))))
(+
(+
(+
(+
(+
(+
(+
(/ 676.5203681218851 (- 1.0 z))
(+ 0.9999999999998099 (/ -1259.1392167224028 (- 3.0 (+ z 1.0)))))
(/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 (- 7.0 z)))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(e^{\mathsf{fma}\left(\log \left(\mathsf{PI}\left(\right) \cdot 2\right), 0.5, \mathsf{fma}\left(\log \left(\left(1 - z\right) - -6.5\right), \left(1 - z\right) - 0.5, \left(-1 + z\right) + -6.5\right)\right)} \cdot \left(\left(\left(\left(\left(\left(\left(\frac{676.5203681218851}{1 - z} + \left(0.9999999999998099 + \frac{-1259.1392167224028}{3 - \left(z + 1\right)}\right)\right) + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{7 - z}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
lift-exp.f64N/A
prod-expN/A
Applied rewrites97.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
metadata-evalN/A
--rgt-identity97.8
lift--.f64N/A
flip3--N/A
lower-/.f64N/A
metadata-evalN/A
lower--.f64N/A
lower-pow.f64N/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
*-lft-identityN/A
lower-fma.f6497.9
Applied rewrites97.9%
Taylor expanded in z around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6497.9
Applied rewrites97.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
Applied rewrites97.8%
Final simplification97.8%
(FPCore (z)
:precision binary64
(let* ((t_0 (pow (- 7.5 z) (- 0.5 z)))
(t_1 (sqrt (PI)))
(t_2 (- (- 1.0 z) 1.0))
(t_3 (/ 12.507343278686905 (+ t_2 5.0)))
(t_4 (/ -0.13857109526572012 (+ t_2 6.0)))
(t_5 (/ 771.3234287776531 (+ t_2 3.0)))
(t_6 (/ 9.984369578019572e-6 (+ t_2 7.0)))
(t_7 (/ (PI) (sin (* (PI) z))))
(t_8 (/ -176.6150291621406 (+ t_2 4.0)))
(t_9 (/ 1.5056327351493116e-7 (+ t_2 8.0))))
(if (<= z -1000.0)
(*
t_7
(*
(* (* (* (sqrt 2.0) (exp -7.5)) t_1) t_0)
(+ (+ (+ (+ (+ (+ 0.9999999999998099 t_5) t_8) t_3) t_4) t_6) t_9)))
(*
t_7
(*
(* (* (* (exp (+ -7.5 z)) t_1) (sqrt 2.0)) t_0)
(+
(+
(+
(+
(+
(+
(+
(+
(/ -1259.1392167224028 (- (- 1.0 z) -1.0))
(/ 676.5203681218851 (- 1.0 z)))
0.9999999999998099)
t_5)
t_8)
t_3)
t_4)
t_6)
t_9))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(7.5 - z\right)}^{\left(0.5 - z\right)}\\
t_1 := \sqrt{\mathsf{PI}\left(\right)}\\
t_2 := \left(1 - z\right) - 1\\
t_3 := \frac{12.507343278686905}{t\_2 + 5}\\
t_4 := \frac{-0.13857109526572012}{t\_2 + 6}\\
t_5 := \frac{771.3234287776531}{t\_2 + 3}\\
t_6 := \frac{9.984369578019572 \cdot 10^{-6}}{t\_2 + 7}\\
t_7 := \frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)}\\
t_8 := \frac{-176.6150291621406}{t\_2 + 4}\\
t_9 := \frac{1.5056327351493116 \cdot 10^{-7}}{t\_2 + 8}\\
\mathbf{if}\;z \leq -1000:\\
\;\;\;\;t\_7 \cdot \left(\left(\left(\left(\sqrt{2} \cdot e^{-7.5}\right) \cdot t\_1\right) \cdot t\_0\right) \cdot \left(\left(\left(\left(\left(\left(0.9999999999998099 + t\_5\right) + t\_8\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_7 \cdot \left(\left(\left(\left(e^{-7.5 + z} \cdot t\_1\right) \cdot \sqrt{2}\right) \cdot t\_0\right) \cdot \left(\left(\left(\left(\left(\left(\left(\left(\frac{-1259.1392167224028}{\left(1 - z\right) - -1} + \frac{676.5203681218851}{1 - z}\right) + 0.9999999999998099\right) + t\_5\right) + t\_8\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_9\right)\right)\\
\end{array}
\end{array}
if z < -1e3Initial program 0.0%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites0.0%
Taylor expanded in z around inf
Applied rewrites0.0%
Taylor expanded in z around 0
Applied rewrites100.0%
if -1e3 < z Initial program 97.3%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites98.4%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.2%
(FPCore (z)
:precision binary64
(let* ((t_0 (/ (PI) (sin (* (PI) z))))
(t_1 (- (- 1.0 z) 1.0))
(t_2 (/ 1.5056327351493116e-7 (+ t_1 8.0)))
(t_3 (/ 12.507343278686905 (+ t_1 5.0)))
(t_4 (/ -0.13857109526572012 (+ t_1 6.0)))
(t_5 (/ 771.3234287776531 (+ t_1 3.0)))
(t_6 (/ 9.984369578019572e-6 (+ t_1 7.0)))
(t_7 (/ -176.6150291621406 (+ t_1 4.0))))
(if (<= z -0.67)
(*
t_0
(*
(*
(* (sqrt (* (PI) 2.0)) (pow (+ 7.0 0.5) (+ t_1 0.5)))
(exp (- (+ 7.0 0.5))))
(+ (+ (+ (+ (+ (+ 47.95075976068351 t_5) t_7) t_3) t_4) t_6) t_2)))
(*
t_0
(*
(*
(* (* (exp (+ -7.5 z)) (sqrt (PI))) (sqrt 2.0))
(pow (- 7.5 z) (- 0.5 z)))
(+
(+
(+
(+
(+
(+
(fma
(fma
(fma 597.824167076735 z 519.1279660315847)
z
361.7355639412844)
z
47.95075976068351)
t_5)
t_7)
t_3)
t_4)
t_6)
t_2))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)}\\
t_1 := \left(1 - z\right) - 1\\
t_2 := \frac{1.5056327351493116 \cdot 10^{-7}}{t\_1 + 8}\\
t_3 := \frac{12.507343278686905}{t\_1 + 5}\\
t_4 := \frac{-0.13857109526572012}{t\_1 + 6}\\
t_5 := \frac{771.3234287776531}{t\_1 + 3}\\
t_6 := \frac{9.984369578019572 \cdot 10^{-6}}{t\_1 + 7}\\
t_7 := \frac{-176.6150291621406}{t\_1 + 4}\\
\mathbf{if}\;z \leq -0.67:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot 2} \cdot {\left(7 + 0.5\right)}^{\left(t\_1 + 0.5\right)}\right) \cdot e^{-\left(7 + 0.5\right)}\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + t\_5\right) + t\_7\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\left(e^{-7.5 + z} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{2}\right) \cdot {\left(7.5 - z\right)}^{\left(0.5 - z\right)}\right) \cdot \left(\left(\left(\left(\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(597.824167076735, z, 519.1279660315847\right), z, 361.7355639412844\right), z, 47.95075976068351\right) + t\_5\right) + t\_7\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_2\right)\right)\\
\end{array}
\end{array}
if z < -0.67000000000000004Initial program 31.3%
Taylor expanded in z around 0
Applied rewrites71.3%
Taylor expanded in z around 0
Applied rewrites71.0%
Taylor expanded in z around 0
Applied rewrites71.1%
if -0.67000000000000004 < z Initial program 97.3%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites98.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
(FPCore (z)
:precision binary64
(let* ((t_0 (pow (- 7.5 z) (- 0.5 z)))
(t_1 (sqrt (PI)))
(t_2 (- (- 1.0 z) 1.0))
(t_3 (/ 12.507343278686905 (+ t_2 5.0)))
(t_4 (/ -0.13857109526572012 (+ t_2 6.0)))
(t_5 (/ 771.3234287776531 (+ t_2 3.0)))
(t_6 (/ 9.984369578019572e-6 (+ t_2 7.0)))
(t_7 (/ (PI) (sin (* (PI) z))))
(t_8 (/ -176.6150291621406 (+ t_2 4.0)))
(t_9 (/ 1.5056327351493116e-7 (+ t_2 8.0))))
(if (<= z -1000.0)
(*
t_7
(*
(* (* (* (sqrt 2.0) (exp -7.5)) t_1) t_0)
(+ (+ (+ (+ (+ (+ 0.9999999999998099 t_5) t_8) t_3) t_4) t_6) t_9)))
(*
t_7
(*
(* (* (* (exp (+ -7.5 z)) t_1) (sqrt 2.0)) t_0)
(+
(+
(+
(+
(+
(+
(fma
(fma 519.1279660315847 z 361.7355639412844)
z
47.95075976068351)
t_5)
t_8)
t_3)
t_4)
t_6)
t_9))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(7.5 - z\right)}^{\left(0.5 - z\right)}\\
t_1 := \sqrt{\mathsf{PI}\left(\right)}\\
t_2 := \left(1 - z\right) - 1\\
t_3 := \frac{12.507343278686905}{t\_2 + 5}\\
t_4 := \frac{-0.13857109526572012}{t\_2 + 6}\\
t_5 := \frac{771.3234287776531}{t\_2 + 3}\\
t_6 := \frac{9.984369578019572 \cdot 10^{-6}}{t\_2 + 7}\\
t_7 := \frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)}\\
t_8 := \frac{-176.6150291621406}{t\_2 + 4}\\
t_9 := \frac{1.5056327351493116 \cdot 10^{-7}}{t\_2 + 8}\\
\mathbf{if}\;z \leq -1000:\\
\;\;\;\;t\_7 \cdot \left(\left(\left(\left(\sqrt{2} \cdot e^{-7.5}\right) \cdot t\_1\right) \cdot t\_0\right) \cdot \left(\left(\left(\left(\left(\left(0.9999999999998099 + t\_5\right) + t\_8\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_7 \cdot \left(\left(\left(\left(e^{-7.5 + z} \cdot t\_1\right) \cdot \sqrt{2}\right) \cdot t\_0\right) \cdot \left(\left(\left(\left(\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(519.1279660315847, z, 361.7355639412844\right), z, 47.95075976068351\right) + t\_5\right) + t\_8\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_9\right)\right)\\
\end{array}
\end{array}
if z < -1e3Initial program 0.0%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites0.0%
Taylor expanded in z around inf
Applied rewrites0.0%
Taylor expanded in z around 0
Applied rewrites100.0%
if -1e3 < z Initial program 97.3%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites98.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6498.3
Applied rewrites98.3%
(FPCore (z)
:precision binary64
(let* ((t_0 (/ (PI) (sin (* (PI) z))))
(t_1 (- (- 1.0 z) 1.0))
(t_2 (/ 1.5056327351493116e-7 (+ t_1 8.0)))
(t_3 (/ 12.507343278686905 (+ t_1 5.0)))
(t_4 (/ -0.13857109526572012 (+ t_1 6.0)))
(t_5 (/ 771.3234287776531 (+ t_1 3.0)))
(t_6 (/ 9.984369578019572e-6 (+ t_1 7.0)))
(t_7 (/ -176.6150291621406 (+ t_1 4.0))))
(if (<= z -0.52)
(*
t_0
(*
(*
(* (sqrt (* (PI) 2.0)) (pow (+ 7.0 0.5) (+ t_1 0.5)))
(exp (- (+ 7.0 0.5))))
(+ (+ (+ (+ (+ (+ 47.95075976068351 t_5) t_7) t_3) t_4) t_6) t_2)))
(*
t_0
(*
(*
(* (* (exp (+ -7.5 z)) (sqrt (PI))) (sqrt 2.0))
(pow (- 7.5 z) (- 0.5 z)))
(+
(+
(+
(+ (+ (+ (fma 361.7355639412844 z 47.95075976068351) t_5) t_7) t_3)
t_4)
t_6)
t_2))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)}\\
t_1 := \left(1 - z\right) - 1\\
t_2 := \frac{1.5056327351493116 \cdot 10^{-7}}{t\_1 + 8}\\
t_3 := \frac{12.507343278686905}{t\_1 + 5}\\
t_4 := \frac{-0.13857109526572012}{t\_1 + 6}\\
t_5 := \frac{771.3234287776531}{t\_1 + 3}\\
t_6 := \frac{9.984369578019572 \cdot 10^{-6}}{t\_1 + 7}\\
t_7 := \frac{-176.6150291621406}{t\_1 + 4}\\
\mathbf{if}\;z \leq -0.52:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot 2} \cdot {\left(7 + 0.5\right)}^{\left(t\_1 + 0.5\right)}\right) \cdot e^{-\left(7 + 0.5\right)}\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + t\_5\right) + t\_7\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\left(e^{-7.5 + z} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{2}\right) \cdot {\left(7.5 - z\right)}^{\left(0.5 - z\right)}\right) \cdot \left(\left(\left(\left(\left(\left(\mathsf{fma}\left(361.7355639412844, z, 47.95075976068351\right) + t\_5\right) + t\_7\right) + t\_3\right) + t\_4\right) + t\_6\right) + t\_2\right)\right)\\
\end{array}
\end{array}
if z < -0.52000000000000002Initial program 31.3%
Taylor expanded in z around 0
Applied rewrites71.3%
Taylor expanded in z around 0
Applied rewrites71.0%
Taylor expanded in z around 0
Applied rewrites71.1%
if -0.52000000000000002 < z Initial program 97.3%
Taylor expanded in z around -inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
distribute-rgt-out--N/A
Applied rewrites98.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6498.7
Applied rewrites98.7%
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(*
(* (sqrt (* (PI) 2.0)) (pow (+ 7.0 0.5) (+ t_0 0.5)))
(exp (- (+ 7.0 0.5))))
(+
(+
(+
(+
(+
(+ 47.95075976068351 (/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 (+ t_0 7.0)))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\left(\sqrt{\mathsf{PI}\left(\right) \cdot 2} \cdot {\left(7 + 0.5\right)}^{\left(t\_0 + 0.5\right)}\right) \cdot e^{-\left(7 + 0.5\right)}\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_0 + 7}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
Taylor expanded in z around 0
Applied rewrites95.1%
Taylor expanded in z around 0
Applied rewrites96.1%
Taylor expanded in z around 0
Applied rewrites96.1%
(FPCore (z)
:precision binary64
(let* ((t_0 (sqrt (sqrt (PI)))) (t_1 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(* (* t_0 t_0) (* (exp -7.5) (sqrt 15.0)))
(+
(+
(+
(+
(+
(+ 47.95075976068351 (/ 771.3234287776531 (+ t_1 3.0)))
(/ -176.6150291621406 (+ t_1 4.0)))
(/ 12.507343278686905 (+ t_1 5.0)))
(/ -0.13857109526572012 (+ t_1 6.0)))
(/ 9.984369578019572e-6 (+ t_1 7.0)))
(/ 1.5056327351493116e-7 (+ t_1 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\sqrt{\mathsf{PI}\left(\right)}}\\
t_1 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\left(t\_0 \cdot t\_0\right) \cdot \left(e^{-7.5} \cdot \sqrt{15}\right)\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + \frac{771.3234287776531}{t\_1 + 3}\right) + \frac{-176.6150291621406}{t\_1 + 4}\right) + \frac{12.507343278686905}{t\_1 + 5}\right) + \frac{-0.13857109526572012}{t\_1 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_1 + 7}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_1 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-exp.f64N/A
lower-sqrt.f64N/A
lower-PI.f6493.6
Applied rewrites93.6%
Taylor expanded in z around 0
Applied rewrites94.8%
Applied rewrites94.8%
Applied rewrites95.6%
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(* (sqrt (PI)) (* (exp -7.5) (sqrt 15.0)))
(+
(+
(+
(+
(+
(+ 47.95075976068351 (/ 771.3234287776531 (+ t_0 3.0)))
(/ -176.6150291621406 4.0))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 (+ t_0 7.0)))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(e^{-7.5} \cdot \sqrt{15}\right)\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + \frac{771.3234287776531}{t\_0 + 3}\right) + \frac{-176.6150291621406}{4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_0 + 7}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-exp.f64N/A
lower-sqrt.f64N/A
lower-PI.f6493.6
Applied rewrites93.6%
Taylor expanded in z around 0
Applied rewrites94.8%
Applied rewrites94.8%
Taylor expanded in z around 0
Applied rewrites94.8%
(FPCore (z)
:precision binary64
(let* ((t_0 (- (- 1.0 z) 1.0)))
(*
(/ (PI) (sin (* (PI) z)))
(*
(* (sqrt (PI)) (* (exp -7.5) (sqrt 15.0)))
(+
(+
(+
(+
(+
(+ 47.95075976068351 (/ 771.3234287776531 3.0))
(/ -176.6150291621406 (+ t_0 4.0)))
(/ 12.507343278686905 (+ t_0 5.0)))
(/ -0.13857109526572012 (+ t_0 6.0)))
(/ 9.984369578019572e-6 (+ t_0 7.0)))
(/ 1.5056327351493116e-7 (+ t_0 8.0)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - z\right) - 1\\
\frac{\mathsf{PI}\left(\right)}{\sin \left(\mathsf{PI}\left(\right) \cdot z\right)} \cdot \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(e^{-7.5} \cdot \sqrt{15}\right)\right) \cdot \left(\left(\left(\left(\left(\left(47.95075976068351 + \frac{771.3234287776531}{3}\right) + \frac{-176.6150291621406}{t\_0 + 4}\right) + \frac{12.507343278686905}{t\_0 + 5}\right) + \frac{-0.13857109526572012}{t\_0 + 6}\right) + \frac{9.984369578019572 \cdot 10^{-6}}{t\_0 + 7}\right) + \frac{1.5056327351493116 \cdot 10^{-7}}{t\_0 + 8}\right)\right)
\end{array}
\end{array}
Initial program 95.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-exp.f64N/A
lower-sqrt.f64N/A
lower-PI.f6493.6
Applied rewrites93.6%
Taylor expanded in z around 0
Applied rewrites94.8%
Applied rewrites94.8%
Taylor expanded in z around 0
Applied rewrites94.7%
herbie shell --seed 2024359
(FPCore (z)
:name "Jmat.Real.gamma, branch z less than 0.5"
:precision binary64
:pre (<= z 0.5)
(* (/ (PI) (sin (* (PI) z))) (* (* (* (sqrt (* (PI) 2.0)) (pow (+ (+ (- (- 1.0 z) 1.0) 7.0) 0.5) (+ (- (- 1.0 z) 1.0) 0.5))) (exp (- (+ (+ (- (- 1.0 z) 1.0) 7.0) 0.5)))) (+ (+ (+ (+ (+ (+ (+ (+ 0.9999999999998099 (/ 676.5203681218851 (+ (- (- 1.0 z) 1.0) 1.0))) (/ -1259.1392167224028 (+ (- (- 1.0 z) 1.0) 2.0))) (/ 771.3234287776531 (+ (- (- 1.0 z) 1.0) 3.0))) (/ -176.6150291621406 (+ (- (- 1.0 z) 1.0) 4.0))) (/ 12.507343278686905 (+ (- (- 1.0 z) 1.0) 5.0))) (/ -0.13857109526572012 (+ (- (- 1.0 z) 1.0) 6.0))) (/ 9.984369578019572e-6 (+ (- (- 1.0 z) 1.0) 7.0))) (/ 1.5056327351493116e-7 (+ (- (- 1.0 z) 1.0) 8.0))))))