
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* c0 (* d d)) (* (* D D) (* w h))))
(t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
(if (<= t_1 INFINITY) t_1 (/ 0.0 (* w h)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = 0.0 / (w * h);
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = 0.0 / (w * h);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((D * D) * (w * h)) t_1 = (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = 0.0 / (w * h) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(0.0 / Float64(w * h)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((D * D) * (w * h)); t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = 0.0 / (w * h); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{w \cdot h}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 78.0%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified1.1%
Taylor expanded in c0 around -inf 0.1%
associate-*r/0.1%
unpow20.1%
neg-mul-10.1%
associate-*r*0.2%
unpow20.2%
Simplified0.2%
Taylor expanded in h around 0 1.3%
associate-*r/1.3%
Simplified38.4%
Final simplification51.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (or (<= w -4.8e+67)
(not
(or (<= w -1.2e-110) (and (not (<= w -1.15e-165)) (<= w 6.8e+20)))))
(/ 0.0 (* w h))
(* (/ c0 (* w h)) (* (/ c0 (* 2.0 w)) (* 2.0 (pow (/ d D) 2.0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -4.8e+67) || !((w <= -1.2e-110) || (!(w <= -1.15e-165) && (w <= 6.8e+20)))) {
tmp = 0.0 / (w * h);
} else {
tmp = (c0 / (w * h)) * ((c0 / (2.0 * w)) * (2.0 * pow((d / D), 2.0)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((w <= (-4.8d+67)) .or. (.not. (w <= (-1.2d-110)) .or. (.not. (w <= (-1.15d-165))) .and. (w <= 6.8d+20))) then
tmp = 0.0d0 / (w * h)
else
tmp = (c0 / (w * h)) * ((c0 / (2.0d0 * w)) * (2.0d0 * ((d_1 / d) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -4.8e+67) || !((w <= -1.2e-110) || (!(w <= -1.15e-165) && (w <= 6.8e+20)))) {
tmp = 0.0 / (w * h);
} else {
tmp = (c0 / (w * h)) * ((c0 / (2.0 * w)) * (2.0 * Math.pow((d / D), 2.0)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -4.8e+67) or not ((w <= -1.2e-110) or (not (w <= -1.15e-165) and (w <= 6.8e+20))): tmp = 0.0 / (w * h) else: tmp = (c0 / (w * h)) * ((c0 / (2.0 * w)) * (2.0 * math.pow((d / D), 2.0))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -4.8e+67) || !((w <= -1.2e-110) || (!(w <= -1.15e-165) && (w <= 6.8e+20)))) tmp = Float64(0.0 / Float64(w * h)); else tmp = Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * (Float64(d / D) ^ 2.0)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -4.8e+67) || ~(((w <= -1.2e-110) || (~((w <= -1.15e-165)) && (w <= 6.8e+20))))) tmp = 0.0 / (w * h); else tmp = (c0 / (w * h)) * ((c0 / (2.0 * w)) * (2.0 * ((d / D) ^ 2.0))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -4.8e+67], N[Not[Or[LessEqual[w, -1.2e-110], And[N[Not[LessEqual[w, -1.15e-165]], $MachinePrecision], LessEqual[w, 6.8e+20]]]], $MachinePrecision]], N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -4.8 \cdot 10^{+67} \lor \neg \left(w \leq -1.2 \cdot 10^{-110} \lor \neg \left(w \leq -1.15 \cdot 10^{-165}\right) \land w \leq 6.8 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{0}{w \cdot h}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{w \cdot h} \cdot \left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot {\left(\frac{d}{D}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if w < -4.80000000000000004e67 or -1.20000000000000003e-110 < w < -1.15e-165 or 6.8e20 < w Initial program 18.5%
Simplified17.5%
Taylor expanded in c0 around -inf 4.1%
associate-*r/4.1%
unpow24.1%
neg-mul-14.1%
associate-*r*5.0%
unpow25.0%
Simplified5.0%
Taylor expanded in h around 0 9.0%
associate-*r/9.0%
Simplified50.0%
if -4.80000000000000004e67 < w < -1.20000000000000003e-110 or -1.15e-165 < w < 6.8e20Initial program 31.5%
Simplified40.1%
Taylor expanded in D around 0 9.1%
fma-def9.1%
Simplified10.4%
fma-udef10.4%
associate-/r*10.4%
pow210.4%
*-commutative10.4%
*-commutative10.4%
Applied egg-rr44.9%
+-commutative44.9%
fma-udef44.9%
associate-+l+44.9%
Simplified46.5%
mul0-rgt48.3%
distribute-lft-in34.1%
*-commutative34.1%
*-commutative34.1%
pow234.1%
associate-*l*34.1%
pow234.1%
Applied egg-rr34.1%
+-lft-identity34.1%
distribute-lft-in48.3%
+-lft-identity48.3%
*-commutative48.3%
+-lft-identity48.3%
associate-*l*48.3%
*-commutative48.3%
*-commutative48.3%
Simplified48.3%
Final simplification49.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 (* w h)) (* (/ c0 (* 2.0 w)) (* 2.0 (pow (/ d D) 2.0)))))
(t_1 (/ 0.0 (* w h))))
(if (<= w -9.2e+67)
t_1
(if (<= w -6.4e-114)
t_0
(if (<= w -7e-174)
(fma (* c0 c0) 0.0 (/ (* 0.25 (* (* D D) (* h (* M M)))) (* d d)))
(if (<= w 3.25e+25) t_0 t_1))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (w * h)) * ((c0 / (2.0 * w)) * (2.0 * pow((d / D), 2.0)));
double t_1 = 0.0 / (w * h);
double tmp;
if (w <= -9.2e+67) {
tmp = t_1;
} else if (w <= -6.4e-114) {
tmp = t_0;
} else if (w <= -7e-174) {
tmp = fma((c0 * c0), 0.0, ((0.25 * ((D * D) * (h * (M * M)))) / (d * d)));
} else if (w <= 3.25e+25) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * (Float64(d / D) ^ 2.0)))) t_1 = Float64(0.0 / Float64(w * h)) tmp = 0.0 if (w <= -9.2e+67) tmp = t_1; elseif (w <= -6.4e-114) tmp = t_0; elseif (w <= -7e-174) tmp = fma(Float64(c0 * c0), 0.0, Float64(Float64(0.25 * Float64(Float64(D * D) * Float64(h * Float64(M * M)))) / Float64(d * d))); elseif (w <= 3.25e+25) tmp = t_0; else tmp = t_1; end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -9.2e+67], t$95$1, If[LessEqual[w, -6.4e-114], t$95$0, If[LessEqual[w, -7e-174], N[(N[(c0 * c0), $MachinePrecision] * 0.0 + N[(N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 3.25e+25], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h} \cdot \left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot {\left(\frac{d}{D}\right)}^{2}\right)\right)\\
t_1 := \frac{0}{w \cdot h}\\
\mathbf{if}\;w \leq -9.2 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq -6.4 \cdot 10^{-114}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -7 \cdot 10^{-174}:\\
\;\;\;\;\mathsf{fma}\left(c0 \cdot c0, 0, \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}\right)\\
\mathbf{elif}\;w \leq 3.25 \cdot 10^{+25}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if w < -9.1999999999999994e67 or 3.25000000000000003e25 < w Initial program 18.0%
Simplified16.9%
Taylor expanded in c0 around -inf 4.7%
associate-*r/4.7%
unpow24.7%
neg-mul-14.7%
associate-*r*5.7%
unpow25.7%
Simplified5.7%
Taylor expanded in h around 0 10.3%
associate-*r/10.3%
Simplified48.8%
if -9.1999999999999994e67 < w < -6.4000000000000003e-114 or -6.99999999999999975e-174 < w < 3.25000000000000003e25Initial program 31.5%
Simplified40.0%
Taylor expanded in D around 0 9.0%
fma-def9.0%
Simplified10.4%
fma-udef10.4%
associate-/r*10.4%
pow210.4%
*-commutative10.4%
*-commutative10.4%
Applied egg-rr44.9%
+-commutative44.9%
fma-udef44.9%
associate-+l+44.9%
Simplified46.5%
mul0-rgt48.3%
distribute-lft-in34.0%
*-commutative34.0%
*-commutative34.0%
pow234.0%
associate-*l*34.0%
pow234.0%
Applied egg-rr34.0%
+-lft-identity34.0%
distribute-lft-in48.3%
+-lft-identity48.3%
*-commutative48.3%
+-lft-identity48.3%
associate-*l*48.3%
*-commutative48.3%
*-commutative48.3%
Simplified48.3%
if -6.4000000000000003e-114 < w < -6.99999999999999975e-174Initial program 21.8%
distribute-lft-in21.8%
*-commutative21.8%
times-frac21.5%
frac-times22.0%
pow222.0%
*-commutative22.0%
Applied egg-rr29.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
distribute-rgt-out0.0%
metadata-eval0.0%
mul0-rgt59.2%
associate-*r/59.2%
unpow259.2%
*-commutative59.2%
unpow259.2%
unpow259.2%
Simplified59.2%
Final simplification49.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* c0 (* (/ c0 (* w h)) (* 2.0 (pow (/ d D) 2.0)))) (* 2.0 w)))
(t_1 (/ 0.0 (* w h))))
(if (<= w -2.5e+68)
t_1
(if (<= w -6.4e-114)
t_0
(if (<= w -8.5e-177)
(fma (* c0 c0) 0.0 (/ (* 0.25 (* (* D D) (* h (* M M)))) (* d d)))
(if (<= w 8.2e+20) t_0 t_1))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * ((c0 / (w * h)) * (2.0 * pow((d / D), 2.0)))) / (2.0 * w);
double t_1 = 0.0 / (w * h);
double tmp;
if (w <= -2.5e+68) {
tmp = t_1;
} else if (w <= -6.4e-114) {
tmp = t_0;
} else if (w <= -8.5e-177) {
tmp = fma((c0 * c0), 0.0, ((0.25 * ((D * D) * (h * (M * M)))) / (d * d)));
} else if (w <= 8.2e+20) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(Float64(c0 / Float64(w * h)) * Float64(2.0 * (Float64(d / D) ^ 2.0)))) / Float64(2.0 * w)) t_1 = Float64(0.0 / Float64(w * h)) tmp = 0.0 if (w <= -2.5e+68) tmp = t_1; elseif (w <= -6.4e-114) tmp = t_0; elseif (w <= -8.5e-177) tmp = fma(Float64(c0 * c0), 0.0, Float64(Float64(0.25 * Float64(Float64(D * D) * Float64(h * Float64(M * M)))) / Float64(d * d))); elseif (w <= 8.2e+20) tmp = t_0; else tmp = t_1; end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -2.5e+68], t$95$1, If[LessEqual[w, -6.4e-114], t$95$0, If[LessEqual[w, -8.5e-177], N[(N[(c0 * c0), $MachinePrecision] * 0.0 + N[(N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 8.2e+20], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(2 \cdot {\left(\frac{d}{D}\right)}^{2}\right)\right)}{2 \cdot w}\\
t_1 := \frac{0}{w \cdot h}\\
\mathbf{if}\;w \leq -2.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq -6.4 \cdot 10^{-114}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -8.5 \cdot 10^{-177}:\\
\;\;\;\;\mathsf{fma}\left(c0 \cdot c0, 0, \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}\right)\\
\mathbf{elif}\;w \leq 8.2 \cdot 10^{+20}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if w < -2.5000000000000002e68 or 8.2e20 < w Initial program 18.0%
Simplified16.9%
Taylor expanded in c0 around -inf 4.7%
associate-*r/4.7%
unpow24.7%
neg-mul-14.7%
associate-*r*5.7%
unpow25.7%
Simplified5.7%
Taylor expanded in h around 0 10.3%
associate-*r/10.3%
Simplified48.8%
if -2.5000000000000002e68 < w < -6.4000000000000003e-114 or -8.4999999999999993e-177 < w < 8.2e20Initial program 31.5%
Simplified40.0%
Taylor expanded in D around 0 9.0%
fma-def9.0%
Simplified10.4%
fma-udef10.4%
associate-/r*10.4%
pow210.4%
*-commutative10.4%
*-commutative10.4%
Applied egg-rr44.9%
+-commutative44.9%
fma-udef44.9%
associate-+l+44.9%
Simplified46.5%
associate-*l/46.5%
mul0-rgt48.3%
pow248.3%
associate-*l*48.3%
pow248.3%
*-commutative48.3%
Applied egg-rr48.3%
if -6.4000000000000003e-114 < w < -8.4999999999999993e-177Initial program 21.8%
distribute-lft-in21.8%
*-commutative21.8%
times-frac21.5%
frac-times22.0%
pow222.0%
*-commutative22.0%
Applied egg-rr29.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
distribute-rgt-out0.0%
metadata-eval0.0%
mul0-rgt59.2%
associate-*r/59.2%
unpow259.2%
*-commutative59.2%
unpow259.2%
unpow259.2%
Simplified59.2%
Final simplification49.0%
(FPCore (c0 w h D d M)
:precision binary64
(if (or (<= w -4.6e+67)
(and (not (<= w -7.6e-111))
(or (<= w -1.12e-166) (not (<= w 8.2e-38)))))
(/ 0.0 (* w h))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -4.6e+67) || (!(w <= -7.6e-111) && ((w <= -1.12e-166) || !(w <= 8.2e-38)))) {
tmp = 0.0 / (w * h);
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((w <= (-4.6d+67)) .or. (.not. (w <= (-7.6d-111))) .and. (w <= (-1.12d-166)) .or. (.not. (w <= 8.2d-38))) then
tmp = 0.0d0 / (w * h)
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -4.6e+67) || (!(w <= -7.6e-111) && ((w <= -1.12e-166) || !(w <= 8.2e-38)))) {
tmp = 0.0 / (w * h);
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -4.6e+67) or (not (w <= -7.6e-111) and ((w <= -1.12e-166) or not (w <= 8.2e-38))): tmp = 0.0 / (w * h) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -4.6e+67) || (!(w <= -7.6e-111) && ((w <= -1.12e-166) || !(w <= 8.2e-38)))) tmp = Float64(0.0 / Float64(w * h)); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -4.6e+67) || (~((w <= -7.6e-111)) && ((w <= -1.12e-166) || ~((w <= 8.2e-38))))) tmp = 0.0 / (w * h); else tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -4.6e+67], And[N[Not[LessEqual[w, -7.6e-111]], $MachinePrecision], Or[LessEqual[w, -1.12e-166], N[Not[LessEqual[w, 8.2e-38]], $MachinePrecision]]]], N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -4.6 \cdot 10^{+67} \lor \neg \left(w \leq -7.6 \cdot 10^{-111}\right) \land \left(w \leq -1.12 \cdot 10^{-166} \lor \neg \left(w \leq 8.2 \cdot 10^{-38}\right)\right):\\
\;\;\;\;\frac{0}{w \cdot h}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
\end{array}
\end{array}
if w < -4.5999999999999997e67 or -7.60000000000000045e-111 < w < -1.11999999999999994e-166 or 8.1999999999999996e-38 < w Initial program 18.1%
Simplified17.2%
Taylor expanded in c0 around -inf 4.7%
associate-*r/4.7%
unpow24.7%
neg-mul-14.7%
associate-*r*5.5%
unpow25.5%
Simplified5.5%
Taylor expanded in h around 0 9.2%
associate-*r/9.2%
Simplified48.4%
if -4.5999999999999997e67 < w < -7.60000000000000045e-111 or -1.11999999999999994e-166 < w < 8.1999999999999996e-38Initial program 32.5%
Simplified33.0%
Taylor expanded in c0 around inf 44.3%
associate-*r/44.3%
associate-*r*42.8%
*-commutative42.8%
unpow242.8%
*-commutative42.8%
associate-*r/42.8%
times-frac44.7%
unpow244.7%
unpow244.7%
*-commutative44.7%
unpow244.7%
Simplified44.7%
Final simplification46.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))))
(if (<= c0 -8.6e-126)
t_0
(if (<= c0 3.9e+110)
(* 0.0 (* c0 c0))
(if (or (<= c0 1.15e+194) (not (<= c0 1.2e+274)))
t_0
(/ 0.0 (* w h)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
double tmp;
if (c0 <= -8.6e-126) {
tmp = t_0;
} else if (c0 <= 3.9e+110) {
tmp = 0.0 * (c0 * c0);
} else if ((c0 <= 1.15e+194) || !(c0 <= 1.2e+274)) {
tmp = t_0;
} else {
tmp = 0.0 / (w * h);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (h * (w * w)))
if (c0 <= (-8.6d-126)) then
tmp = t_0
else if (c0 <= 3.9d+110) then
tmp = 0.0d0 * (c0 * c0)
else if ((c0 <= 1.15d+194) .or. (.not. (c0 <= 1.2d+274))) then
tmp = t_0
else
tmp = 0.0d0 / (w * h)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
double tmp;
if (c0 <= -8.6e-126) {
tmp = t_0;
} else if (c0 <= 3.9e+110) {
tmp = 0.0 * (c0 * c0);
} else if ((c0 <= 1.15e+194) || !(c0 <= 1.2e+274)) {
tmp = t_0;
} else {
tmp = 0.0 / (w * h);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))) tmp = 0 if c0 <= -8.6e-126: tmp = t_0 elif c0 <= 3.9e+110: tmp = 0.0 * (c0 * c0) elif (c0 <= 1.15e+194) or not (c0 <= 1.2e+274): tmp = t_0 else: tmp = 0.0 / (w * h) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w)))) tmp = 0.0 if (c0 <= -8.6e-126) tmp = t_0; elseif (c0 <= 3.9e+110) tmp = Float64(0.0 * Float64(c0 * c0)); elseif ((c0 <= 1.15e+194) || !(c0 <= 1.2e+274)) tmp = t_0; else tmp = Float64(0.0 / Float64(w * h)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))); tmp = 0.0; if (c0 <= -8.6e-126) tmp = t_0; elseif (c0 <= 3.9e+110) tmp = 0.0 * (c0 * c0); elseif ((c0 <= 1.15e+194) || ~((c0 <= 1.2e+274))) tmp = t_0; else tmp = 0.0 / (w * h); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -8.6e-126], t$95$0, If[LessEqual[c0, 3.9e+110], N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 1.15e+194], N[Not[LessEqual[c0, 1.2e+274]], $MachinePrecision]], t$95$0, N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;c0 \leq -8.6 \cdot 10^{-126}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+110}:\\
\;\;\;\;0 \cdot \left(c0 \cdot c0\right)\\
\mathbf{elif}\;c0 \leq 1.15 \cdot 10^{+194} \lor \neg \left(c0 \leq 1.2 \cdot 10^{+274}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{w \cdot h}\\
\end{array}
\end{array}
if c0 < -8.60000000000000065e-126 or 3.9000000000000003e110 < c0 < 1.15000000000000003e194 or 1.2e274 < c0 Initial program 35.4%
distribute-lft-in35.3%
*-commutative35.3%
times-frac33.8%
frac-times33.0%
pow233.0%
*-commutative33.0%
Applied egg-rr37.3%
Taylor expanded in c0 around inf 43.8%
times-frac43.0%
unpow243.0%
unpow243.0%
unpow243.0%
unpow243.0%
Simplified43.0%
if -8.60000000000000065e-126 < c0 < 3.9000000000000003e110Initial program 18.3%
distribute-lft-in18.3%
*-commutative18.3%
times-frac15.6%
frac-times16.7%
pow216.7%
*-commutative16.7%
Applied egg-rr28.3%
Taylor expanded in c0 around -inf 7.6%
unpow27.6%
distribute-rgt-out7.6%
metadata-eval7.6%
mul0-rgt43.5%
Simplified43.5%
if 1.15000000000000003e194 < c0 < 1.2e274Initial program 10.0%
Simplified10.1%
Taylor expanded in c0 around -inf 0.1%
associate-*r/0.1%
unpow20.1%
neg-mul-10.1%
associate-*r*0.1%
unpow20.1%
Simplified0.1%
Taylor expanded in h around 0 0.0%
associate-*r/0.0%
Simplified32.6%
Final simplification42.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))))
(if (<= c0 -2.55e-121)
t_0
(if (<= c0 2e+107)
(* 0.0 (* c0 c0))
(if (<= c0 5.4e+200)
(/ (* c0 c0) (/ (* (* h (* D D)) (* w w)) (* d d)))
(if (<= c0 1e+274) (/ 0.0 (* w h)) t_0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
double tmp;
if (c0 <= -2.55e-121) {
tmp = t_0;
} else if (c0 <= 2e+107) {
tmp = 0.0 * (c0 * c0);
} else if (c0 <= 5.4e+200) {
tmp = (c0 * c0) / (((h * (D * D)) * (w * w)) / (d * d));
} else if (c0 <= 1e+274) {
tmp = 0.0 / (w * h);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (h * (w * w)))
if (c0 <= (-2.55d-121)) then
tmp = t_0
else if (c0 <= 2d+107) then
tmp = 0.0d0 * (c0 * c0)
else if (c0 <= 5.4d+200) then
tmp = (c0 * c0) / (((h * (d * d)) * (w * w)) / (d_1 * d_1))
else if (c0 <= 1d+274) then
tmp = 0.0d0 / (w * h)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
double tmp;
if (c0 <= -2.55e-121) {
tmp = t_0;
} else if (c0 <= 2e+107) {
tmp = 0.0 * (c0 * c0);
} else if (c0 <= 5.4e+200) {
tmp = (c0 * c0) / (((h * (D * D)) * (w * w)) / (d * d));
} else if (c0 <= 1e+274) {
tmp = 0.0 / (w * h);
} else {
tmp = t_0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))) tmp = 0 if c0 <= -2.55e-121: tmp = t_0 elif c0 <= 2e+107: tmp = 0.0 * (c0 * c0) elif c0 <= 5.4e+200: tmp = (c0 * c0) / (((h * (D * D)) * (w * w)) / (d * d)) elif c0 <= 1e+274: tmp = 0.0 / (w * h) else: tmp = t_0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w)))) tmp = 0.0 if (c0 <= -2.55e-121) tmp = t_0; elseif (c0 <= 2e+107) tmp = Float64(0.0 * Float64(c0 * c0)); elseif (c0 <= 5.4e+200) tmp = Float64(Float64(c0 * c0) / Float64(Float64(Float64(h * Float64(D * D)) * Float64(w * w)) / Float64(d * d))); elseif (c0 <= 1e+274) tmp = Float64(0.0 / Float64(w * h)); else tmp = t_0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))); tmp = 0.0; if (c0 <= -2.55e-121) tmp = t_0; elseif (c0 <= 2e+107) tmp = 0.0 * (c0 * c0); elseif (c0 <= 5.4e+200) tmp = (c0 * c0) / (((h * (D * D)) * (w * w)) / (d * d)); elseif (c0 <= 1e+274) tmp = 0.0 / (w * h); else tmp = t_0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.55e-121], t$95$0, If[LessEqual[c0, 2e+107], N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 5.4e+200], N[(N[(c0 * c0), $MachinePrecision] / N[(N[(N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1e+274], N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;c0 \leq -2.55 \cdot 10^{-121}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq 2 \cdot 10^{+107}:\\
\;\;\;\;0 \cdot \left(c0 \cdot c0\right)\\
\mathbf{elif}\;c0 \leq 5.4 \cdot 10^{+200}:\\
\;\;\;\;\frac{c0 \cdot c0}{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(w \cdot w\right)}{d \cdot d}}\\
\mathbf{elif}\;c0 \leq 10^{+274}:\\
\;\;\;\;\frac{0}{w \cdot h}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if c0 < -2.5499999999999999e-121 or 9.99999999999999921e273 < c0 Initial program 35.4%
distribute-lft-in35.3%
*-commutative35.3%
times-frac34.4%
frac-times33.5%
pow233.5%
*-commutative33.5%
Applied egg-rr37.6%
Taylor expanded in c0 around inf 43.1%
times-frac42.2%
unpow242.2%
unpow242.2%
unpow242.2%
unpow242.2%
Simplified42.2%
if -2.5499999999999999e-121 < c0 < 1.9999999999999999e107Initial program 18.3%
distribute-lft-in18.3%
*-commutative18.3%
times-frac15.6%
frac-times16.7%
pow216.7%
*-commutative16.7%
Applied egg-rr28.3%
Taylor expanded in c0 around -inf 7.6%
unpow27.6%
distribute-rgt-out7.6%
metadata-eval7.6%
mul0-rgt43.5%
Simplified43.5%
if 1.9999999999999999e107 < c0 < 5.40000000000000031e200Initial program 33.5%
Taylor expanded in c0 around inf 45.3%
associate-/l*45.3%
unpow245.3%
associate-*r*50.7%
unpow250.7%
unpow250.7%
unpow250.7%
Simplified50.7%
if 5.40000000000000031e200 < c0 < 9.99999999999999921e273Initial program 10.5%
Simplified10.6%
Taylor expanded in c0 around -inf 0.1%
associate-*r/0.1%
unpow20.1%
neg-mul-10.1%
associate-*r*0.1%
unpow20.1%
Simplified0.1%
Taylor expanded in h around 0 0.0%
associate-*r/0.0%
Simplified34.3%
Final simplification42.8%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* d d) INFINITY) (* 0.5 (/ c0 (/ w (* (* d d) 0.0)))) (* (/ c0 (* 2.0 w)) 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= ((double) INFINITY)) {
tmp = 0.5 * (c0 / (w / ((d * d) * 0.0)));
} else {
tmp = (c0 / (2.0 * w)) * 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= Double.POSITIVE_INFINITY) {
tmp = 0.5 * (c0 / (w / ((d * d) * 0.0)));
} else {
tmp = (c0 / (2.0 * w)) * 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d * d) <= math.inf: tmp = 0.5 * (c0 / (w / ((d * d) * 0.0))) else: tmp = (c0 / (2.0 * w)) * 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(d * d) <= Inf) tmp = Float64(0.5 * Float64(c0 / Float64(w / Float64(Float64(d * d) * 0.0)))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d * d) <= Inf) tmp = 0.5 * (c0 / (w / ((d * d) * 0.0))); else tmp = (c0 / (2.0 * w)) * 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], Infinity], N[(0.5 * N[(c0 / N[(w / N[(N[(d * d), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq \infty:\\
\;\;\;\;0.5 \cdot \frac{c0}{\frac{w}{\left(d \cdot d\right) \cdot 0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
\end{array}
\end{array}
if (*.f64 d d) < +inf.0Initial program 26.2%
Simplified26.1%
Taylor expanded in c0 around -inf 3.5%
associate-*r/3.5%
unpow23.5%
neg-mul-13.5%
associate-*r*4.3%
unpow24.3%
Simplified4.3%
frac-times4.3%
Applied egg-rr4.3%
Taylor expanded in d around 0 5.0%
associate-/l*5.0%
unpow25.0%
distribute-lft1-in5.0%
metadata-eval5.0%
mul0-lft18.1%
Simplified18.1%
if +inf.0 < (*.f64 d d) Initial program 26.2%
Simplified26.1%
Taylor expanded in c0 around -inf 4.6%
mul-1-neg4.6%
distribute-lft-in3.8%
Simplified29.3%
Final simplification18.1%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* D D) 3e-94) (/ 0.0 (* w h)) (/ 0.0 (* w (* D D)))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 3e-94) {
tmp = 0.0 / (w * h);
} else {
tmp = 0.0 / (w * (D * D));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((d * d) <= 3d-94) then
tmp = 0.0d0 / (w * h)
else
tmp = 0.0d0 / (w * (d * d))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 3e-94) {
tmp = 0.0 / (w * h);
} else {
tmp = 0.0 / (w * (D * D));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 3e-94: tmp = 0.0 / (w * h) else: tmp = 0.0 / (w * (D * D)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 3e-94) tmp = Float64(0.0 / Float64(w * h)); else tmp = Float64(0.0 / Float64(w * Float64(D * D))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 3e-94) tmp = 0.0 / (w * h); else tmp = 0.0 / (w * (D * D)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 3e-94], N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision], N[(0.0 / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 3 \cdot 10^{-94}:\\
\;\;\;\;\frac{0}{w \cdot h}\\
\mathbf{else}:\\
\;\;\;\;\frac{0}{w \cdot \left(D \cdot D\right)}\\
\end{array}
\end{array}
if (*.f64 D D) < 3.0000000000000001e-94Initial program 25.3%
Simplified25.1%
Taylor expanded in c0 around -inf 2.0%
associate-*r/2.0%
unpow22.0%
neg-mul-12.0%
associate-*r*2.6%
unpow22.6%
Simplified2.6%
Taylor expanded in h around 0 5.1%
associate-*r/5.1%
Simplified32.4%
if 3.0000000000000001e-94 < (*.f64 D D) Initial program 27.9%
Simplified27.9%
Taylor expanded in c0 around -inf 6.0%
associate-*r/6.0%
unpow26.0%
neg-mul-16.0%
associate-*r*7.5%
unpow27.5%
Simplified7.5%
Taylor expanded in D around 0 4.7%
associate-*r/4.7%
Simplified31.3%
Final simplification32.0%
(FPCore (c0 w h D d M) :precision binary64 (* 0.0 (* c0 c0)))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0 * (c0 * c0);
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.0d0 * (c0 * c0)
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0 * (c0 * c0);
}
def code(c0, w, h, D, d, M): return 0.0 * (c0 * c0)
function code(c0, w, h, D, d, M) return Float64(0.0 * Float64(c0 * c0)) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0 * (c0 * c0); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0 \cdot \left(c0 \cdot c0\right)
\end{array}
Initial program 26.2%
distribute-lft-in26.2%
*-commutative26.2%
times-frac24.3%
frac-times24.3%
pow224.3%
*-commutative24.3%
Applied egg-rr31.4%
Taylor expanded in c0 around -inf 4.4%
unpow24.4%
distribute-rgt-out4.4%
metadata-eval4.4%
mul0-rgt25.1%
Simplified25.1%
Final simplification25.1%
(FPCore (c0 w h D d M) :precision binary64 (/ 0.0 (* w h)))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0 / (w * h);
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.0d0 / (w * h)
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0 / (w * h);
}
def code(c0, w, h, D, d, M): return 0.0 / (w * h)
function code(c0, w, h, D, d, M) return Float64(0.0 / Float64(w * h)) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0 / (w * h); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0}{w \cdot h}
\end{array}
Initial program 26.2%
Simplified26.1%
Taylor expanded in c0 around -inf 3.5%
associate-*r/3.5%
unpow23.5%
neg-mul-13.5%
associate-*r*4.3%
unpow24.3%
Simplified4.3%
Taylor expanded in h around 0 5.0%
associate-*r/5.0%
Simplified30.0%
Final simplification30.0%
herbie shell --seed 2023277
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
:precision binary64
(* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))