
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -5e-310)
(*
(/ t_0 (sqrt (- l)))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (/ (* h (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0))) l))))
(*
d
(/
(fma (* -0.5 (/ h l)) (pow (* (/ D d) (/ M 2.0)) 2.0) 1.0)
(* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -5e-310) {
tmp = (t_0 / sqrt(-l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h * (-0.5 * pow((D * (M / (d * 2.0))), 2.0))) / l)));
} else {
tmp = d * (fma((-0.5 * (h / l)), pow(((D / d) * (M / 2.0)), 2.0), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))) / l)))); else tmp = Float64(d * Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 71.6%
Simplified71.5%
associate-*l/72.4%
*-commutative72.4%
add-sqr-sqrt72.4%
pow272.4%
sqrt-pow172.4%
metadata-eval72.4%
pow172.4%
associate-/l/72.4%
Applied egg-rr72.4%
frac-2neg72.4%
sqrt-div84.5%
Applied egg-rr84.5%
frac-2neg84.5%
sqrt-div89.5%
Applied egg-rr89.5%
if -4.999999999999985e-310 < l Initial program 61.7%
Simplified61.7%
Applied egg-rr76.5%
unpow176.5%
associate-*l/80.7%
associate-/l*80.8%
+-commutative80.8%
associate-*r*80.8%
fma-define80.8%
*-commutative80.8%
associate-*r/80.8%
*-commutative80.8%
times-frac80.8%
Simplified80.8%
Final simplification85.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* h (/ (* -0.5 (pow (* D (* 0.5 (/ M d))) 2.0)) l)))))
(*
d
(/
(fma (* -0.5 (/ h l)) (pow (* (/ D d) (/ M 2.0)) 2.0) 1.0)
(* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + (h * ((-0.5 * pow((D * (0.5 * (M / d))), 2.0)) / l))));
} else {
tmp = d * (fma((-0.5 * (h / l)), pow(((D / d) * (M / 2.0)), 2.0), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)) / l))))); else tmp = Float64(d * Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + h \cdot \frac{-0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 71.6%
Simplified71.5%
associate-*l/72.4%
*-commutative72.4%
add-sqr-sqrt72.4%
pow272.4%
sqrt-pow172.4%
metadata-eval72.4%
pow172.4%
associate-/l/72.4%
Applied egg-rr72.4%
frac-2neg72.4%
sqrt-div84.5%
Applied egg-rr84.5%
associate-/l*84.5%
*-commutative84.5%
unpow-prod-down74.1%
*-un-lft-identity74.1%
*-commutative74.1%
times-frac74.1%
metadata-eval74.1%
metadata-eval74.1%
times-frac74.1%
*-commutative74.1%
*-un-lft-identity74.1%
unpow-prod-down84.5%
associate-/l*84.5%
Applied egg-rr84.5%
if -4.999999999999985e-310 < l Initial program 61.7%
Simplified61.7%
Applied egg-rr76.5%
unpow176.5%
associate-*l/80.7%
associate-/l*80.8%
+-commutative80.8%
associate-*r*80.8%
fma-define80.8%
*-commutative80.8%
associate-*r/80.8%
*-commutative80.8%
times-frac80.8%
Simplified80.8%
Final simplification82.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l 4e-276)
(*
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(- 1.0 (* 0.5 (/ (* h (pow (* M (/ D (* d 2.0))) 2.0)) l))))
(*
d
(/
(fma (* -0.5 (/ h l)) (pow (* (/ D d) (/ M 2.0)) 2.0) 1.0)
(* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4e-276) {
tmp = (sqrt((d / l)) * (1.0 / sqrt((h / d)))) * (1.0 - (0.5 * ((h * pow((M * (D / (d * 2.0))), 2.0)) / l)));
} else {
tmp = d * (fma((-0.5 * (h / l)), pow(((D / d) * (M / 2.0)), 2.0), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4e-276) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4e-276], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4 \cdot 10^{-276}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 4e-276Initial program 70.2%
Simplified68.7%
clear-num38.0%
sqrt-div39.0%
metadata-eval39.0%
Applied egg-rr69.7%
associate-*r/71.1%
frac-times73.3%
associate-/l*71.1%
*-commutative71.1%
Applied egg-rr71.1%
if 4e-276 < l Initial program 62.8%
Simplified62.8%
Applied egg-rr77.5%
unpow177.5%
associate-*l/82.0%
associate-/l*82.0%
+-commutative82.0%
associate-*r*82.0%
fma-define82.0%
*-commutative82.0%
associate-*r/82.1%
*-commutative82.1%
times-frac82.0%
Simplified82.0%
Final simplification76.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l 5e-309)
(*
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(- 1.0 (* 0.5 (* (/ h l) (pow (/ (* D (* M 0.5)) d) 2.0)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5e-309) {
tmp = (sqrt((d / l)) * (1.0 / sqrt((h / d)))) * (1.0 - (0.5 * ((h / l) * pow(((D * (M * 0.5)) / d), 2.0))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 5d-309) then
tmp = (sqrt((d / l)) * (1.0d0 / sqrt((h / d)))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 * (m * 0.5d0)) / d) ** 2.0d0))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5e-309) {
tmp = (Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D * (M * 0.5)) / d), 2.0))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 5e-309: tmp = (math.sqrt((d / l)) * (1.0 / math.sqrt((h / d)))) * (1.0 - (0.5 * ((h / l) * math.pow(((D * (M * 0.5)) / d), 2.0)))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5e-309) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 5e-309) tmp = (sqrt((d / l)) * (1.0 / sqrt((h / d)))) * (1.0 - (0.5 * ((h / l) * (((D * (M * 0.5)) / d) ^ 2.0)))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5e-309], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 4.9999999999999995e-309Initial program 71.6%
Simplified70.0%
clear-num39.2%
sqrt-div40.2%
metadata-eval40.2%
Applied egg-rr71.0%
associate-*r/72.5%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
if 4.9999999999999995e-309 < l Initial program 61.7%
Simplified61.7%
Applied egg-rr76.5%
unpow176.5%
associate-*r*76.5%
*-commutative76.5%
associate-*r/76.6%
*-commutative76.6%
associate-*r/75.0%
associate-*r*75.0%
associate-*r*75.0%
associate-/r*75.0%
Simplified75.0%
Final simplification73.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l 2.1e-273)
(*
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(- 1.0 (* 0.5 (/ (* h (pow (* M (/ D (* d 2.0))) 2.0)) l))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.1e-273) {
tmp = (sqrt((d / l)) * (1.0 / sqrt((h / d)))) * (1.0 - (0.5 * ((h * pow((M * (D / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.1d-273) then
tmp = (sqrt((d / l)) * (1.0d0 / sqrt((h / d)))) * (1.0d0 - (0.5d0 * ((h * ((m * (d_1 / (d * 2.0d0))) ** 2.0d0)) / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.1e-273) {
tmp = (Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)))) * (1.0 - (0.5 * ((h * Math.pow((M * (D / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.1e-273: tmp = (math.sqrt((d / l)) * (1.0 / math.sqrt((h / d)))) * (1.0 - (0.5 * ((h * math.pow((M * (D / (d * 2.0))), 2.0)) / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.1e-273) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.1e-273) tmp = (sqrt((d / l)) * (1.0 / sqrt((h / d)))) * (1.0 - (0.5 * ((h * ((M * (D / (d * 2.0))) ^ 2.0)) / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.1e-273], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.1 \cdot 10^{-273}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 2.1000000000000002e-273Initial program 70.2%
Simplified68.7%
clear-num38.0%
sqrt-div39.0%
metadata-eval39.0%
Applied egg-rr69.7%
associate-*r/71.1%
frac-times73.3%
associate-/l*71.1%
*-commutative71.1%
Applied egg-rr71.1%
if 2.1000000000000002e-273 < l Initial program 62.8%
Simplified62.8%
Applied egg-rr77.5%
unpow177.5%
associate-*r*77.5%
*-commutative77.5%
associate-*r/77.6%
*-commutative77.6%
associate-*r/75.9%
associate-*r*75.9%
associate-*r*75.9%
associate-/r*75.9%
Simplified75.9%
Final simplification73.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l 3e-275)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* h (* (pow (* 0.5 (* D (/ M d))) 2.0) (/ -0.5 l))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3e-275) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (pow((0.5 * (D * (M / d))), 2.0) * (-0.5 / l)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3d-275) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (h * (((0.5d0 * (d_1 * (m / d))) ** 2.0d0) * ((-0.5d0) / l)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3e-275) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (h * (Math.pow((0.5 * (D * (M / d))), 2.0) * (-0.5 / l)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3e-275: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (h * (math.pow((0.5 * (D * (M / d))), 2.0) * (-0.5 / l))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3e-275) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64((Float64(0.5 * Float64(D * Float64(M / d))) ^ 2.0) * Float64(-0.5 / l)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3e-275) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * (((0.5 * (D * (M / d))) ^ 2.0) * (-0.5 / l))))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3e-275], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(N[Power[N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(0.5 \cdot \left(D \cdot \frac{M}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 3e-275Initial program 70.2%
Simplified70.2%
associate-*r/70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
Applied egg-rr72.3%
associate-/r/72.3%
associate-*r*72.3%
associate-*r*72.3%
*-commutative72.3%
associate-*r*72.3%
*-commutative72.3%
associate-*l/72.3%
metadata-eval72.3%
associate-*r*72.3%
*-commutative72.3%
associate-*r*72.3%
Simplified72.3%
if 3e-275 < l Initial program 62.8%
Simplified62.8%
Applied egg-rr77.5%
unpow177.5%
associate-*r*77.5%
*-commutative77.5%
associate-*r/77.6%
*-commutative77.6%
associate-*r/75.9%
associate-*r*75.9%
associate-*r*75.9%
associate-/r*75.9%
Simplified75.9%
Final simplification73.9%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ (* D (* M 0.5)) d) 2.0))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-5d-310)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 * (m * 0.5d0)) / d) ** 2.0d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D * (M * 0.5)) / d), 2.0)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D * (M * 0.5)) / d), 2.0))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -5e-310) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * (((D * (M * 0.5)) / d) ^ 2.0))))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 71.6%
Simplified71.5%
associate-*r/71.5%
div-inv71.5%
metadata-eval71.5%
Applied egg-rr71.5%
if -4.999999999999985e-310 < h Initial program 61.7%
Simplified61.7%
Applied egg-rr76.5%
unpow176.5%
associate-*r*76.5%
*-commutative76.5%
associate-*r/76.6%
*-commutative76.6%
associate-*r/75.0%
associate-*r*75.0%
associate-*r*75.0%
associate-/r*75.0%
Simplified75.0%
Final simplification73.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l 4.6e-275)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (pow (* (/ D d) (/ M 2.0)) 2.0) (* h -0.5)) l))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-275) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((pow(((D / d) * (M / 2.0)), 2.0) * (h * -0.5)) / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 4.6d-275) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (((((d_1 / d) * (m / 2.0d0)) ** 2.0d0) * (h * (-0.5d0))) / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-275) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((Math.pow(((D / d) * (M / 2.0)), 2.0) * (h * -0.5)) / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 4.6e-275: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((math.pow(((D / d) * (M / 2.0)), 2.0) * (h * -0.5)) / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4.6e-275) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h * -0.5)) / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 4.6e-275) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (((((D / d) * (M / 2.0)) ^ 2.0) * (h * -0.5)) / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4.6e-275], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.6 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 4.59999999999999979e-275Initial program 70.2%
Simplified70.2%
associate-*l/72.3%
*-commutative72.3%
add-sqr-sqrt72.3%
pow272.3%
sqrt-pow172.3%
metadata-eval72.3%
pow172.3%
associate-/l/72.3%
Applied egg-rr72.3%
pow172.3%
associate-*r*72.3%
Applied egg-rr72.3%
unpow172.3%
associate-*r/72.3%
times-frac70.2%
Simplified70.2%
if 4.59999999999999979e-275 < l Initial program 62.8%
Simplified62.8%
Applied egg-rr77.5%
unpow177.5%
associate-*r*77.5%
*-commutative77.5%
associate-*r/77.6%
*-commutative77.6%
associate-*r/75.9%
associate-*r*75.9%
associate-*r*75.9%
associate-/r*75.9%
Simplified75.9%
Final simplification72.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l 4.6e-276)
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (/ (/ M d) 2.0)) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-276) {
tmp = (1.0 + (-0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 4.6d-276) then
tmp = (1.0d0 + ((-0.5d0) * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * ((m / d) / 2.0d0)) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-276) {
tmp = (1.0 + (-0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * ((M / d) / 2.0)), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 4.6e-276: tmp = (1.0 + (-0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * ((M / d) / 2.0)), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4.6e-276) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 4.6e-276) tmp = (1.0 + (-0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + ((-0.5 * (h / l)) * ((D * ((M / d) / 2.0)) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4.6e-276], N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.6 \cdot 10^{-276}:\\
\;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 4.59999999999999963e-276Initial program 70.2%
Simplified68.7%
clear-num38.0%
sqrt-div39.0%
metadata-eval39.0%
Applied egg-rr69.7%
sqrt-div3.0%
clear-num3.0%
sqrt-div68.7%
rem-cube-cbrt68.2%
pow168.2%
Applied egg-rr62.3%
unpow162.3%
unpow1/262.3%
*-commutative62.3%
associate-*l*62.3%
Simplified62.3%
associate-*l/64.5%
associate-*r*64.5%
metadata-eval64.5%
div-inv64.5%
*-commutative64.5%
div-inv64.5%
metadata-eval64.5%
Applied egg-rr64.5%
if 4.59999999999999963e-276 < l Initial program 62.8%
Simplified62.8%
Applied egg-rr77.5%
unpow177.5%
associate-*r*77.5%
*-commutative77.5%
associate-*r/77.6%
*-commutative77.6%
associate-*r/75.9%
associate-*r*75.9%
associate-*r*75.9%
associate-/r*75.9%
Simplified75.9%
Final simplification69.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 6200000000000.0)
(*
(+ 1.0 (* -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l))))
(sqrt (* (/ d l) (/ d h))))
(* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6200000000000.0) {
tmp = (1.0 + (-0.5 * (h * (pow((D * (M * (0.5 / d))), 2.0) / l)))) * sqrt(((d / l) * (d / h)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 6200000000000.0d0) then
tmp = (1.0d0 + ((-0.5d0) * (h * (((d_1 * (m * (0.5d0 / d))) ** 2.0d0) / l)))) * sqrt(((d / l) * (d / h)))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6200000000000.0) {
tmp = (1.0 + (-0.5 * (h * (Math.pow((D * (M * (0.5 / d))), 2.0) / l)))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 6200000000000.0: tmp = (1.0 + (-0.5 * (h * (math.pow((D * (M * (0.5 / d))), 2.0) / l)))) * math.sqrt(((d / l) * (d / h))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6200000000000.0) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 6200000000000.0) tmp = (1.0 + (-0.5 * (h * (((D * (M * (0.5 / d))) ^ 2.0) / l)))) * sqrt(((d / l) * (d / h))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6200000000000.0], N[(N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6200000000000:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 6.2e12Initial program 72.3%
Simplified71.2%
clear-num38.2%
sqrt-div38.9%
metadata-eval38.9%
Applied egg-rr71.9%
sqrt-div25.4%
clear-num25.4%
sqrt-div71.2%
rem-cube-cbrt70.8%
pow170.8%
Applied egg-rr64.1%
unpow164.1%
unpow1/264.1%
*-commutative64.1%
associate-*l*64.1%
Simplified64.1%
associate-*l/66.2%
associate-*r*66.2%
metadata-eval66.2%
div-inv66.2%
*-commutative66.2%
div-inv66.2%
metadata-eval66.2%
Applied egg-rr66.2%
associate-/l*65.7%
associate-*l/66.8%
associate-/l*65.8%
associate-/l*65.8%
Simplified65.8%
if 6.2e12 < l Initial program 50.0%
Simplified49.9%
associate-*l/50.0%
*-commutative50.0%
add-sqr-sqrt50.0%
pow250.0%
sqrt-pow150.0%
metadata-eval50.0%
pow150.0%
associate-/l/50.0%
Applied egg-rr50.0%
Taylor expanded in d around inf 47.9%
unpow-147.9%
metadata-eval47.9%
pow-sqr47.9%
rem-sqrt-square47.9%
rem-square-sqrt47.7%
fabs-sqr47.7%
rem-square-sqrt47.9%
Simplified47.9%
*-commutative47.9%
unpow-prod-down64.3%
Applied egg-rr64.3%
Final simplification65.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l 2.8e+14)
(*
(+ 1.0 (* -0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(sqrt (* (/ d l) (/ d h))))
(* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.8e+14) {
tmp = (1.0 + (-0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * sqrt(((d / l) * (d / h)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.8d+14) then
tmp = (1.0d0 + ((-0.5d0) * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.8e+14) {
tmp = (1.0 + (-0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.8e+14: tmp = (1.0 + (-0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.8e+14) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.8e+14) tmp = (1.0 + (-0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.8e+14], N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.8 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 2.8e14Initial program 72.3%
Simplified71.2%
clear-num38.2%
sqrt-div38.9%
metadata-eval38.9%
Applied egg-rr71.9%
sqrt-div25.4%
clear-num25.4%
sqrt-div71.2%
rem-cube-cbrt70.8%
pow170.8%
Applied egg-rr64.1%
unpow164.1%
unpow1/264.1%
*-commutative64.1%
associate-*l*64.1%
Simplified64.1%
associate-*l/66.2%
associate-*r*66.2%
metadata-eval66.2%
div-inv66.2%
*-commutative66.2%
div-inv66.2%
metadata-eval66.2%
Applied egg-rr66.2%
if 2.8e14 < l Initial program 50.0%
Simplified49.9%
associate-*l/50.0%
*-commutative50.0%
add-sqr-sqrt50.0%
pow250.0%
sqrt-pow150.0%
metadata-eval50.0%
pow150.0%
associate-/l/50.0%
Applied egg-rr50.0%
Taylor expanded in d around inf 47.9%
unpow-147.9%
metadata-eval47.9%
pow-sqr47.9%
rem-sqrt-square47.9%
rem-square-sqrt47.7%
fabs-sqr47.7%
rem-square-sqrt47.9%
Simplified47.9%
*-commutative47.9%
unpow-prod-down64.3%
Applied egg-rr64.3%
Final simplification65.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (- (pow (* l h) -0.5)))))
(if (<= l -2.3e+184)
(sqrt (* (/ d l) (/ d h)))
(if (<= l -3.4e-154)
t_0
(if (<= l -1.4e-217)
(/ d (sqrt (* l h)))
(if (<= l 4e-276) t_0 (* d (* (pow l -0.5) (pow h -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * -pow((l * h), -0.5);
double tmp;
if (l <= -2.3e+184) {
tmp = sqrt(((d / l) * (d / h)));
} else if (l <= -3.4e-154) {
tmp = t_0;
} else if (l <= -1.4e-217) {
tmp = d / sqrt((l * h));
} else if (l <= 4e-276) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = d * -((l * h) ** (-0.5d0))
if (l <= (-2.3d+184)) then
tmp = sqrt(((d / l) * (d / h)))
else if (l <= (-3.4d-154)) then
tmp = t_0
else if (l <= (-1.4d-217)) then
tmp = d / sqrt((l * h))
else if (l <= 4d-276) then
tmp = t_0
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * -Math.pow((l * h), -0.5);
double tmp;
if (l <= -2.3e+184) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (l <= -3.4e-154) {
tmp = t_0;
} else if (l <= -1.4e-217) {
tmp = d / Math.sqrt((l * h));
} else if (l <= 4e-276) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * -math.pow((l * h), -0.5) tmp = 0 if l <= -2.3e+184: tmp = math.sqrt(((d / l) * (d / h))) elif l <= -3.4e-154: tmp = t_0 elif l <= -1.4e-217: tmp = d / math.sqrt((l * h)) elif l <= 4e-276: tmp = t_0 else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * Float64(-(Float64(l * h) ^ -0.5))) tmp = 0.0 if (l <= -2.3e+184) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (l <= -3.4e-154) tmp = t_0; elseif (l <= -1.4e-217) tmp = Float64(d / sqrt(Float64(l * h))); elseif (l <= 4e-276) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * -((l * h) ^ -0.5); tmp = 0.0; if (l <= -2.3e+184) tmp = sqrt(((d / l) * (d / h))); elseif (l <= -3.4e-154) tmp = t_0; elseif (l <= -1.4e-217) tmp = d / sqrt((l * h)); elseif (l <= 4e-276) tmp = t_0; else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -2.3e+184], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -3.4e-154], t$95$0, If[LessEqual[l, -1.4e-217], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e-276], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{+184}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -3.4 \cdot 10^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -1.4 \cdot 10^{-217}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{-276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.3e184Initial program 70.3%
Simplified70.3%
Taylor expanded in M around 0 62.2%
*-rgt-identity62.2%
sqrt-unprod62.5%
Applied egg-rr62.5%
if -2.3e184 < l < -3.3999999999999998e-154 or -1.4e-217 < l < 4e-276Initial program 70.2%
Simplified70.2%
associate-*l/73.4%
*-commutative73.4%
add-sqr-sqrt73.4%
pow273.4%
sqrt-pow173.4%
metadata-eval73.4%
pow173.4%
associate-/l/73.4%
Applied egg-rr73.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.1%
mul-1-neg45.1%
Simplified45.1%
if -3.3999999999999998e-154 < l < -1.4e-217Initial program 70.1%
Simplified61.8%
Taylor expanded in d around inf 48.2%
associate-/r*48.2%
Simplified48.2%
pow148.2%
associate-/l/48.2%
sqrt-div48.2%
metadata-eval48.2%
Applied egg-rr48.2%
unpow148.2%
associate-*r/48.2%
*-rgt-identity48.2%
*-commutative48.2%
Simplified48.2%
if 4e-276 < l Initial program 62.8%
Simplified61.1%
associate-*l/62.1%
*-commutative62.1%
add-sqr-sqrt62.1%
pow262.1%
sqrt-pow162.1%
metadata-eval62.1%
pow162.1%
associate-/l/62.1%
Applied egg-rr62.1%
Taylor expanded in d around inf 43.6%
unpow-143.6%
metadata-eval43.6%
pow-sqr43.6%
rem-sqrt-square44.1%
rem-square-sqrt43.9%
fabs-sqr43.9%
rem-square-sqrt44.1%
Simplified44.1%
*-commutative44.1%
unpow-prod-down55.1%
Applied egg-rr55.1%
Final simplification52.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (- (pow (* l h) -0.5)))))
(if (<= l -1.05e+185)
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
(if (<= l -2.7e-150)
t_0
(if (<= l -3.5e-267)
(* d (cbrt (pow (/ (/ 1.0 l) h) 1.5)))
(if (<= l 4.3e-276) t_0 (* d (* (pow l -0.5) (pow h -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * -pow((l * h), -0.5);
double tmp;
if (l <= -1.05e+185) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else if (l <= -2.7e-150) {
tmp = t_0;
} else if (l <= -3.5e-267) {
tmp = d * cbrt(pow(((1.0 / l) / h), 1.5));
} else if (l <= 4.3e-276) {
tmp = t_0;
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * -Math.pow((l * h), -0.5);
double tmp;
if (l <= -1.05e+185) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else if (l <= -2.7e-150) {
tmp = t_0;
} else if (l <= -3.5e-267) {
tmp = d * Math.cbrt(Math.pow(((1.0 / l) / h), 1.5));
} else if (l <= 4.3e-276) {
tmp = t_0;
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d * Float64(-(Float64(l * h) ^ -0.5))) tmp = 0.0 if (l <= -1.05e+185) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); elseif (l <= -2.7e-150) tmp = t_0; elseif (l <= -3.5e-267) tmp = Float64(d * cbrt((Float64(Float64(1.0 / l) / h) ^ 1.5))); elseif (l <= 4.3e-276) tmp = t_0; else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -1.05e+185], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.7e-150], t$95$0, If[LessEqual[l, -3.5e-267], N[(d * N[Power[N[Power[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.3e-276], t$95$0, N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+185}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;\ell \leq -2.7 \cdot 10^{-150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -3.5 \cdot 10^{-267}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{\ell}}{h}\right)}^{1.5}}\\
\mathbf{elif}\;\ell \leq 4.3 \cdot 10^{-276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.05e185Initial program 72.1%
Simplified72.1%
Taylor expanded in M around 0 64.0%
clear-num64.0%
sqrt-div66.1%
metadata-eval66.1%
Applied egg-rr66.1%
if -1.05e185 < l < -2.7000000000000001e-150 or -3.4999999999999999e-267 < l < 4.2999999999999996e-276Initial program 68.2%
Simplified68.2%
associate-*l/72.0%
*-commutative72.0%
add-sqr-sqrt72.0%
pow272.0%
sqrt-pow172.0%
metadata-eval72.0%
pow172.0%
associate-/l/72.0%
Applied egg-rr72.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt46.8%
mul-1-neg46.8%
Simplified46.8%
if -2.7000000000000001e-150 < l < -3.4999999999999999e-267Initial program 73.8%
Simplified69.6%
Taylor expanded in d around inf 36.5%
add-cbrt-cube43.9%
pow1/343.9%
add-sqr-sqrt43.9%
pow143.9%
pow1/243.9%
pow-prod-up43.9%
metadata-eval43.9%
Applied egg-rr43.9%
unpow1/343.9%
associate-/l/43.9%
Simplified43.9%
if 4.2999999999999996e-276 < l Initial program 62.8%
Simplified61.1%
associate-*l/62.1%
*-commutative62.1%
add-sqr-sqrt62.1%
pow262.1%
sqrt-pow162.1%
metadata-eval62.1%
pow162.1%
associate-/l/62.1%
Applied egg-rr62.1%
Taylor expanded in d around inf 43.6%
unpow-143.6%
metadata-eval43.6%
pow-sqr43.6%
rem-sqrt-square44.1%
rem-square-sqrt43.9%
fabs-sqr43.9%
rem-square-sqrt44.1%
Simplified44.1%
*-commutative44.1%
unpow-prod-down55.1%
Applied egg-rr55.1%
Final simplification52.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (- (pow (* l h) -0.5)))))
(if (<= l -7e+184)
(sqrt (* (/ d l) (/ d h)))
(if (<= l -5.8e-154)
t_0
(if (<= l -2.7e-218)
(/ d (sqrt (* l h)))
(if (<= l 3.2e-274) t_0 (/ (/ d (sqrt l)) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * -pow((l * h), -0.5);
double tmp;
if (l <= -7e+184) {
tmp = sqrt(((d / l) * (d / h)));
} else if (l <= -5.8e-154) {
tmp = t_0;
} else if (l <= -2.7e-218) {
tmp = d / sqrt((l * h));
} else if (l <= 3.2e-274) {
tmp = t_0;
} else {
tmp = (d / sqrt(l)) / sqrt(h);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = d * -((l * h) ** (-0.5d0))
if (l <= (-7d+184)) then
tmp = sqrt(((d / l) * (d / h)))
else if (l <= (-5.8d-154)) then
tmp = t_0
else if (l <= (-2.7d-218)) then
tmp = d / sqrt((l * h))
else if (l <= 3.2d-274) then
tmp = t_0
else
tmp = (d / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * -Math.pow((l * h), -0.5);
double tmp;
if (l <= -7e+184) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (l <= -5.8e-154) {
tmp = t_0;
} else if (l <= -2.7e-218) {
tmp = d / Math.sqrt((l * h));
} else if (l <= 3.2e-274) {
tmp = t_0;
} else {
tmp = (d / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * -math.pow((l * h), -0.5) tmp = 0 if l <= -7e+184: tmp = math.sqrt(((d / l) * (d / h))) elif l <= -5.8e-154: tmp = t_0 elif l <= -2.7e-218: tmp = d / math.sqrt((l * h)) elif l <= 3.2e-274: tmp = t_0 else: tmp = (d / math.sqrt(l)) / math.sqrt(h) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * Float64(-(Float64(l * h) ^ -0.5))) tmp = 0.0 if (l <= -7e+184) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (l <= -5.8e-154) tmp = t_0; elseif (l <= -2.7e-218) tmp = Float64(d / sqrt(Float64(l * h))); elseif (l <= 3.2e-274) tmp = t_0; else tmp = Float64(Float64(d / sqrt(l)) / sqrt(h)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * -((l * h) ^ -0.5); tmp = 0.0; if (l <= -7e+184) tmp = sqrt(((d / l) * (d / h))); elseif (l <= -5.8e-154) tmp = t_0; elseif (l <= -2.7e-218) tmp = d / sqrt((l * h)); elseif (l <= 3.2e-274) tmp = t_0; else tmp = (d / sqrt(l)) / sqrt(h); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -7e+184], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5.8e-154], t$95$0, If[LessEqual[l, -2.7e-218], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e-274], t$95$0, N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{+184}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -5.8 \cdot 10^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -2.7 \cdot 10^{-218}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{-274}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6.99999999999999956e184Initial program 70.3%
Simplified70.3%
Taylor expanded in M around 0 62.2%
*-rgt-identity62.2%
sqrt-unprod62.5%
Applied egg-rr62.5%
if -6.99999999999999956e184 < l < -5.8e-154 or -2.7e-218 < l < 3.19999999999999979e-274Initial program 70.2%
Simplified70.2%
associate-*l/73.4%
*-commutative73.4%
add-sqr-sqrt73.4%
pow273.4%
sqrt-pow173.4%
metadata-eval73.4%
pow173.4%
associate-/l/73.4%
Applied egg-rr73.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.1%
mul-1-neg45.1%
Simplified45.1%
if -5.8e-154 < l < -2.7e-218Initial program 70.1%
Simplified61.8%
Taylor expanded in d around inf 48.2%
associate-/r*48.2%
Simplified48.2%
pow148.2%
associate-/l/48.2%
sqrt-div48.2%
metadata-eval48.2%
Applied egg-rr48.2%
unpow148.2%
associate-*r/48.2%
*-rgt-identity48.2%
*-commutative48.2%
Simplified48.2%
if 3.19999999999999979e-274 < l Initial program 62.8%
Simplified62.8%
Taylor expanded in M around 0 42.0%
sqrt-div52.6%
*-rgt-identity52.6%
sqrt-div54.9%
frac-times55.0%
add-sqr-sqrt55.1%
Applied egg-rr55.1%
associate-/l/54.9%
Simplified54.9%
Final simplification52.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h -4.1e+104)
(sqrt (* (/ d l) (/ d h)))
(if (<= h -9e-251)
(* d (- (pow (* l h) -0.5)))
(if (<= h -5e-310)
(* d (cbrt (pow (/ (/ 1.0 l) h) 1.5)))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.1e+104) {
tmp = sqrt(((d / l) * (d / h)));
} else if (h <= -9e-251) {
tmp = d * -pow((l * h), -0.5);
} else if (h <= -5e-310) {
tmp = d * cbrt(pow(((1.0 / l) / h), 1.5));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.1e+104) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (h <= -9e-251) {
tmp = d * -Math.pow((l * h), -0.5);
} else if (h <= -5e-310) {
tmp = d * Math.cbrt(Math.pow(((1.0 / l) / h), 1.5));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -4.1e+104) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (h <= -9e-251) tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5))); elseif (h <= -5e-310) tmp = Float64(d * cbrt((Float64(Float64(1.0 / l) / h) ^ 1.5))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4.1e+104], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[h, -9e-251], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[h, -5e-310], N[(d * N[Power[N[Power[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.1 \cdot 10^{+104}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;h \leq -9 \cdot 10^{-251}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{\ell}}{h}\right)}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if h < -4.09999999999999985e104Initial program 67.4%
Simplified65.1%
Taylor expanded in M around 0 35.6%
*-rgt-identity35.6%
sqrt-unprod35.8%
Applied egg-rr35.8%
if -4.09999999999999985e104 < h < -8.99999999999999956e-251Initial program 73.2%
Simplified73.2%
associate-*l/73.3%
*-commutative73.3%
add-sqr-sqrt73.3%
pow273.3%
sqrt-pow173.3%
metadata-eval73.3%
pow173.3%
associate-/l/73.3%
Applied egg-rr73.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt55.0%
mul-1-neg55.0%
Simplified55.0%
if -8.99999999999999956e-251 < h < -4.999999999999985e-310Initial program 78.3%
Simplified78.3%
Taylor expanded in d around inf 56.2%
add-cbrt-cube77.8%
pow1/377.8%
add-sqr-sqrt77.8%
pow177.8%
pow1/277.8%
pow-prod-up77.8%
metadata-eval77.8%
Applied egg-rr77.8%
unpow1/377.8%
associate-/l/77.8%
Simplified77.8%
if -4.999999999999985e-310 < h Initial program 61.7%
Simplified60.1%
associate-*l/62.6%
*-commutative62.6%
add-sqr-sqrt62.6%
pow262.6%
sqrt-pow162.6%
metadata-eval62.6%
pow162.6%
associate-/l/62.6%
Applied egg-rr62.6%
Taylor expanded in d around inf 41.9%
unpow-141.9%
metadata-eval41.9%
pow-sqr41.9%
rem-sqrt-square42.4%
rem-square-sqrt42.2%
fabs-sqr42.2%
rem-square-sqrt42.4%
Simplified42.4%
*-commutative42.4%
unpow-prod-down52.8%
Applied egg-rr52.8%
Final simplification51.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* l h) -0.5)) (t_1 (sqrt (* (/ d l) (/ d h)))))
(if (<= h -6.8e+107)
t_1
(if (<= h -1e-250) (* d (- t_0)) (if (<= h 4e+50) (* d t_0) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((l * h), -0.5);
double t_1 = sqrt(((d / l) * (d / h)));
double tmp;
if (h <= -6.8e+107) {
tmp = t_1;
} else if (h <= -1e-250) {
tmp = d * -t_0;
} else if (h <= 4e+50) {
tmp = d * t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (l * h) ** (-0.5d0)
t_1 = sqrt(((d / l) * (d / h)))
if (h <= (-6.8d+107)) then
tmp = t_1
else if (h <= (-1d-250)) then
tmp = d * -t_0
else if (h <= 4d+50) then
tmp = d * t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((l * h), -0.5);
double t_1 = Math.sqrt(((d / l) * (d / h)));
double tmp;
if (h <= -6.8e+107) {
tmp = t_1;
} else if (h <= -1e-250) {
tmp = d * -t_0;
} else if (h <= 4e+50) {
tmp = d * t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((l * h), -0.5) t_1 = math.sqrt(((d / l) * (d / h))) tmp = 0 if h <= -6.8e+107: tmp = t_1 elif h <= -1e-250: tmp = d * -t_0 elif h <= 4e+50: tmp = d * t_0 else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(l * h) ^ -0.5 t_1 = sqrt(Float64(Float64(d / l) * Float64(d / h))) tmp = 0.0 if (h <= -6.8e+107) tmp = t_1; elseif (h <= -1e-250) tmp = Float64(d * Float64(-t_0)); elseif (h <= 4e+50) tmp = Float64(d * t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (l * h) ^ -0.5; t_1 = sqrt(((d / l) * (d / h))); tmp = 0.0; if (h <= -6.8e+107) tmp = t_1; elseif (h <= -1e-250) tmp = d * -t_0; elseif (h <= 4e+50) tmp = d * t_0; else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -6.8e+107], t$95$1, If[LessEqual[h, -1e-250], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[h, 4e+50], N[(d * t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
t_1 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;h \leq -6.8 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-250}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{elif}\;h \leq 4 \cdot 10^{+50}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if h < -6.7999999999999994e107 or 4.0000000000000003e50 < h Initial program 61.6%
Simplified60.5%
Taylor expanded in M around 0 30.4%
*-rgt-identity30.4%
sqrt-unprod28.7%
Applied egg-rr28.7%
if -6.7999999999999994e107 < h < -1.0000000000000001e-250Initial program 73.2%
Simplified73.2%
associate-*l/73.3%
*-commutative73.3%
add-sqr-sqrt73.3%
pow273.3%
sqrt-pow173.3%
metadata-eval73.3%
pow173.3%
associate-/l/73.3%
Applied egg-rr73.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt55.0%
mul-1-neg55.0%
Simplified55.0%
if -1.0000000000000001e-250 < h < 4.0000000000000003e50Initial program 67.0%
Simplified65.8%
associate-*l/68.4%
*-commutative68.4%
add-sqr-sqrt68.4%
pow268.4%
sqrt-pow168.4%
metadata-eval68.4%
pow168.4%
associate-/l/68.4%
Applied egg-rr68.4%
Taylor expanded in d around inf 62.4%
unpow-162.4%
metadata-eval62.4%
pow-sqr62.4%
rem-sqrt-square63.1%
rem-square-sqrt62.9%
fabs-sqr62.9%
rem-square-sqrt63.1%
Simplified63.1%
Final simplification47.4%
(FPCore (d h l M D) :precision binary64 (if (<= l -4.8e-150) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.8e-150) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-4.8d-150)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.8e-150) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.8e-150: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.8e-150) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4.8e-150) tmp = sqrt(((d / l) * (d / h))); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-150], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-150}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -4.8e-150Initial program 70.0%
Simplified69.1%
Taylor expanded in M around 0 47.8%
*-rgt-identity47.8%
sqrt-unprod43.8%
Applied egg-rr43.8%
if -4.8e-150 < l Initial program 64.8%
Simplified63.6%
associate-*l/66.1%
*-commutative66.1%
add-sqr-sqrt66.1%
pow266.1%
sqrt-pow166.1%
metadata-eval66.1%
pow166.1%
associate-/l/66.1%
Applied egg-rr66.1%
Taylor expanded in d around inf 39.9%
unpow-139.9%
metadata-eval39.9%
pow-sqr39.9%
rem-sqrt-square40.2%
rem-square-sqrt40.1%
fabs-sqr40.1%
rem-square-sqrt40.2%
Simplified40.2%
Final simplification41.6%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 66.9%
Simplified66.1%
associate-*l/67.7%
*-commutative67.7%
add-sqr-sqrt67.7%
pow267.7%
sqrt-pow167.7%
metadata-eval67.7%
pow167.7%
associate-/l/67.7%
Applied egg-rr67.7%
Taylor expanded in d around inf 26.3%
unpow-126.3%
metadata-eval26.3%
pow-sqr26.3%
rem-sqrt-square26.5%
rem-square-sqrt26.4%
fabs-sqr26.4%
rem-square-sqrt26.5%
Simplified26.5%
Final simplification26.5%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 66.9%
Simplified66.1%
Taylor expanded in d around inf 26.3%
associate-/r*26.3%
Simplified26.3%
pow126.3%
associate-/l/26.3%
sqrt-div26.4%
metadata-eval26.4%
Applied egg-rr26.4%
unpow126.4%
associate-*r/26.5%
*-rgt-identity26.5%
*-commutative26.5%
Simplified26.5%
Final simplification26.5%
herbie shell --seed 2024075
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))