
(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))) (* (* w h) D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(*
t_1
(+
t_0
(sqrt (* (+ M (* (/ c0 (* w h)) (* (/ d D) (/ d D)))) (- t_0 M)))))
(* 0.25 (* (pow (/ D d) 2.0) (* h (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * (d / D))) / ((w * h) * D);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_1 * (t_0 + sqrt(((M + ((c0 / (w * h)) * ((d / D) * (d / D)))) * (t_0 - M))));
} else {
tmp = 0.25 * (pow((D / d), 2.0) * (h * (M * M)));
}
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))) / ((w * h) * D);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * (t_0 + Math.sqrt(((M + ((c0 / (w * h)) * ((d / D) * (d / D)))) * (t_0 - M))));
} else {
tmp = 0.25 * (Math.pow((D / d), 2.0) * (h * (M * M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * (d / D))) / ((w * h) * D) t_1 = c0 / (2.0 * w) t_2 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))) <= math.inf: tmp = t_1 * (t_0 + math.sqrt(((M + ((c0 / (w * h)) * ((d / D) * (d / D)))) * (t_0 - M)))) else: tmp = 0.25 * (math.pow((D / d), 2.0) * (h * (M * M))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * Float64(d / D))) / Float64(Float64(w * h) * D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_1 * Float64(t_0 + sqrt(Float64(Float64(M + Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) * Float64(d / D)))) * Float64(t_0 - M))))); else tmp = Float64(0.25 * Float64((Float64(D / d) ^ 2.0) * Float64(h * Float64(M * M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * (d / D))) / ((w * h) * D); t_1 = c0 / (2.0 * w); t_2 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= Inf) tmp = t_1 * (t_0 + sqrt(((M + ((c0 / (w * h)) * ((d / D) * (d / D)))) * (t_0 - M)))); else tmp = 0.25 * (((D / d) ^ 2.0) * (h * (M * M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(t$95$0 + N[Sqrt[N[(N[(M + N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot \frac{d}{D}\right)}{\left(w \cdot h\right) \cdot D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_1 \cdot \left(t_0 + \sqrt{\left(M + \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right) \cdot \left(t_0 - M\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\
\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 68.3%
times-frac66.9%
fma-def66.9%
associate-/r*66.9%
difference-of-squares66.9%
Simplified71.6%
associate-/l*71.6%
associate-/r/71.7%
Applied egg-rr71.7%
fma-udef72.9%
associate-*l/72.9%
frac-times72.9%
associate-*l/72.9%
*-commutative72.9%
associate-*l/72.8%
associate-/l*72.9%
Applied egg-rr72.9%
fma-udef72.9%
div-inv72.9%
clear-num72.9%
Applied egg-rr72.9%
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%
Taylor expanded in c0 around -inf 0.6%
fma-def0.6%
times-frac1.7%
unpow21.7%
unpow21.7%
*-commutative1.7%
unpow21.7%
associate-*r*1.7%
Simplified30.0%
Taylor expanded in c0 around 0 39.0%
associate-/l*37.9%
*-commutative37.9%
unpow237.9%
unpow237.9%
*-commutative37.9%
unpow237.9%
Simplified37.9%
associate-/r/39.0%
frac-times50.6%
pow250.6%
Applied egg-rr50.6%
Final simplification57.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* w h)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(* t_1 (fma t_0 (/ (/ (* d d) D) D) (* t_0 (/ (* d d) (* D D)))))
(* 0.25 (* (pow (/ D d) 2.0) (* h (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_1 * fma(t_0, (((d * d) / D) / D), (t_0 * ((d * d) / (D * D))));
} else {
tmp = 0.25 * (pow((D / d), 2.0) * (h * (M * M)));
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_1 * fma(t_0, Float64(Float64(Float64(d * d) / D) / D), Float64(t_0 * Float64(Float64(d * d) / Float64(D * D))))); else tmp = Float64(0.25 * Float64((Float64(D / d) ^ 2.0) * Float64(h * Float64(M * M)))); end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(t$95$0 * N[(N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision] / D), $MachinePrecision] + N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_1 \cdot \mathsf{fma}\left(t_0, \frac{\frac{d \cdot d}{D}}{D}, t_0 \cdot \frac{d \cdot d}{D \cdot D}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\
\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 68.3%
times-frac66.9%
fma-def66.9%
associate-/r*66.9%
difference-of-squares66.9%
Simplified71.6%
Taylor expanded in c0 around inf 68.3%
times-frac72.2%
unpow272.2%
unpow272.2%
Simplified72.2%
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%
Taylor expanded in c0 around -inf 0.6%
fma-def0.6%
times-frac1.7%
unpow21.7%
unpow21.7%
*-commutative1.7%
unpow21.7%
associate-*r*1.7%
Simplified30.0%
Taylor expanded in c0 around 0 39.0%
associate-/l*37.9%
*-commutative37.9%
unpow237.9%
unpow237.9%
*-commutative37.9%
unpow237.9%
Simplified37.9%
associate-/r/39.0%
frac-times50.6%
pow250.6%
Applied egg-rr50.6%
Final simplification56.9%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 1e+183) (* 0.25 (* (pow (/ D d) 2.0) (* h (* M M)))) (* (/ c0 (* 2.0 w)) (* 2.0 (/ (* (/ (* d d) w) (/ c0 h)) (* D D))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+183) {
tmp = 0.25 * (pow((D / d), 2.0) * (h * (M * M)));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / 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 ((m * m) <= 1d+183) then
tmp = 0.25d0 * (((d / d_1) ** 2.0d0) * (h * (m * m)))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((((d_1 * d_1) / w) * (c0 / 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 ((M * M) <= 1e+183) {
tmp = 0.25 * (Math.pow((D / d), 2.0) * (h * (M * M)));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 1e+183: tmp = 0.25 * (math.pow((D / d), 2.0) * (h * (M * M))) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 1e+183) tmp = Float64(0.25 * Float64((Float64(D / d) ^ 2.0) * Float64(h * Float64(M * M)))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(Float64(d * d) / w) * Float64(c0 / h)) / Float64(D * D)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 1e+183) tmp = 0.25 * (((D / d) ^ 2.0) * (h * (M * M))); else tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+183], N[(0.25 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(N[(d * d), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 10^{+183}:\\
\;\;\;\;0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot d}{w} \cdot \frac{c0}{h}}{D \cdot D}\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 9.99999999999999947e182Initial program 24.0%
Taylor expanded in c0 around -inf 5.5%
fma-def5.5%
times-frac6.1%
unpow26.1%
unpow26.1%
*-commutative6.1%
unpow26.1%
associate-*r*6.1%
Simplified32.6%
Taylor expanded in c0 around 0 41.9%
associate-/l*41.4%
*-commutative41.4%
unpow241.4%
unpow241.4%
*-commutative41.4%
unpow241.4%
Simplified41.4%
associate-/r/42.5%
frac-times49.5%
pow249.5%
Applied egg-rr49.5%
if 9.99999999999999947e182 < (*.f64 M M) Initial program 11.3%
times-frac11.3%
fma-def11.3%
associate-/r*11.3%
difference-of-squares37.8%
Simplified41.9%
associate-/l*41.9%
associate-/r/41.9%
Applied egg-rr41.9%
Taylor expanded in c0 around inf 41.1%
*-commutative41.1%
unpow241.1%
associate-*l*44.7%
*-commutative44.7%
associate-*r*44.9%
unpow244.9%
associate-/r*45.0%
unpow245.0%
associate-/r*45.1%
associate-*l*42.6%
unpow242.6%
*-commutative42.6%
associate-/r*41.2%
times-frac42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
Final simplification47.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (/ (* (/ (* d d) w) (/ c0 h)) (* D D))))))
(if (<= (* d d) 2e-263)
(*
(/ c0 w)
(/ (* 0.5 (* (* (/ D d) (/ D d)) (/ w (/ c0 (* h (* M M)))))) 2.0))
(if (<= (* d d) 5e-25)
t_0
(if (<= (* d d) 5e+24)
(* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M)))))
(if (<= (* d d) 5e+270) t_0 0.0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D)));
double tmp;
if ((d * d) <= 2e-263) {
tmp = (c0 / w) * ((0.5 * (((D / d) * (D / d)) * (w / (c0 / (h * (M * M)))))) / 2.0);
} else if ((d * d) <= 5e-25) {
tmp = t_0;
} else if ((d * d) <= 5e+24) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else if ((d * d) <= 5e+270) {
tmp = t_0;
} else {
tmp = 0.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 / (2.0d0 * w)) * (2.0d0 * ((((d_1 * d_1) / w) * (c0 / h)) / (d * d)))
if ((d_1 * d_1) <= 2d-263) then
tmp = (c0 / w) * ((0.5d0 * (((d / d_1) * (d / d_1)) * (w / (c0 / (h * (m * m)))))) / 2.0d0)
else if ((d_1 * d_1) <= 5d-25) then
tmp = t_0
else if ((d_1 * d_1) <= 5d+24) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else if ((d_1 * d_1) <= 5d+270) then
tmp = t_0
else
tmp = 0.0d0
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 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D)));
double tmp;
if ((d * d) <= 2e-263) {
tmp = (c0 / w) * ((0.5 * (((D / d) * (D / d)) * (w / (c0 / (h * (M * M)))))) / 2.0);
} else if ((d * d) <= 5e-25) {
tmp = t_0;
} else if ((d * d) <= 5e+24) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else if ((d * d) <= 5e+270) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))) tmp = 0 if (d * d) <= 2e-263: tmp = (c0 / w) * ((0.5 * (((D / d) * (D / d)) * (w / (c0 / (h * (M * M)))))) / 2.0) elif (d * d) <= 5e-25: tmp = t_0 elif (d * d) <= 5e+24: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) elif (d * d) <= 5e+270: tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(Float64(d * d) / w) * Float64(c0 / h)) / Float64(D * D)))) tmp = 0.0 if (Float64(d * d) <= 2e-263) tmp = Float64(Float64(c0 / w) * Float64(Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(w / Float64(c0 / Float64(h * Float64(M * M)))))) / 2.0)); elseif (Float64(d * d) <= 5e-25) tmp = t_0; elseif (Float64(d * d) <= 5e+24) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); elseif (Float64(d * d) <= 5e+270) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))); tmp = 0.0; if ((d * d) <= 2e-263) tmp = (c0 / w) * ((0.5 * (((D / d) * (D / d)) * (w / (c0 / (h * (M * M)))))) / 2.0); elseif ((d * d) <= 5e-25) tmp = t_0; elseif ((d * d) <= 5e+24) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); elseif ((d * d) <= 5e+270) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(N[(d * d), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 2e-263], N[(N[(c0 / w), $MachinePrecision] * N[(N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(w / N[(c0 / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 5e-25], t$95$0, If[LessEqual[N[(d * d), $MachinePrecision], 5e+24], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 5e+270], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot d}{w} \cdot \frac{c0}{h}}{D \cdot D}\right)\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-263}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w}{\frac{c0}{h \cdot \left(M \cdot M\right)}}\right)}{2}\\
\mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+24}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+270}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 2e-263Initial program 0.1%
Taylor expanded in c0 around -inf 4.3%
fma-def4.3%
times-frac4.3%
unpow24.3%
unpow24.3%
*-commutative4.3%
unpow24.3%
associate-*r*4.3%
Simplified13.0%
associate-*l/13.0%
times-frac47.0%
mul0-rgt47.0%
*-commutative47.0%
Applied egg-rr47.0%
times-frac46.7%
fma-udef46.7%
+-rgt-identity46.7%
associate-/l*42.5%
Simplified42.5%
if 2e-263 < (*.f64 d d) < 4.99999999999999962e-25 or 5.00000000000000045e24 < (*.f64 d d) < 4.99999999999999976e270Initial program 35.1%
times-frac34.2%
fma-def34.3%
associate-/r*34.3%
difference-of-squares43.5%
Simplified48.8%
associate-/l*48.8%
associate-/r/48.8%
Applied egg-rr48.8%
Taylor expanded in c0 around inf 47.6%
*-commutative47.6%
unpow247.6%
associate-*l*47.6%
*-commutative47.6%
associate-*r*45.5%
unpow245.5%
associate-/r*47.0%
unpow247.0%
associate-/r*49.7%
associate-*l*49.7%
unpow249.7%
*-commutative49.7%
associate-/r*47.6%
times-frac51.8%
unpow251.8%
unpow251.8%
Simplified51.8%
if 4.99999999999999962e-25 < (*.f64 d d) < 5.00000000000000045e24Initial program 9.5%
Taylor expanded in c0 around -inf 9.9%
fma-def9.9%
times-frac9.5%
unpow29.5%
unpow29.5%
*-commutative9.5%
unpow29.5%
associate-*r*9.5%
Simplified45.8%
Taylor expanded in c0 around 0 64.3%
associate-/l*64.4%
*-commutative64.4%
unpow264.4%
unpow264.4%
*-commutative64.4%
unpow264.4%
Simplified64.4%
times-frac64.5%
Applied egg-rr64.5%
if 4.99999999999999976e270 < (*.f64 d d) Initial program 10.7%
times-frac10.7%
fma-def10.7%
associate-/r*10.7%
difference-of-squares19.6%
Simplified26.9%
Taylor expanded in c0 around -inf 1.8%
associate-*r*1.8%
distribute-rgt1-in1.8%
metadata-eval1.8%
mul0-lft41.3%
metadata-eval41.3%
mul0-lft2.6%
metadata-eval2.6%
distribute-lft1-in2.6%
*-commutative2.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft41.3%
Simplified41.3%
Taylor expanded in c0 around 0 47.6%
Final simplification49.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* M M) 5.5e-246)
0.0
(if (<= (* M M) 1.15e+189)
(* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M)))))
(* (/ c0 (* 2.0 w)) (* 2.0 (/ (* (/ (* d d) w) (/ c0 h)) (* D D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 5.5e-246) {
tmp = 0.0;
} else if ((M * M) <= 1.15e+189) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / 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 ((m * m) <= 5.5d-246) then
tmp = 0.0d0
else if ((m * m) <= 1.15d+189) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((((d_1 * d_1) / w) * (c0 / 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 ((M * M) <= 5.5e-246) {
tmp = 0.0;
} else if ((M * M) <= 1.15e+189) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 5.5e-246: tmp = 0.0 elif (M * M) <= 1.15e+189: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 5.5e-246) tmp = 0.0; elseif (Float64(M * M) <= 1.15e+189) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(Float64(d * d) / w) * Float64(c0 / h)) / Float64(D * D)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 5.5e-246) tmp = 0.0; elseif ((M * M) <= 1.15e+189) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); else tmp = (c0 / (2.0 * w)) * (2.0 * ((((d * d) / w) * (c0 / h)) / (D * D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 5.5e-246], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 1.15e+189], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(N[(d * d), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 5.5 \cdot 10^{-246}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 1.15 \cdot 10^{+189}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot d}{w} \cdot \frac{c0}{h}}{D \cdot D}\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 5.49999999999999982e-246Initial program 27.5%
times-frac26.2%
fma-def26.2%
associate-/r*26.2%
difference-of-squares26.2%
Simplified32.1%
Taylor expanded in c0 around -inf 3.0%
associate-*r*3.0%
distribute-rgt1-in3.0%
metadata-eval3.0%
mul0-lft38.4%
metadata-eval38.4%
mul0-lft5.5%
metadata-eval5.5%
distribute-lft1-in5.5%
*-commutative5.5%
distribute-lft1-in5.5%
metadata-eval5.5%
mul0-lft38.4%
Simplified38.4%
Taylor expanded in c0 around 0 44.7%
if 5.49999999999999982e-246 < (*.f64 M M) < 1.15e189Initial program 20.9%
Taylor expanded in c0 around -inf 6.8%
fma-def6.8%
times-frac7.9%
unpow27.9%
unpow27.9%
*-commutative7.9%
unpow27.9%
associate-*r*7.9%
Simplified32.7%
Taylor expanded in c0 around 0 46.9%
associate-/l*45.8%
*-commutative45.8%
unpow245.8%
unpow245.8%
*-commutative45.8%
unpow245.8%
Simplified45.8%
times-frac50.9%
Applied egg-rr50.9%
if 1.15e189 < (*.f64 M M) Initial program 11.3%
times-frac11.3%
fma-def11.3%
associate-/r*11.3%
difference-of-squares37.8%
Simplified41.9%
associate-/l*41.9%
associate-/r/41.9%
Applied egg-rr41.9%
Taylor expanded in c0 around inf 41.1%
*-commutative41.1%
unpow241.1%
associate-*l*44.7%
*-commutative44.7%
associate-*r*44.9%
unpow244.9%
associate-/r*45.0%
unpow245.0%
associate-/r*45.1%
associate-*l*42.6%
unpow242.6%
*-commutative42.6%
associate-/r*41.2%
times-frac42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
Final simplification46.3%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 1.2e-121)
0.0
(if (<= M 3.25e+122)
(* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M)))))
(* (/ (* d d) (* D D)) (/ (* c0 c0) (* h (* w w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 1.2e-121) {
tmp = 0.0;
} else if (M <= 3.25e+122) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
}
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 (m <= 1.2d-121) then
tmp = 0.0d0
else if (m <= 3.25d+122) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else
tmp = ((d_1 * d_1) / (d * d)) * ((c0 * c0) / (h * (w * w)))
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 (M <= 1.2e-121) {
tmp = 0.0;
} else if (M <= 3.25e+122) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 1.2e-121: tmp = 0.0 elif M <= 3.25e+122: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) else: tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 1.2e-121) tmp = 0.0; elseif (M <= 3.25e+122) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); else tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 1.2e-121) tmp = 0.0; elseif (M <= 3.25e+122) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); else tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.2e-121], 0.0, If[LessEqual[M, 3.25e+122], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.2 \cdot 10^{-121}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 3.25 \cdot 10^{+122}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\end{array}
\end{array}
if M < 1.20000000000000002e-121Initial program 21.7%
times-frac21.1%
fma-def21.1%
associate-/r*21.1%
difference-of-squares29.0%
Simplified35.4%
Taylor expanded in c0 around -inf 2.0%
associate-*r*2.0%
distribute-rgt1-in2.0%
metadata-eval2.0%
mul0-lft32.0%
metadata-eval32.0%
mul0-lft2.6%
metadata-eval2.6%
distribute-lft1-in2.6%
*-commutative2.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft32.0%
Simplified32.0%
Taylor expanded in c0 around 0 37.3%
if 1.20000000000000002e-121 < M < 3.24999999999999982e122Initial program 22.2%
Taylor expanded in c0 around -inf 7.0%
fma-def7.0%
times-frac9.3%
unpow29.3%
unpow29.3%
*-commutative9.3%
unpow29.3%
associate-*r*9.3%
Simplified33.5%
Taylor expanded in c0 around 0 38.4%
associate-/l*36.1%
*-commutative36.1%
unpow236.1%
unpow236.1%
*-commutative36.1%
unpow236.1%
Simplified36.1%
times-frac38.4%
Applied egg-rr38.4%
if 3.24999999999999982e122 < M Initial program 6.7%
times-frac6.7%
fma-def6.7%
associate-/r*6.7%
difference-of-squares30.3%
Simplified30.7%
Taylor expanded in c0 around inf 24.4%
times-frac24.5%
unpow224.5%
unpow224.5%
unpow224.5%
*-commutative24.5%
unpow224.5%
Simplified24.5%
Final simplification36.0%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 2e-124)
0.0
(if (<= M 1.55e+129)
(* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M)))))
(/ (* (* d d) (* c0 c0)) (* (* D D) (* h (* w w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 2e-124) {
tmp = 0.0;
} else if (M <= 1.55e+129) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
}
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 (m <= 2d-124) then
tmp = 0.0d0
else if (m <= 1.55d+129) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else
tmp = ((d_1 * d_1) * (c0 * c0)) / ((d * d) * (h * (w * w)))
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 (M <= 2e-124) {
tmp = 0.0;
} else if (M <= 1.55e+129) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 2e-124: tmp = 0.0 elif M <= 1.55e+129: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) else: tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 2e-124) tmp = 0.0; elseif (M <= 1.55e+129) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); else tmp = Float64(Float64(Float64(d * d) * Float64(c0 * c0)) / Float64(Float64(D * D) * Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 2e-124) tmp = 0.0; elseif (M <= 1.55e+129) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); else tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 2e-124], 0.0, If[LessEqual[M, 1.55e+129], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2 \cdot 10^{-124}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.55 \cdot 10^{+129}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\\
\end{array}
\end{array}
if M < 1.99999999999999987e-124Initial program 21.7%
times-frac21.1%
fma-def21.1%
associate-/r*21.1%
difference-of-squares29.0%
Simplified35.4%
Taylor expanded in c0 around -inf 2.0%
associate-*r*2.0%
distribute-rgt1-in2.0%
metadata-eval2.0%
mul0-lft32.0%
metadata-eval32.0%
mul0-lft2.6%
metadata-eval2.6%
distribute-lft1-in2.6%
*-commutative2.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft32.0%
Simplified32.0%
Taylor expanded in c0 around 0 37.3%
if 1.99999999999999987e-124 < M < 1.55e129Initial program 24.9%
Taylor expanded in c0 around -inf 6.6%
fma-def6.6%
times-frac8.7%
unpow28.7%
unpow28.7%
*-commutative8.7%
unpow28.7%
associate-*r*8.7%
Simplified33.6%
Taylor expanded in c0 around 0 38.1%
associate-/l*36.0%
*-commutative36.0%
unpow236.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
times-frac38.1%
Applied egg-rr38.1%
if 1.55e129 < M Initial program 0.0%
times-frac0.0%
fma-def0.0%
associate-/r*0.0%
difference-of-squares26.2%
Simplified26.7%
associate-/l*26.7%
associate-/r/26.7%
Applied egg-rr26.7%
Taylor expanded in c0 around inf 19.7%
unpow219.7%
unpow219.7%
unpow219.7%
*-commutative19.7%
unpow219.7%
Simplified19.7%
Final simplification35.6%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 1.2e-122)
0.0
(if (<= M 1.65e+129)
(* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M)))))
(/ (* (* d d) (* c0 c0)) (* h (* (* D D) (* w w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 1.2e-122) {
tmp = 0.0;
} else if (M <= 1.65e+129) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) * (c0 * c0)) / (h * ((D * D) * (w * w)));
}
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 (m <= 1.2d-122) then
tmp = 0.0d0
else if (m <= 1.65d+129) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else
tmp = ((d_1 * d_1) * (c0 * c0)) / (h * ((d * d) * (w * w)))
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 (M <= 1.2e-122) {
tmp = 0.0;
} else if (M <= 1.65e+129) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = ((d * d) * (c0 * c0)) / (h * ((D * D) * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 1.2e-122: tmp = 0.0 elif M <= 1.65e+129: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) else: tmp = ((d * d) * (c0 * c0)) / (h * ((D * D) * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 1.2e-122) tmp = 0.0; elseif (M <= 1.65e+129) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); else tmp = Float64(Float64(Float64(d * d) * Float64(c0 * c0)) / Float64(h * Float64(Float64(D * D) * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 1.2e-122) tmp = 0.0; elseif (M <= 1.65e+129) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); else tmp = ((d * d) * (c0 * c0)) / (h * ((D * D) * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.2e-122], 0.0, If[LessEqual[M, 1.65e+129], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(h * N[(N[(D * D), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.2 \cdot 10^{-122}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.65 \cdot 10^{+129}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(\left(D \cdot D\right) \cdot \left(w \cdot w\right)\right)}\\
\end{array}
\end{array}
if M < 1.19999999999999994e-122Initial program 21.7%
times-frac21.1%
fma-def21.1%
associate-/r*21.1%
difference-of-squares29.0%
Simplified35.4%
Taylor expanded in c0 around -inf 2.0%
associate-*r*2.0%
distribute-rgt1-in2.0%
metadata-eval2.0%
mul0-lft32.0%
metadata-eval32.0%
mul0-lft2.6%
metadata-eval2.6%
distribute-lft1-in2.6%
*-commutative2.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft32.0%
Simplified32.0%
Taylor expanded in c0 around 0 37.3%
if 1.19999999999999994e-122 < M < 1.64999999999999995e129Initial program 24.9%
Taylor expanded in c0 around -inf 6.6%
fma-def6.6%
times-frac8.7%
unpow28.7%
unpow28.7%
*-commutative8.7%
unpow28.7%
associate-*r*8.7%
Simplified33.6%
Taylor expanded in c0 around 0 38.1%
associate-/l*36.0%
*-commutative36.0%
unpow236.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
times-frac38.1%
Applied egg-rr38.1%
if 1.64999999999999995e129 < M Initial program 0.0%
times-frac0.0%
fma-def0.0%
associate-/r*0.0%
difference-of-squares26.2%
Simplified26.7%
Taylor expanded in c0 around inf 19.7%
unpow219.7%
unpow219.7%
associate-*r*23.4%
unpow223.4%
unpow223.4%
Simplified23.4%
Final simplification36.0%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* d d) 2e+214) (* 0.25 (/ (* D D) (* (/ d h) (/ d (* M M))))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= 2e+214) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = 0.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 ((d_1 * d_1) <= 2d+214) then
tmp = 0.25d0 * ((d * d) / ((d_1 / h) * (d_1 / (m * m))))
else
tmp = 0.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 ((d * d) <= 2e+214) {
tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d * d) <= 2e+214: tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(d * d) <= 2e+214) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / h) * Float64(d / Float64(M * M))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d * d) <= 2e+214) tmp = 0.25 * ((D * D) / ((d / h) * (d / (M * M)))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 2e+214], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{+214}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 1.9999999999999999e214Initial program 25.6%
Taylor expanded in c0 around -inf 6.5%
fma-def6.5%
times-frac7.3%
unpow27.3%
unpow27.3%
*-commutative7.3%
unpow27.3%
associate-*r*7.3%
Simplified24.7%
Taylor expanded in c0 around 0 30.9%
associate-/l*31.7%
*-commutative31.7%
unpow231.7%
unpow231.7%
*-commutative31.7%
unpow231.7%
Simplified31.7%
times-frac34.6%
Applied egg-rr34.6%
if 1.9999999999999999e214 < (*.f64 d d) Initial program 15.3%
times-frac15.3%
fma-def15.3%
associate-/r*15.3%
difference-of-squares22.6%
Simplified29.5%
Taylor expanded in c0 around -inf 1.6%
associate-*r*1.6%
distribute-rgt1-in1.6%
metadata-eval1.6%
mul0-lft38.4%
metadata-eval38.4%
mul0-lft2.3%
metadata-eval2.3%
distribute-lft1-in2.3%
*-commutative2.3%
distribute-lft1-in2.3%
metadata-eval2.3%
mul0-lft38.4%
Simplified38.4%
Taylor expanded in c0 around 0 43.7%
Final simplification39.6%
(FPCore (c0 w h D d M) :precision binary64 (if (<= d 9.6e+113) (* 0.25 (/ (* D D) (/ (* d (/ d (* M M))) h))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (d <= 9.6e+113) {
tmp = 0.25 * ((D * D) / ((d * (d / (M * M))) / h));
} else {
tmp = 0.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 (d_1 <= 9.6d+113) then
tmp = 0.25d0 * ((d * d) / ((d_1 * (d_1 / (m * m))) / h))
else
tmp = 0.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 (d <= 9.6e+113) {
tmp = 0.25 * ((D * D) / ((d * (d / (M * M))) / h));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if d <= 9.6e+113: tmp = 0.25 * ((D * D) / ((d * (d / (M * M))) / h)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (d <= 9.6e+113) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * Float64(d / Float64(M * M))) / h))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (d <= 9.6e+113) tmp = 0.25 * ((D * D) / ((d * (d / (M * M))) / h)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[d, 9.6e+113], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 9.6 \cdot 10^{+113}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot \frac{d}{M \cdot M}}{h}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 9.59999999999999933e113Initial program 22.8%
Taylor expanded in c0 around -inf 4.7%
fma-def4.7%
times-frac5.2%
unpow25.2%
unpow25.2%
*-commutative5.2%
unpow25.2%
associate-*r*5.2%
Simplified27.7%
Taylor expanded in c0 around 0 34.4%
associate-/l*33.4%
*-commutative33.4%
unpow233.4%
unpow233.4%
*-commutative33.4%
unpow233.4%
Simplified33.4%
div-inv33.3%
times-frac35.7%
Applied egg-rr35.7%
unpow235.7%
associate-*r/35.8%
*-rgt-identity35.8%
unpow235.8%
associate-*l/36.6%
Simplified36.6%
if 9.59999999999999933e113 < d Initial program 12.8%
times-frac12.8%
fma-def12.8%
associate-/r*12.8%
difference-of-squares22.9%
Simplified33.1%
Taylor expanded in c0 around -inf 2.9%
associate-*r*2.9%
distribute-rgt1-in2.9%
metadata-eval2.9%
mul0-lft40.1%
metadata-eval40.1%
mul0-lft2.9%
metadata-eval2.9%
distribute-lft1-in2.9%
*-commutative2.9%
distribute-lft1-in2.9%
metadata-eval2.9%
mul0-lft40.1%
Simplified40.1%
Taylor expanded in c0 around 0 44.5%
Final simplification38.8%
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
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
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
def code(c0, w, h, D, d, M): return 0.0
function code(c0, w, h, D, d, M) return 0.0 end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0; end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 20.0%
times-frac19.6%
fma-def19.6%
associate-/r*19.7%
difference-of-squares27.9%
Simplified34.1%
Taylor expanded in c0 around -inf 1.9%
associate-*r*1.9%
distribute-rgt1-in1.9%
metadata-eval1.9%
mul0-lft30.4%
metadata-eval30.4%
mul0-lft2.3%
metadata-eval2.3%
distribute-lft1-in2.3%
*-commutative2.3%
distribute-lft1-in2.3%
metadata-eval2.3%
mul0-lft30.4%
Simplified30.4%
Taylor expanded in c0 around 0 34.2%
Final simplification34.2%
herbie shell --seed 2023214
(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))))))