
(FPCore (a b) :precision binary64 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b): return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b) return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b))) end
function tmp = code(a, b) tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b)); end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\pi}{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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b): return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b) return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b))) end
function tmp = code(a, b) tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b)); end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}
(FPCore (a b) :precision binary64 (* (pow (* (/ (- b a) (- (/ PI a) (/ PI b))) (+ b a)) -1.0) 0.5))
double code(double a, double b) {
return pow((((b - a) / ((((double) M_PI) / a) - (((double) M_PI) / b))) * (b + a)), -1.0) * 0.5;
}
public static double code(double a, double b) {
return Math.pow((((b - a) / ((Math.PI / a) - (Math.PI / b))) * (b + a)), -1.0) * 0.5;
}
def code(a, b): return math.pow((((b - a) / ((math.pi / a) - (math.pi / b))) * (b + a)), -1.0) * 0.5
function code(a, b) return Float64((Float64(Float64(Float64(b - a) / Float64(Float64(pi / a) - Float64(pi / b))) * Float64(b + a)) ^ -1.0) * 0.5) end
function tmp = code(a, b) tmp = ((((b - a) / ((pi / a) - (pi / b))) * (b + a)) ^ -1.0) * 0.5; end
code[a_, b_] := N[(N[Power[N[(N[(N[(b - a), $MachinePrecision] / N[(N[(Pi / a), $MachinePrecision] - N[(Pi / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{b - a}{\frac{\pi}{a} - \frac{\pi}{b}} \cdot \left(b + a\right)\right)}^{-1} \cdot 0.5
\end{array}
Initial program 77.7%
*-commutative77.7%
associate-/r/77.6%
associate-*l/77.7%
*-commutative77.7%
associate-/r/77.7%
times-frac77.7%
Simplified77.7%
clear-num77.6%
inv-pow77.6%
Applied egg-rr77.6%
unpow-177.6%
fma-def77.6%
+-commutative77.6%
associate-*r/77.6%
*-commutative77.6%
associate-*r/77.6%
mul-1-neg77.6%
unsub-neg77.6%
Simplified77.6%
div-sub69.4%
Applied egg-rr69.4%
div-sub77.6%
difference-of-squares88.5%
*-commutative88.5%
associate-/l*99.3%
Simplified99.3%
inv-pow99.3%
associate-/r/99.3%
Applied egg-rr99.3%
Final simplification99.3%
(FPCore (a b) :precision binary64 (* 0.5 (pow (* (+ b a) (/ a (/ PI b))) -1.0)))
double code(double a, double b) {
return 0.5 * pow(((b + a) * (a / (((double) M_PI) / b))), -1.0);
}
public static double code(double a, double b) {
return 0.5 * Math.pow(((b + a) * (a / (Math.PI / b))), -1.0);
}
def code(a, b): return 0.5 * math.pow(((b + a) * (a / (math.pi / b))), -1.0)
function code(a, b) return Float64(0.5 * (Float64(Float64(b + a) * Float64(a / Float64(pi / b))) ^ -1.0)) end
function tmp = code(a, b) tmp = 0.5 * (((b + a) * (a / (pi / b))) ^ -1.0); end
code[a_, b_] := N[(0.5 * N[Power[N[(N[(b + a), $MachinePrecision] * N[(a / N[(Pi / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot {\left(\left(b + a\right) \cdot \frac{a}{\frac{\pi}{b}}\right)}^{-1}
\end{array}
Initial program 77.7%
*-commutative77.7%
associate-/r/77.6%
associate-*l/77.7%
*-commutative77.7%
associate-/r/77.7%
times-frac77.7%
Simplified77.7%
clear-num77.6%
inv-pow77.6%
Applied egg-rr77.6%
unpow-177.6%
fma-def77.6%
+-commutative77.6%
associate-*r/77.6%
*-commutative77.6%
associate-*r/77.6%
mul-1-neg77.6%
unsub-neg77.6%
Simplified77.6%
div-sub69.4%
Applied egg-rr69.4%
div-sub77.6%
difference-of-squares88.5%
*-commutative88.5%
associate-/l*99.3%
Simplified99.3%
inv-pow99.3%
associate-/r/99.3%
Applied egg-rr99.3%
Taylor expanded in b around 0 99.3%
associate-/l*99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (a b)
:precision binary64
(if (<= a -1.5e+151)
(* 0.5 (/ 1.0 (/ (- b a) (/ (- PI) (* b a)))))
(if (<= a -3.5e-233)
(* (* 0.5 (/ (/ PI (+ b a)) (- b a))) (+ (/ 1.0 a) (/ -1.0 b)))
(* (/ (/ PI a) b) (/ 0.5 b)))))
double code(double a, double b) {
double tmp;
if (a <= -1.5e+151) {
tmp = 0.5 * (1.0 / ((b - a) / (-((double) M_PI) / (b * a))));
} else if (a <= -3.5e-233) {
tmp = (0.5 * ((((double) M_PI) / (b + a)) / (b - a))) * ((1.0 / a) + (-1.0 / b));
} else {
tmp = ((((double) M_PI) / a) / b) * (0.5 / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (a <= -1.5e+151) {
tmp = 0.5 * (1.0 / ((b - a) / (-Math.PI / (b * a))));
} else if (a <= -3.5e-233) {
tmp = (0.5 * ((Math.PI / (b + a)) / (b - a))) * ((1.0 / a) + (-1.0 / b));
} else {
tmp = ((Math.PI / a) / b) * (0.5 / b);
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -1.5e+151: tmp = 0.5 * (1.0 / ((b - a) / (-math.pi / (b * a)))) elif a <= -3.5e-233: tmp = (0.5 * ((math.pi / (b + a)) / (b - a))) * ((1.0 / a) + (-1.0 / b)) else: tmp = ((math.pi / a) / b) * (0.5 / b) return tmp
function code(a, b) tmp = 0.0 if (a <= -1.5e+151) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(b - a) / Float64(Float64(-pi) / Float64(b * a))))); elseif (a <= -3.5e-233) tmp = Float64(Float64(0.5 * Float64(Float64(pi / Float64(b + a)) / Float64(b - a))) * Float64(Float64(1.0 / a) + Float64(-1.0 / b))); else tmp = Float64(Float64(Float64(pi / a) / b) * Float64(0.5 / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -1.5e+151) tmp = 0.5 * (1.0 / ((b - a) / (-pi / (b * a)))); elseif (a <= -3.5e-233) tmp = (0.5 * ((pi / (b + a)) / (b - a))) * ((1.0 / a) + (-1.0 / b)); else tmp = ((pi / a) / b) * (0.5 / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -1.5e+151], N[(0.5 * N[(1.0 / N[(N[(b - a), $MachinePrecision] / N[((-Pi) / N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.5e-233], N[(N[(0.5 * N[(N[(Pi / N[(b + a), $MachinePrecision]), $MachinePrecision] / N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] + N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{b - a}{\frac{-\pi}{b \cdot a}}}\\
\mathbf{elif}\;a \leq -3.5 \cdot 10^{-233}:\\
\;\;\;\;\left(0.5 \cdot \frac{\frac{\pi}{b + a}}{b - a}\right) \cdot \left(\frac{1}{a} + \frac{-1}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{b} \cdot \frac{0.5}{b}\\
\end{array}
\end{array}
if a < -1.5e151Initial program 30.4%
*-commutative30.4%
associate-/r/30.4%
associate-*l/30.4%
*-commutative30.4%
associate-/r/30.4%
times-frac30.4%
Simplified30.4%
clear-num30.4%
inv-pow30.4%
Applied egg-rr30.4%
unpow-130.4%
fma-def30.4%
+-commutative30.4%
associate-*r/30.4%
*-commutative30.4%
associate-*r/30.4%
mul-1-neg30.4%
unsub-neg30.4%
Simplified30.4%
div-sub24.4%
Applied egg-rr24.4%
div-sub30.4%
difference-of-squares60.7%
*-commutative60.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 99.8%
mul-1-neg99.8%
Simplified99.8%
if -1.5e151 < a < -3.49999999999999991e-233Initial program 88.1%
times-frac88.2%
*-commutative88.2%
times-frac88.2%
difference-of-squares94.2%
associate-/r*94.3%
metadata-eval94.3%
sub-neg94.3%
distribute-neg-frac94.3%
metadata-eval94.3%
Simplified94.3%
if -3.49999999999999991e-233 < a Initial program 82.6%
times-frac82.6%
*-commutative82.6%
times-frac82.6%
difference-of-squares91.9%
associate-/r*92.6%
metadata-eval92.6%
sub-neg92.6%
distribute-neg-frac92.6%
metadata-eval92.6%
Simplified92.6%
frac-add92.7%
*-un-lft-identity92.7%
Applied egg-rr92.7%
*-commutative92.7%
neg-mul-192.7%
sub-neg92.7%
Simplified92.7%
Taylor expanded in b around inf 68.9%
associate-*r/68.9%
unpow268.9%
*-commutative68.9%
times-frac69.0%
Simplified69.0%
associate-*r/69.1%
Applied egg-rr69.1%
times-frac72.9%
Applied egg-rr72.9%
Final simplification83.3%
(FPCore (a b)
:precision binary64
(let* ((t_0 (/ (/ PI a) b)))
(if (<= a -6.1e-37)
(* 0.5 (/ 1.0 (/ (- b a) (/ (- PI) (* b a)))))
(if (<= a -2.4e-113)
(* t_0 (/ 0.5 b))
(if (<= a -5.6e-205)
(* (* 0.5 (/ (/ PI (+ b a)) (- b a))) (/ -1.0 b))
(* 0.5 (/ t_0 b)))))))
double code(double a, double b) {
double t_0 = (((double) M_PI) / a) / b;
double tmp;
if (a <= -6.1e-37) {
tmp = 0.5 * (1.0 / ((b - a) / (-((double) M_PI) / (b * a))));
} else if (a <= -2.4e-113) {
tmp = t_0 * (0.5 / b);
} else if (a <= -5.6e-205) {
tmp = (0.5 * ((((double) M_PI) / (b + a)) / (b - a))) * (-1.0 / b);
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = (Math.PI / a) / b;
double tmp;
if (a <= -6.1e-37) {
tmp = 0.5 * (1.0 / ((b - a) / (-Math.PI / (b * a))));
} else if (a <= -2.4e-113) {
tmp = t_0 * (0.5 / b);
} else if (a <= -5.6e-205) {
tmp = (0.5 * ((Math.PI / (b + a)) / (b - a))) * (-1.0 / b);
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
def code(a, b): t_0 = (math.pi / a) / b tmp = 0 if a <= -6.1e-37: tmp = 0.5 * (1.0 / ((b - a) / (-math.pi / (b * a)))) elif a <= -2.4e-113: tmp = t_0 * (0.5 / b) elif a <= -5.6e-205: tmp = (0.5 * ((math.pi / (b + a)) / (b - a))) * (-1.0 / b) else: tmp = 0.5 * (t_0 / b) return tmp
function code(a, b) t_0 = Float64(Float64(pi / a) / b) tmp = 0.0 if (a <= -6.1e-37) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(b - a) / Float64(Float64(-pi) / Float64(b * a))))); elseif (a <= -2.4e-113) tmp = Float64(t_0 * Float64(0.5 / b)); elseif (a <= -5.6e-205) tmp = Float64(Float64(0.5 * Float64(Float64(pi / Float64(b + a)) / Float64(b - a))) * Float64(-1.0 / b)); else tmp = Float64(0.5 * Float64(t_0 / b)); end return tmp end
function tmp_2 = code(a, b) t_0 = (pi / a) / b; tmp = 0.0; if (a <= -6.1e-37) tmp = 0.5 * (1.0 / ((b - a) / (-pi / (b * a)))); elseif (a <= -2.4e-113) tmp = t_0 * (0.5 / b); elseif (a <= -5.6e-205) tmp = (0.5 * ((pi / (b + a)) / (b - a))) * (-1.0 / b); else tmp = 0.5 * (t_0 / b); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[a, -6.1e-37], N[(0.5 * N[(1.0 / N[(N[(b - a), $MachinePrecision] / N[((-Pi) / N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.4e-113], N[(t$95$0 * N[(0.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.6e-205], N[(N[(0.5 * N[(N[(Pi / N[(b + a), $MachinePrecision]), $MachinePrecision] / N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / b), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(t$95$0 / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\pi}{a}}{b}\\
\mathbf{if}\;a \leq -6.1 \cdot 10^{-37}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{b - a}{\frac{-\pi}{b \cdot a}}}\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-113}:\\
\;\;\;\;t_0 \cdot \frac{0.5}{b}\\
\mathbf{elif}\;a \leq -5.6 \cdot 10^{-205}:\\
\;\;\;\;\left(0.5 \cdot \frac{\frac{\pi}{b + a}}{b - a}\right) \cdot \frac{-1}{b}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{t_0}{b}\\
\end{array}
\end{array}
if a < -6.1000000000000003e-37Initial program 65.5%
*-commutative65.5%
associate-/r/65.5%
associate-*l/65.6%
*-commutative65.6%
associate-/r/65.6%
times-frac65.6%
Simplified65.6%
clear-num65.5%
inv-pow65.5%
Applied egg-rr65.5%
unpow-165.5%
fma-def65.5%
+-commutative65.5%
associate-*r/65.5%
*-commutative65.5%
associate-*r/65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
div-sub56.5%
Applied egg-rr56.5%
div-sub65.5%
difference-of-squares80.4%
*-commutative80.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around inf 92.8%
mul-1-neg92.8%
Simplified92.8%
if -6.1000000000000003e-37 < a < -2.40000000000000012e-113Initial program 90.9%
times-frac90.9%
*-commutative90.9%
times-frac90.9%
difference-of-squares90.9%
associate-/r*91.1%
metadata-eval91.1%
sub-neg91.1%
distribute-neg-frac91.1%
metadata-eval91.1%
Simplified91.1%
frac-add90.9%
*-un-lft-identity90.9%
Applied egg-rr90.9%
*-commutative90.9%
neg-mul-190.9%
sub-neg90.9%
Simplified90.9%
Taylor expanded in b around inf 74.2%
associate-*r/74.2%
unpow274.2%
*-commutative74.2%
times-frac74.3%
Simplified74.3%
associate-*r/74.5%
Applied egg-rr74.5%
times-frac83.0%
Applied egg-rr83.0%
if -2.40000000000000012e-113 < a < -5.59999999999999983e-205Initial program 82.8%
times-frac82.8%
*-commutative82.8%
times-frac82.8%
difference-of-squares99.5%
associate-/r*99.8%
metadata-eval99.8%
sub-neg99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 51.4%
if -5.59999999999999983e-205 < a Initial program 80.6%
*-commutative80.6%
associate-/r/80.7%
associate-*l/80.6%
*-commutative80.6%
associate-/r/80.6%
times-frac80.6%
Simplified80.8%
clear-num80.5%
inv-pow80.5%
Applied egg-rr80.5%
unpow-180.5%
fma-def80.5%
+-commutative80.5%
associate-*r/80.5%
*-commutative80.5%
associate-*r/80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
div-sub70.6%
Applied egg-rr70.6%
div-sub80.5%
difference-of-squares90.4%
*-commutative90.4%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in b around inf 67.9%
associate-/r*68.1%
unpow268.1%
associate-/r*73.6%
Simplified73.6%
Final simplification77.8%
(FPCore (a b)
:precision binary64
(if (<= b 1.32e-202)
(* 0.5 (/ PI (* a (* b a))))
(if (<= b 1e+104)
(* (+ (/ 0.5 a) (/ -0.5 b)) (/ PI (- (* b b) (* a a))))
(* (/ (/ PI a) b) (/ 0.5 b)))))
double code(double a, double b) {
double tmp;
if (b <= 1.32e-202) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else if (b <= 1e+104) {
tmp = ((0.5 / a) + (-0.5 / b)) * (((double) M_PI) / ((b * b) - (a * a)));
} else {
tmp = ((((double) M_PI) / a) / b) * (0.5 / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 1.32e-202) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else if (b <= 1e+104) {
tmp = ((0.5 / a) + (-0.5 / b)) * (Math.PI / ((b * b) - (a * a)));
} else {
tmp = ((Math.PI / a) / b) * (0.5 / b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 1.32e-202: tmp = 0.5 * (math.pi / (a * (b * a))) elif b <= 1e+104: tmp = ((0.5 / a) + (-0.5 / b)) * (math.pi / ((b * b) - (a * a))) else: tmp = ((math.pi / a) / b) * (0.5 / b) return tmp
function code(a, b) tmp = 0.0 if (b <= 1.32e-202) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); elseif (b <= 1e+104) tmp = Float64(Float64(Float64(0.5 / a) + Float64(-0.5 / b)) * Float64(pi / Float64(Float64(b * b) - Float64(a * a)))); else tmp = Float64(Float64(Float64(pi / a) / b) * Float64(0.5 / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 1.32e-202) tmp = 0.5 * (pi / (a * (b * a))); elseif (b <= 1e+104) tmp = ((0.5 / a) + (-0.5 / b)) * (pi / ((b * b) - (a * a))); else tmp = ((pi / a) / b) * (0.5 / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 1.32e-202], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+104], N[(N[(N[(0.5 / a), $MachinePrecision] + N[(-0.5 / b), $MachinePrecision]), $MachinePrecision] * N[(Pi / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.32 \cdot 10^{-202}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{elif}\;b \leq 10^{+104}:\\
\;\;\;\;\left(\frac{0.5}{a} + \frac{-0.5}{b}\right) \cdot \frac{\pi}{b \cdot b - a \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{b} \cdot \frac{0.5}{b}\\
\end{array}
\end{array}
if b < 1.32000000000000009e-202Initial program 76.7%
*-commutative76.7%
associate-/r/76.7%
associate-*l/76.7%
*-commutative76.7%
associate-/r/76.7%
times-frac76.7%
Simplified76.7%
clear-num76.5%
inv-pow76.5%
Applied egg-rr76.5%
unpow-176.5%
fma-def76.5%
+-commutative76.5%
associate-*r/76.5%
*-commutative76.5%
associate-*r/76.5%
mul-1-neg76.5%
unsub-neg76.5%
Simplified76.5%
div-sub70.2%
Applied egg-rr70.2%
div-sub76.5%
difference-of-squares89.0%
*-commutative89.0%
associate-/l*99.4%
Simplified99.4%
inv-pow99.4%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.0%
unpow256.0%
associate-*l*64.2%
Simplified64.2%
if 1.32000000000000009e-202 < b < 1e104Initial program 89.8%
times-frac89.9%
*-commutative89.9%
times-frac89.9%
difference-of-squares89.9%
associate-/r*90.3%
metadata-eval90.3%
sub-neg90.3%
distribute-neg-frac90.3%
metadata-eval90.3%
Simplified90.3%
distribute-lft-in84.8%
associate-/l/84.7%
associate-/l/84.4%
Applied egg-rr84.4%
distribute-lft-out89.9%
associate-*r*89.9%
associate-*l/89.9%
*-commutative89.9%
difference-of-squares90.0%
associate-*l/89.9%
distribute-lft-in89.9%
associate-*r/89.9%
metadata-eval89.9%
associate-*r/89.9%
metadata-eval89.9%
Simplified89.9%
if 1e104 < b Initial program 65.1%
times-frac65.1%
*-commutative65.1%
times-frac65.1%
difference-of-squares84.7%
associate-/r*84.7%
metadata-eval84.7%
sub-neg84.7%
distribute-neg-frac84.7%
metadata-eval84.7%
Simplified84.7%
frac-add84.7%
*-un-lft-identity84.7%
Applied egg-rr84.7%
*-commutative84.7%
neg-mul-184.7%
sub-neg84.7%
Simplified84.7%
Taylor expanded in b around inf 84.7%
associate-*r/84.7%
unpow284.7%
*-commutative84.7%
times-frac84.7%
Simplified84.7%
associate-*r/84.8%
Applied egg-rr84.8%
times-frac100.0%
Applied egg-rr100.0%
Final simplification75.5%
(FPCore (a b)
:precision binary64
(if (<= b 7.5e-205)
(* 0.5 (/ PI (* a (* b a))))
(if (<= b 5e+109)
(/ (* PI (+ (/ 0.5 a) (/ -0.5 b))) (- (* b b) (* a a)))
(* (/ (/ PI a) b) (/ 0.5 b)))))
double code(double a, double b) {
double tmp;
if (b <= 7.5e-205) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else if (b <= 5e+109) {
tmp = (((double) M_PI) * ((0.5 / a) + (-0.5 / b))) / ((b * b) - (a * a));
} else {
tmp = ((((double) M_PI) / a) / b) * (0.5 / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 7.5e-205) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else if (b <= 5e+109) {
tmp = (Math.PI * ((0.5 / a) + (-0.5 / b))) / ((b * b) - (a * a));
} else {
tmp = ((Math.PI / a) / b) * (0.5 / b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 7.5e-205: tmp = 0.5 * (math.pi / (a * (b * a))) elif b <= 5e+109: tmp = (math.pi * ((0.5 / a) + (-0.5 / b))) / ((b * b) - (a * a)) else: tmp = ((math.pi / a) / b) * (0.5 / b) return tmp
function code(a, b) tmp = 0.0 if (b <= 7.5e-205) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); elseif (b <= 5e+109) tmp = Float64(Float64(pi * Float64(Float64(0.5 / a) + Float64(-0.5 / b))) / Float64(Float64(b * b) - Float64(a * a))); else tmp = Float64(Float64(Float64(pi / a) / b) * Float64(0.5 / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 7.5e-205) tmp = 0.5 * (pi / (a * (b * a))); elseif (b <= 5e+109) tmp = (pi * ((0.5 / a) + (-0.5 / b))) / ((b * b) - (a * a)); else tmp = ((pi / a) / b) * (0.5 / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 7.5e-205], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+109], N[(N[(Pi * N[(N[(0.5 / a), $MachinePrecision] + N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.5 \cdot 10^{-205}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\frac{\pi \cdot \left(\frac{0.5}{a} + \frac{-0.5}{b}\right)}{b \cdot b - a \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{b} \cdot \frac{0.5}{b}\\
\end{array}
\end{array}
if b < 7.4999999999999996e-205Initial program 76.7%
*-commutative76.7%
associate-/r/76.7%
associate-*l/76.7%
*-commutative76.7%
associate-/r/76.7%
times-frac76.7%
Simplified76.7%
clear-num76.5%
inv-pow76.5%
Applied egg-rr76.5%
unpow-176.5%
fma-def76.5%
+-commutative76.5%
associate-*r/76.5%
*-commutative76.5%
associate-*r/76.5%
mul-1-neg76.5%
unsub-neg76.5%
Simplified76.5%
div-sub70.2%
Applied egg-rr70.2%
div-sub76.5%
difference-of-squares89.0%
*-commutative89.0%
associate-/l*99.4%
Simplified99.4%
inv-pow99.4%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.0%
unpow256.0%
associate-*l*64.2%
Simplified64.2%
if 7.4999999999999996e-205 < b < 5.0000000000000001e109Initial program 89.8%
times-frac89.9%
*-commutative89.9%
times-frac89.9%
difference-of-squares89.9%
associate-/r*90.3%
metadata-eval90.3%
sub-neg90.3%
distribute-neg-frac90.3%
metadata-eval90.3%
Simplified90.3%
distribute-lft-in84.8%
associate-/l/84.7%
associate-/l/84.4%
Applied egg-rr84.4%
distribute-lft-out89.9%
associate-*r*89.9%
associate-*l/89.9%
*-commutative89.9%
difference-of-squares90.0%
associate-*l/89.9%
distribute-lft-in89.9%
associate-*r/89.9%
metadata-eval89.9%
associate-*r/89.9%
metadata-eval89.9%
Simplified89.9%
associate-*l/90.0%
Applied egg-rr90.0%
if 5.0000000000000001e109 < b Initial program 65.1%
times-frac65.1%
*-commutative65.1%
times-frac65.1%
difference-of-squares84.7%
associate-/r*84.7%
metadata-eval84.7%
sub-neg84.7%
distribute-neg-frac84.7%
metadata-eval84.7%
Simplified84.7%
frac-add84.7%
*-un-lft-identity84.7%
Applied egg-rr84.7%
*-commutative84.7%
neg-mul-184.7%
sub-neg84.7%
Simplified84.7%
Taylor expanded in b around inf 84.7%
associate-*r/84.7%
unpow284.7%
*-commutative84.7%
times-frac84.7%
Simplified84.7%
associate-*r/84.8%
Applied egg-rr84.8%
times-frac100.0%
Applied egg-rr100.0%
Final simplification75.5%
(FPCore (a b)
:precision binary64
(let* ((t_0 (/ (/ PI a) b))
(t_1 (* 0.5 (/ 1.0 (/ (- b a) (/ (- PI) (* b a)))))))
(if (<= a -1.45e-36)
t_1
(if (<= a -2.8e-113)
(* t_0 (/ 0.5 b))
(if (<= a -5.6e-205) t_1 (* 0.5 (/ t_0 b)))))))
double code(double a, double b) {
double t_0 = (((double) M_PI) / a) / b;
double t_1 = 0.5 * (1.0 / ((b - a) / (-((double) M_PI) / (b * a))));
double tmp;
if (a <= -1.45e-36) {
tmp = t_1;
} else if (a <= -2.8e-113) {
tmp = t_0 * (0.5 / b);
} else if (a <= -5.6e-205) {
tmp = t_1;
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = (Math.PI / a) / b;
double t_1 = 0.5 * (1.0 / ((b - a) / (-Math.PI / (b * a))));
double tmp;
if (a <= -1.45e-36) {
tmp = t_1;
} else if (a <= -2.8e-113) {
tmp = t_0 * (0.5 / b);
} else if (a <= -5.6e-205) {
tmp = t_1;
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
def code(a, b): t_0 = (math.pi / a) / b t_1 = 0.5 * (1.0 / ((b - a) / (-math.pi / (b * a)))) tmp = 0 if a <= -1.45e-36: tmp = t_1 elif a <= -2.8e-113: tmp = t_0 * (0.5 / b) elif a <= -5.6e-205: tmp = t_1 else: tmp = 0.5 * (t_0 / b) return tmp
function code(a, b) t_0 = Float64(Float64(pi / a) / b) t_1 = Float64(0.5 * Float64(1.0 / Float64(Float64(b - a) / Float64(Float64(-pi) / Float64(b * a))))) tmp = 0.0 if (a <= -1.45e-36) tmp = t_1; elseif (a <= -2.8e-113) tmp = Float64(t_0 * Float64(0.5 / b)); elseif (a <= -5.6e-205) tmp = t_1; else tmp = Float64(0.5 * Float64(t_0 / b)); end return tmp end
function tmp_2 = code(a, b) t_0 = (pi / a) / b; t_1 = 0.5 * (1.0 / ((b - a) / (-pi / (b * a)))); tmp = 0.0; if (a <= -1.45e-36) tmp = t_1; elseif (a <= -2.8e-113) tmp = t_0 * (0.5 / b); elseif (a <= -5.6e-205) tmp = t_1; else tmp = 0.5 * (t_0 / b); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(1.0 / N[(N[(b - a), $MachinePrecision] / N[((-Pi) / N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e-36], t$95$1, If[LessEqual[a, -2.8e-113], N[(t$95$0 * N[(0.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.6e-205], t$95$1, N[(0.5 * N[(t$95$0 / b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\pi}{a}}{b}\\
t_1 := 0.5 \cdot \frac{1}{\frac{b - a}{\frac{-\pi}{b \cdot a}}}\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-113}:\\
\;\;\;\;t_0 \cdot \frac{0.5}{b}\\
\mathbf{elif}\;a \leq -5.6 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{t_0}{b}\\
\end{array}
\end{array}
if a < -1.45000000000000006e-36 or -2.8e-113 < a < -5.59999999999999983e-205Initial program 69.2%
*-commutative69.2%
associate-/r/69.2%
associate-*l/69.3%
*-commutative69.3%
associate-/r/69.3%
times-frac69.3%
Simplified69.2%
clear-num69.2%
inv-pow69.2%
Applied egg-rr69.2%
unpow-169.2%
fma-def69.2%
+-commutative69.2%
associate-*r/69.2%
*-commutative69.2%
associate-*r/69.2%
mul-1-neg69.2%
unsub-neg69.2%
Simplified69.2%
div-sub63.3%
Applied egg-rr63.3%
div-sub69.2%
difference-of-squares84.5%
*-commutative84.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around inf 82.7%
mul-1-neg82.7%
Simplified82.7%
if -1.45000000000000006e-36 < a < -2.8e-113Initial program 90.9%
times-frac90.9%
*-commutative90.9%
times-frac90.9%
difference-of-squares90.9%
associate-/r*91.1%
metadata-eval91.1%
sub-neg91.1%
distribute-neg-frac91.1%
metadata-eval91.1%
Simplified91.1%
frac-add90.9%
*-un-lft-identity90.9%
Applied egg-rr90.9%
*-commutative90.9%
neg-mul-190.9%
sub-neg90.9%
Simplified90.9%
Taylor expanded in b around inf 74.2%
associate-*r/74.2%
unpow274.2%
*-commutative74.2%
times-frac74.3%
Simplified74.3%
associate-*r/74.5%
Applied egg-rr74.5%
times-frac83.0%
Applied egg-rr83.0%
if -5.59999999999999983e-205 < a Initial program 80.6%
*-commutative80.6%
associate-/r/80.7%
associate-*l/80.6%
*-commutative80.6%
associate-/r/80.6%
times-frac80.6%
Simplified80.8%
clear-num80.5%
inv-pow80.5%
Applied egg-rr80.5%
unpow-180.5%
fma-def80.5%
+-commutative80.5%
associate-*r/80.5%
*-commutative80.5%
associate-*r/80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
div-sub70.6%
Applied egg-rr70.6%
div-sub80.5%
difference-of-squares90.4%
*-commutative90.4%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in b around inf 67.9%
associate-/r*68.1%
unpow268.1%
associate-/r*73.6%
Simplified73.6%
Final simplification77.3%
(FPCore (a b)
:precision binary64
(if (<= b 5.2e-195)
(* 0.5 (/ PI (* a (* b a))))
(if (<= b 1e+135)
(* (* 0.5 (/ (/ PI (+ b a)) (- b a))) (/ 1.0 a))
(* (/ (/ PI a) b) (/ 0.5 b)))))
double code(double a, double b) {
double tmp;
if (b <= 5.2e-195) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else if (b <= 1e+135) {
tmp = (0.5 * ((((double) M_PI) / (b + a)) / (b - a))) * (1.0 / a);
} else {
tmp = ((((double) M_PI) / a) / b) * (0.5 / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 5.2e-195) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else if (b <= 1e+135) {
tmp = (0.5 * ((Math.PI / (b + a)) / (b - a))) * (1.0 / a);
} else {
tmp = ((Math.PI / a) / b) * (0.5 / b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 5.2e-195: tmp = 0.5 * (math.pi / (a * (b * a))) elif b <= 1e+135: tmp = (0.5 * ((math.pi / (b + a)) / (b - a))) * (1.0 / a) else: tmp = ((math.pi / a) / b) * (0.5 / b) return tmp
function code(a, b) tmp = 0.0 if (b <= 5.2e-195) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); elseif (b <= 1e+135) tmp = Float64(Float64(0.5 * Float64(Float64(pi / Float64(b + a)) / Float64(b - a))) * Float64(1.0 / a)); else tmp = Float64(Float64(Float64(pi / a) / b) * Float64(0.5 / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 5.2e-195) tmp = 0.5 * (pi / (a * (b * a))); elseif (b <= 1e+135) tmp = (0.5 * ((pi / (b + a)) / (b - a))) * (1.0 / a); else tmp = ((pi / a) / b) * (0.5 / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 5.2e-195], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+135], N[(N[(0.5 * N[(N[(Pi / N[(b + a), $MachinePrecision]), $MachinePrecision] / N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{-195}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{elif}\;b \leq 10^{+135}:\\
\;\;\;\;\left(0.5 \cdot \frac{\frac{\pi}{b + a}}{b - a}\right) \cdot \frac{1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{b} \cdot \frac{0.5}{b}\\
\end{array}
\end{array}
if b < 5.2000000000000003e-195Initial program 76.8%
*-commutative76.8%
associate-/r/76.8%
associate-*l/76.9%
*-commutative76.9%
associate-/r/76.9%
times-frac76.9%
Simplified76.9%
clear-num76.6%
inv-pow76.6%
Applied egg-rr76.6%
unpow-176.6%
fma-def76.6%
+-commutative76.6%
associate-*r/76.6%
*-commutative76.6%
associate-*r/76.6%
mul-1-neg76.6%
unsub-neg76.6%
Simplified76.6%
div-sub70.4%
Applied egg-rr70.4%
div-sub76.6%
difference-of-squares89.0%
*-commutative89.0%
associate-/l*99.4%
Simplified99.4%
inv-pow99.4%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.3%
unpow256.3%
associate-*l*64.4%
Simplified64.4%
if 5.2000000000000003e-195 < b < 9.99999999999999962e134Initial program 90.3%
times-frac90.4%
*-commutative90.4%
times-frac90.4%
difference-of-squares90.4%
associate-/r*90.8%
metadata-eval90.8%
sub-neg90.8%
distribute-neg-frac90.8%
metadata-eval90.8%
Simplified90.8%
Taylor expanded in a around 0 67.7%
if 9.99999999999999962e134 < b Initial program 61.5%
times-frac61.5%
*-commutative61.5%
times-frac61.5%
difference-of-squares83.1%
associate-/r*83.1%
metadata-eval83.1%
sub-neg83.1%
distribute-neg-frac83.1%
metadata-eval83.1%
Simplified83.1%
frac-add83.1%
*-un-lft-identity83.1%
Applied egg-rr83.1%
*-commutative83.1%
neg-mul-183.1%
sub-neg83.1%
Simplified83.1%
Taylor expanded in b around inf 83.1%
associate-*r/83.1%
unpow283.1%
*-commutative83.1%
times-frac83.1%
Simplified83.1%
associate-*r/83.1%
Applied egg-rr83.1%
times-frac100.0%
Applied egg-rr100.0%
Final simplification70.3%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* 0.5 (/ PI (* a (* b a))))))
(if (<= b 4.5e-152)
t_0
(if (<= b 1.2e-87)
(* (/ -0.5 b) (/ PI (- (* b b) (* a a))))
(if (<= b 1.05e-29) t_0 (* 0.5 (/ (/ (/ PI a) b) b)))))))
double code(double a, double b) {
double t_0 = 0.5 * (((double) M_PI) / (a * (b * a)));
double tmp;
if (b <= 4.5e-152) {
tmp = t_0;
} else if (b <= 1.2e-87) {
tmp = (-0.5 / b) * (((double) M_PI) / ((b * b) - (a * a)));
} else if (b <= 1.05e-29) {
tmp = t_0;
} else {
tmp = 0.5 * (((((double) M_PI) / a) / b) / b);
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = 0.5 * (Math.PI / (a * (b * a)));
double tmp;
if (b <= 4.5e-152) {
tmp = t_0;
} else if (b <= 1.2e-87) {
tmp = (-0.5 / b) * (Math.PI / ((b * b) - (a * a)));
} else if (b <= 1.05e-29) {
tmp = t_0;
} else {
tmp = 0.5 * (((Math.PI / a) / b) / b);
}
return tmp;
}
def code(a, b): t_0 = 0.5 * (math.pi / (a * (b * a))) tmp = 0 if b <= 4.5e-152: tmp = t_0 elif b <= 1.2e-87: tmp = (-0.5 / b) * (math.pi / ((b * b) - (a * a))) elif b <= 1.05e-29: tmp = t_0 else: tmp = 0.5 * (((math.pi / a) / b) / b) return tmp
function code(a, b) t_0 = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))) tmp = 0.0 if (b <= 4.5e-152) tmp = t_0; elseif (b <= 1.2e-87) tmp = Float64(Float64(-0.5 / b) * Float64(pi / Float64(Float64(b * b) - Float64(a * a)))); elseif (b <= 1.05e-29) tmp = t_0; else tmp = Float64(0.5 * Float64(Float64(Float64(pi / a) / b) / b)); end return tmp end
function tmp_2 = code(a, b) t_0 = 0.5 * (pi / (a * (b * a))); tmp = 0.0; if (b <= 4.5e-152) tmp = t_0; elseif (b <= 1.2e-87) tmp = (-0.5 / b) * (pi / ((b * b) - (a * a))); elseif (b <= 1.05e-29) tmp = t_0; else tmp = 0.5 * (((pi / a) / b) / b); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.5e-152], t$95$0, If[LessEqual[b, 1.2e-87], N[(N[(-0.5 / b), $MachinePrecision] * N[(Pi / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e-29], t$95$0, N[(0.5 * N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{if}\;b \leq 4.5 \cdot 10^{-152}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{-0.5}{b} \cdot \frac{\pi}{b \cdot b - a \cdot a}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-29}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{\frac{\frac{\pi}{a}}{b}}{b}\\
\end{array}
\end{array}
if b < 4.5000000000000004e-152 or 1.2e-87 < b < 1.04999999999999995e-29Initial program 77.1%
*-commutative77.1%
associate-/r/77.1%
associate-*l/77.1%
*-commutative77.1%
associate-/r/77.1%
times-frac77.1%
Simplified77.2%
clear-num76.9%
inv-pow76.9%
Applied egg-rr76.9%
unpow-176.9%
fma-def76.9%
+-commutative76.9%
associate-*r/76.9%
*-commutative76.9%
associate-*r/76.9%
mul-1-neg76.9%
unsub-neg76.9%
Simplified76.9%
div-sub71.2%
Applied egg-rr71.2%
div-sub76.9%
difference-of-squares88.4%
*-commutative88.4%
associate-/l*99.4%
Simplified99.4%
inv-pow99.4%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.7%
unpow256.7%
associate-*l*65.6%
Simplified65.6%
if 4.5000000000000004e-152 < b < 1.2e-87Initial program 83.2%
times-frac83.3%
*-commutative83.3%
times-frac83.3%
difference-of-squares83.3%
associate-/r*84.7%
metadata-eval84.7%
sub-neg84.7%
distribute-neg-frac84.7%
metadata-eval84.7%
Simplified84.7%
distribute-lft-in72.1%
associate-/l/72.1%
associate-/l/70.9%
Applied egg-rr70.9%
distribute-lft-out83.3%
associate-*r*83.3%
associate-*l/83.3%
*-commutative83.3%
difference-of-squares83.3%
associate-*l/83.3%
distribute-lft-in83.3%
associate-*r/83.3%
metadata-eval83.3%
associate-*r/83.3%
metadata-eval83.3%
Simplified83.3%
Taylor expanded in a around inf 64.1%
if 1.04999999999999995e-29 < b Initial program 77.8%
*-commutative77.8%
associate-/r/77.7%
associate-*l/77.8%
*-commutative77.8%
associate-/r/77.8%
times-frac77.8%
Simplified77.9%
clear-num77.9%
inv-pow77.9%
Applied egg-rr77.9%
unpow-177.9%
fma-def77.9%
+-commutative77.9%
associate-*r/77.9%
*-commutative77.9%
associate-*r/77.9%
mul-1-neg77.9%
unsub-neg77.9%
Simplified77.9%
div-sub68.6%
Applied egg-rr68.6%
div-sub77.9%
difference-of-squares90.1%
*-commutative90.1%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in b around inf 80.1%
associate-/r*80.1%
unpow280.1%
associate-/r*89.7%
Simplified89.7%
Final simplification71.6%
(FPCore (a b) :precision binary64 (let* ((t_0 (/ (/ PI a) b))) (if (<= b 1.02e-29) (* 0.5 (/ 1.0 (/ a t_0))) (* 0.5 (/ t_0 b)))))
double code(double a, double b) {
double t_0 = (((double) M_PI) / a) / b;
double tmp;
if (b <= 1.02e-29) {
tmp = 0.5 * (1.0 / (a / t_0));
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = (Math.PI / a) / b;
double tmp;
if (b <= 1.02e-29) {
tmp = 0.5 * (1.0 / (a / t_0));
} else {
tmp = 0.5 * (t_0 / b);
}
return tmp;
}
def code(a, b): t_0 = (math.pi / a) / b tmp = 0 if b <= 1.02e-29: tmp = 0.5 * (1.0 / (a / t_0)) else: tmp = 0.5 * (t_0 / b) return tmp
function code(a, b) t_0 = Float64(Float64(pi / a) / b) tmp = 0.0 if (b <= 1.02e-29) tmp = Float64(0.5 * Float64(1.0 / Float64(a / t_0))); else tmp = Float64(0.5 * Float64(t_0 / b)); end return tmp end
function tmp_2 = code(a, b) t_0 = (pi / a) / b; tmp = 0.0; if (b <= 1.02e-29) tmp = 0.5 * (1.0 / (a / t_0)); else tmp = 0.5 * (t_0 / b); end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[b, 1.02e-29], N[(0.5 * N[(1.0 / N[(a / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(t$95$0 / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\pi}{a}}{b}\\
\mathbf{if}\;b \leq 1.02 \cdot 10^{-29}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{a}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{t_0}{b}\\
\end{array}
\end{array}
if b < 1.01999999999999994e-29Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in b around 0 56.2%
associate-/l*56.2%
unpow256.2%
associate-/l*65.8%
associate-/r*65.8%
*-commutative65.8%
associate-/r*65.8%
Simplified65.8%
if 1.01999999999999994e-29 < b Initial program 77.8%
*-commutative77.8%
associate-/r/77.7%
associate-*l/77.8%
*-commutative77.8%
associate-/r/77.8%
times-frac77.8%
Simplified77.9%
clear-num77.9%
inv-pow77.9%
Applied egg-rr77.9%
unpow-177.9%
fma-def77.9%
+-commutative77.9%
associate-*r/77.9%
*-commutative77.9%
associate-*r/77.9%
mul-1-neg77.9%
unsub-neg77.9%
Simplified77.9%
div-sub68.6%
Applied egg-rr68.6%
div-sub77.9%
difference-of-squares90.1%
*-commutative90.1%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in b around inf 80.1%
associate-/r*80.1%
unpow280.1%
associate-/r*89.7%
Simplified89.7%
Final simplification71.8%
(FPCore (a b) :precision binary64 (if (<= b 1.02e-29) (* PI (/ 0.5 (* b (* a a)))) (* (/ PI a) (/ 0.5 (* b b)))))
double code(double a, double b) {
double tmp;
if (b <= 1.02e-29) {
tmp = ((double) M_PI) * (0.5 / (b * (a * a)));
} else {
tmp = (((double) M_PI) / a) * (0.5 / (b * b));
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 1.02e-29) {
tmp = Math.PI * (0.5 / (b * (a * a)));
} else {
tmp = (Math.PI / a) * (0.5 / (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 1.02e-29: tmp = math.pi * (0.5 / (b * (a * a))) else: tmp = (math.pi / a) * (0.5 / (b * b)) return tmp
function code(a, b) tmp = 0.0 if (b <= 1.02e-29) tmp = Float64(pi * Float64(0.5 / Float64(b * Float64(a * a)))); else tmp = Float64(Float64(pi / a) * Float64(0.5 / Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 1.02e-29) tmp = pi * (0.5 / (b * (a * a))); else tmp = (pi / a) * (0.5 / (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 1.02e-29], N[(Pi * N[(0.5 / N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi / a), $MachinePrecision] * N[(0.5 / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.02 \cdot 10^{-29}:\\
\;\;\;\;\pi \cdot \frac{0.5}{b \cdot \left(a \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{a} \cdot \frac{0.5}{b \cdot b}\\
\end{array}
\end{array}
if b < 1.01999999999999994e-29Initial program 77.6%
Taylor expanded in b around 0 56.2%
associate-*r/56.2%
unpow256.2%
Simplified56.2%
Taylor expanded in a around 0 56.2%
associate-*r/56.2%
*-commutative56.2%
*-rgt-identity56.2%
*-commutative56.2%
unpow256.2%
associate-*r/56.2%
associate-*l*56.2%
associate-*r/56.2%
metadata-eval56.2%
unpow256.2%
*-commutative56.2%
unpow256.2%
Simplified56.2%
if 1.01999999999999994e-29 < b Initial program 77.8%
times-frac77.8%
*-commutative77.8%
times-frac77.8%
difference-of-squares90.1%
associate-/r*90.2%
metadata-eval90.2%
sub-neg90.2%
distribute-neg-frac90.2%
metadata-eval90.2%
Simplified90.2%
frac-add90.2%
*-un-lft-identity90.2%
Applied egg-rr90.2%
*-commutative90.2%
neg-mul-190.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in b around inf 80.1%
associate-*r/80.1%
unpow280.1%
*-commutative80.1%
times-frac80.1%
Simplified80.1%
Final simplification62.2%
(FPCore (a b) :precision binary64 (if (<= b 7e-30) (* 0.5 (/ PI (* a (* b a)))) (* (/ PI a) (/ 0.5 (* b b)))))
double code(double a, double b) {
double tmp;
if (b <= 7e-30) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else {
tmp = (((double) M_PI) / a) * (0.5 / (b * b));
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 7e-30) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else {
tmp = (Math.PI / a) * (0.5 / (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 7e-30: tmp = 0.5 * (math.pi / (a * (b * a))) else: tmp = (math.pi / a) * (0.5 / (b * b)) return tmp
function code(a, b) tmp = 0.0 if (b <= 7e-30) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); else tmp = Float64(Float64(pi / a) * Float64(0.5 / Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 7e-30) tmp = 0.5 * (pi / (a * (b * a))); else tmp = (pi / a) * (0.5 / (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 7e-30], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi / a), $MachinePrecision] * N[(0.5 / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7 \cdot 10^{-30}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{a} \cdot \frac{0.5}{b \cdot b}\\
\end{array}
\end{array}
if b < 7.0000000000000006e-30Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
div-sub69.6%
Applied egg-rr69.6%
div-sub77.5%
difference-of-squares87.9%
*-commutative87.9%
associate-/l*99.5%
Simplified99.5%
inv-pow99.5%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
associate-*l*65.4%
Simplified65.4%
if 7.0000000000000006e-30 < b Initial program 77.8%
times-frac77.8%
*-commutative77.8%
times-frac77.8%
difference-of-squares90.1%
associate-/r*90.2%
metadata-eval90.2%
sub-neg90.2%
distribute-neg-frac90.2%
metadata-eval90.2%
Simplified90.2%
frac-add90.2%
*-un-lft-identity90.2%
Applied egg-rr90.2%
*-commutative90.2%
neg-mul-190.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in b around inf 80.1%
associate-*r/80.1%
unpow280.1%
*-commutative80.1%
times-frac80.1%
Simplified80.1%
Final simplification69.1%
(FPCore (a b) :precision binary64 (if (<= b 6.2e-30) (* 0.5 (/ PI (* a (* b a)))) (* 0.5 (/ PI (* a (* b b))))))
double code(double a, double b) {
double tmp;
if (b <= 6.2e-30) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else {
tmp = 0.5 * (((double) M_PI) / (a * (b * b)));
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 6.2e-30) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else {
tmp = 0.5 * (Math.PI / (a * (b * b)));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 6.2e-30: tmp = 0.5 * (math.pi / (a * (b * a))) else: tmp = 0.5 * (math.pi / (a * (b * b))) return tmp
function code(a, b) tmp = 0.0 if (b <= 6.2e-30) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); else tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 6.2e-30) tmp = 0.5 * (pi / (a * (b * a))); else tmp = 0.5 * (pi / (a * (b * b))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 6.2e-30], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(Pi / N[(a * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.2 \cdot 10^{-30}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}\\
\end{array}
\end{array}
if b < 6.19999999999999982e-30Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
div-sub69.6%
Applied egg-rr69.6%
div-sub77.5%
difference-of-squares87.9%
*-commutative87.9%
associate-/l*99.5%
Simplified99.5%
inv-pow99.5%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
associate-*l*65.4%
Simplified65.4%
if 6.19999999999999982e-30 < b Initial program 77.8%
*-commutative77.8%
associate-/r/77.7%
associate-*l/77.8%
*-commutative77.8%
associate-/r/77.8%
times-frac77.8%
Simplified77.9%
Taylor expanded in b around inf 80.1%
unpow280.1%
Simplified80.1%
Final simplification69.1%
(FPCore (a b) :precision binary64 (if (<= b 4.4e-30) (* 0.5 (/ PI (* a (* b a)))) (* 0.5 (/ PI (* b (* b a))))))
double code(double a, double b) {
double tmp;
if (b <= 4.4e-30) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else {
tmp = 0.5 * (((double) M_PI) / (b * (b * a)));
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 4.4e-30) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else {
tmp = 0.5 * (Math.PI / (b * (b * a)));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 4.4e-30: tmp = 0.5 * (math.pi / (a * (b * a))) else: tmp = 0.5 * (math.pi / (b * (b * a))) return tmp
function code(a, b) tmp = 0.0 if (b <= 4.4e-30) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); else tmp = Float64(0.5 * Float64(pi / Float64(b * Float64(b * a)))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 4.4e-30) tmp = 0.5 * (pi / (a * (b * a))); else tmp = 0.5 * (pi / (b * (b * a))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 4.4e-30], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(Pi / N[(b * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.4 \cdot 10^{-30}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{b \cdot \left(b \cdot a\right)}\\
\end{array}
\end{array}
if b < 4.39999999999999967e-30Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
div-sub69.6%
Applied egg-rr69.6%
div-sub77.5%
difference-of-squares87.9%
*-commutative87.9%
associate-/l*99.5%
Simplified99.5%
inv-pow99.5%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
associate-*l*65.4%
Simplified65.4%
if 4.39999999999999967e-30 < b Initial program 77.8%
*-commutative77.8%
associate-/r/77.7%
associate-*l/77.8%
*-commutative77.8%
associate-/r/77.8%
times-frac77.8%
Simplified77.9%
Taylor expanded in b around inf 80.1%
unpow280.1%
Simplified80.1%
Taylor expanded in a around 0 80.1%
unpow280.1%
*-commutative80.1%
associate-*l*88.6%
Simplified88.6%
Final simplification71.3%
(FPCore (a b) :precision binary64 (if (<= b 1e-29) (* 0.5 (/ PI (* a (* b a)))) (* (/ (/ PI a) b) (/ 0.5 b))))
double code(double a, double b) {
double tmp;
if (b <= 1e-29) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else {
tmp = ((((double) M_PI) / a) / b) * (0.5 / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 1e-29) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else {
tmp = ((Math.PI / a) / b) * (0.5 / b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 1e-29: tmp = 0.5 * (math.pi / (a * (b * a))) else: tmp = ((math.pi / a) / b) * (0.5 / b) return tmp
function code(a, b) tmp = 0.0 if (b <= 1e-29) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); else tmp = Float64(Float64(Float64(pi / a) / b) * Float64(0.5 / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 1e-29) tmp = 0.5 * (pi / (a * (b * a))); else tmp = ((pi / a) / b) * (0.5 / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 1e-29], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 10^{-29}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{b} \cdot \frac{0.5}{b}\\
\end{array}
\end{array}
if b < 9.99999999999999943e-30Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
div-sub69.6%
Applied egg-rr69.6%
div-sub77.5%
difference-of-squares87.9%
*-commutative87.9%
associate-/l*99.5%
Simplified99.5%
inv-pow99.5%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
associate-*l*65.4%
Simplified65.4%
if 9.99999999999999943e-30 < b Initial program 77.8%
times-frac77.8%
*-commutative77.8%
times-frac77.8%
difference-of-squares90.1%
associate-/r*90.2%
metadata-eval90.2%
sub-neg90.2%
distribute-neg-frac90.2%
metadata-eval90.2%
Simplified90.2%
frac-add90.2%
*-un-lft-identity90.2%
Applied egg-rr90.2%
*-commutative90.2%
neg-mul-190.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in b around inf 80.1%
associate-*r/80.1%
unpow280.1%
*-commutative80.1%
times-frac80.1%
Simplified80.1%
associate-*r/80.1%
Applied egg-rr80.1%
times-frac89.7%
Applied egg-rr89.7%
Final simplification71.5%
(FPCore (a b) :precision binary64 (if (<= b 1.05e-29) (* 0.5 (/ PI (* a (* b a)))) (* 0.5 (/ (/ (/ PI a) b) b))))
double code(double a, double b) {
double tmp;
if (b <= 1.05e-29) {
tmp = 0.5 * (((double) M_PI) / (a * (b * a)));
} else {
tmp = 0.5 * (((((double) M_PI) / a) / b) / b);
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 1.05e-29) {
tmp = 0.5 * (Math.PI / (a * (b * a)));
} else {
tmp = 0.5 * (((Math.PI / a) / b) / b);
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 1.05e-29: tmp = 0.5 * (math.pi / (a * (b * a))) else: tmp = 0.5 * (((math.pi / a) / b) / b) return tmp
function code(a, b) tmp = 0.0 if (b <= 1.05e-29) tmp = Float64(0.5 * Float64(pi / Float64(a * Float64(b * a)))); else tmp = Float64(0.5 * Float64(Float64(Float64(pi / a) / b) / b)); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 1.05e-29) tmp = 0.5 * (pi / (a * (b * a))); else tmp = 0.5 * (((pi / a) / b) / b); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 1.05e-29], N[(0.5 * N[(Pi / N[(a * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(N[(Pi / a), $MachinePrecision] / b), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.05 \cdot 10^{-29}:\\
\;\;\;\;0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot a\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{\frac{\frac{\pi}{a}}{b}}{b}\\
\end{array}
\end{array}
if b < 1.04999999999999995e-29Initial program 77.6%
*-commutative77.6%
associate-/r/77.6%
associate-*l/77.6%
*-commutative77.6%
associate-/r/77.6%
times-frac77.6%
Simplified77.7%
clear-num77.5%
inv-pow77.5%
Applied egg-rr77.5%
unpow-177.5%
fma-def77.5%
+-commutative77.5%
associate-*r/77.5%
*-commutative77.5%
associate-*r/77.5%
mul-1-neg77.5%
unsub-neg77.5%
Simplified77.5%
div-sub69.6%
Applied egg-rr69.6%
div-sub77.5%
difference-of-squares87.9%
*-commutative87.9%
associate-/l*99.5%
Simplified99.5%
inv-pow99.5%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in b around 0 56.2%
unpow256.2%
associate-*l*65.4%
Simplified65.4%
if 1.04999999999999995e-29 < b Initial program 77.8%
*-commutative77.8%
associate-/r/77.7%
associate-*l/77.8%
*-commutative77.8%
associate-/r/77.8%
times-frac77.8%
Simplified77.9%
clear-num77.9%
inv-pow77.9%
Applied egg-rr77.9%
unpow-177.9%
fma-def77.9%
+-commutative77.9%
associate-*r/77.9%
*-commutative77.9%
associate-*r/77.9%
mul-1-neg77.9%
unsub-neg77.9%
Simplified77.9%
div-sub68.6%
Applied egg-rr68.6%
div-sub77.9%
difference-of-squares90.1%
*-commutative90.1%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in b around inf 80.1%
associate-/r*80.1%
unpow280.1%
associate-/r*89.7%
Simplified89.7%
Final simplification71.5%
(FPCore (a b) :precision binary64 (* PI (/ 0.5 (* b (* a a)))))
double code(double a, double b) {
return ((double) M_PI) * (0.5 / (b * (a * a)));
}
public static double code(double a, double b) {
return Math.PI * (0.5 / (b * (a * a)));
}
def code(a, b): return math.pi * (0.5 / (b * (a * a)))
function code(a, b) return Float64(pi * Float64(0.5 / Float64(b * Float64(a * a)))) end
function tmp = code(a, b) tmp = pi * (0.5 / (b * (a * a))); end
code[a_, b_] := N[(Pi * N[(0.5 / N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \frac{0.5}{b \cdot \left(a \cdot a\right)}
\end{array}
Initial program 77.7%
Taylor expanded in b around 0 51.8%
associate-*r/51.8%
unpow251.8%
Simplified51.8%
Taylor expanded in a around 0 51.8%
associate-*r/51.8%
*-commutative51.8%
*-rgt-identity51.8%
*-commutative51.8%
unpow251.8%
associate-*r/51.7%
associate-*l*51.7%
associate-*r/51.7%
metadata-eval51.7%
unpow251.7%
*-commutative51.7%
unpow251.7%
Simplified51.7%
Final simplification51.7%
herbie shell --seed 2023224
(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))))