
(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 (<= h -3e+142)
(*
(sqrt (/ d l))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* M 0.5)) d) 2.0) -0.5)))))
(if (<= h -5e-310)
(*
(* (/ 1.0 (sqrt (/ h d))) (/ t_0 (sqrt (- l))))
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -3e+142) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (pow(((D * (M * 0.5)) / d), 2.0) * -0.5))));
} else if (h <= -5e-310) {
tmp = ((1.0 / sqrt((h / d))) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -3e+142) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0) * -0.5))))); elseif (h <= -5e-310) tmp = Float64(Float64(Float64(1.0 / sqrt(Float64(h / d))) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l)))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -3e+142], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(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] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;h \leq -3 \cdot 10^{+142}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{1}{\sqrt{\frac{h}{d}}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -2.99999999999999975e142Initial program 56.2%
Simplified56.2%
frac-2neg56.2%
sqrt-div73.3%
Applied egg-rr73.3%
associate-*r/73.3%
div-inv73.3%
metadata-eval73.3%
Applied egg-rr73.3%
if -2.99999999999999975e142 < h < -4.999999999999985e-310Initial program 72.4%
Simplified72.4%
associate-*r/75.8%
*-commutative75.8%
div-inv75.8%
metadata-eval75.8%
Applied egg-rr75.8%
frac-2neg75.8%
sqrt-div87.6%
Applied egg-rr87.6%
clear-num87.6%
sqrt-div87.6%
metadata-eval87.6%
Applied egg-rr87.6%
if -4.999999999999985e-310 < h Initial program 66.0%
Simplified65.4%
sub-neg65.4%
distribute-rgt-in58.3%
*-un-lft-identity58.3%
*-commutative58.3%
sqrt-div62.0%
sqrt-div62.6%
frac-times62.5%
add-sqr-sqrt62.6%
Applied egg-rr76.4%
*-rgt-identity76.4%
*-commutative76.4%
distribute-lft-in81.4%
associate-*l/83.2%
associate-/l*83.8%
Simplified86.5%
Final simplification85.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= h -3e+143)
(*
(sqrt (/ d l))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* M 0.5)) d) 2.0) -0.5)))))
(if (<= h -5e-310)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l)))
(* (/ t_0 (sqrt (- l))) (sqrt (/ d h))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -3e+143) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (pow(((D * (M * 0.5)) / d), 2.0) * -0.5))));
} else if (h <= -5e-310) {
tmp = (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l))) * ((t_0 / sqrt(-l)) * sqrt((d / h)));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -3e+143) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0) * -0.5))))); elseif (h <= -5e-310) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l))) * Float64(Float64(t_0 / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -3e+143], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(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] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;h \leq -3 \cdot 10^{+143}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(\frac{t\_0}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -3.0000000000000001e143Initial program 56.2%
Simplified56.2%
frac-2neg56.2%
sqrt-div73.3%
Applied egg-rr73.3%
associate-*r/73.3%
div-inv73.3%
metadata-eval73.3%
Applied egg-rr73.3%
if -3.0000000000000001e143 < h < -4.999999999999985e-310Initial program 72.4%
Simplified72.4%
associate-*r/75.8%
*-commutative75.8%
div-inv75.8%
metadata-eval75.8%
Applied egg-rr75.8%
frac-2neg75.8%
sqrt-div87.6%
Applied egg-rr87.6%
if -4.999999999999985e-310 < h Initial program 66.0%
Simplified65.4%
sub-neg65.4%
distribute-rgt-in58.3%
*-un-lft-identity58.3%
*-commutative58.3%
sqrt-div62.0%
sqrt-div62.6%
frac-times62.5%
add-sqr-sqrt62.6%
Applied egg-rr76.4%
*-rgt-identity76.4%
*-commutative76.4%
distribute-lft-in81.4%
associate-*l/83.2%
associate-/l*83.8%
Simplified86.5%
Final simplification85.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (/ (* D (* M 0.5)) d) 2.0) -0.5)))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow(((D * (M * 0.5)) / d), 2.0) * -0.5))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0) * -0.5))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(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] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 68.3%
Simplified66.6%
frac-2neg66.6%
sqrt-div73.4%
Applied egg-rr73.4%
associate-*r/75.0%
div-inv75.0%
metadata-eval75.0%
Applied egg-rr75.0%
if -1.999999999999994e-310 < l Initial program 66.0%
Simplified65.4%
sub-neg65.4%
distribute-rgt-in58.3%
*-un-lft-identity58.3%
*-commutative58.3%
sqrt-div62.0%
sqrt-div62.6%
frac-times62.5%
add-sqr-sqrt62.6%
Applied egg-rr76.4%
*-rgt-identity76.4%
*-commutative76.4%
distribute-lft-in81.4%
associate-*l/83.2%
associate-/l*83.8%
Simplified86.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ (/ M 2.0) d)) 2.0))))))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * pow((D * ((M / 2.0) / d)), 2.0)))));
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0)))))); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(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] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 68.3%
Simplified66.6%
frac-2neg66.6%
sqrt-div73.4%
Applied egg-rr73.4%
if -1.999999999999994e-310 < l Initial program 66.0%
Simplified65.4%
sub-neg65.4%
distribute-rgt-in58.3%
*-un-lft-identity58.3%
*-commutative58.3%
sqrt-div62.0%
sqrt-div62.6%
frac-times62.5%
add-sqr-sqrt62.6%
Applied egg-rr76.4%
*-rgt-identity76.4%
*-commutative76.4%
distribute-lft-in81.4%
associate-*l/83.2%
associate-/l*83.8%
Simplified86.5%
Final simplification80.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.1e-185)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ 1.0 l) (* h (* -0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= d -2e-310)
(* (sqrt (* h (pow l -3.0))) (* (/ (pow (* D M) 2.0) d) 0.125))
(*
d
(/
(fma -0.5 (* h (/ (pow (* D (* M (/ 0.5 d))) 2.0) l)) 1.0)
(* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.1e-185) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((1.0 / l) * (h * (-0.5 * pow(((D * M) / (d * 2.0)), 2.0))))));
} else if (d <= -2e-310) {
tmp = sqrt((h * pow(l, -3.0))) * ((pow((D * M), 2.0) / d) * 0.125);
} else {
tmp = d * (fma(-0.5, (h * (pow((D * (M * (0.5 / d))), 2.0) / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.1e-185) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(1.0 / l) * Float64(h * Float64(-0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))))); elseif (d <= -2e-310) tmp = Float64(sqrt(Float64(h * (l ^ -3.0))) * Float64(Float64((Float64(D * M) ^ 2.0) / d) * 0.125)); else tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.1e-185], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[(-0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], N[(d * N[(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] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.1 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{1}{\ell} \cdot \left(h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{h \cdot {\ell}^{-3}} \cdot \left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot 0.125\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -2.1e-185Initial program 78.5%
Simplified76.2%
associate-*l/80.7%
clear-num80.7%
*-commutative80.7%
add-sqr-sqrt80.7%
pow280.7%
unpow280.7%
sqrt-prod49.3%
add-sqr-sqrt80.7%
associate-/l/80.7%
Applied egg-rr80.7%
associate-/r/80.7%
associate-*r/83.0%
Simplified83.0%
if -2.1e-185 < d < -1.999999999999994e-310Initial program 39.7%
Simplified39.7%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt53.0%
*-commutative53.0%
mul-1-neg53.0%
Simplified53.0%
associate-*r/53.0%
div-inv53.0%
pow-flip53.0%
metadata-eval53.0%
pow-prod-down53.3%
Applied egg-rr53.3%
associate-/l*53.1%
distribute-rgt-neg-out53.1%
distribute-lft-neg-in53.1%
metadata-eval53.1%
associate-*r/53.1%
unpow253.1%
swap-sqr53.0%
unpow253.0%
unpow253.0%
*-commutative53.0%
unpow253.0%
unpow253.0%
swap-sqr53.1%
unpow253.1%
Simplified53.1%
if -1.999999999999994e-310 < d Initial program 66.0%
Simplified65.4%
sub-neg65.4%
distribute-rgt-in58.3%
*-un-lft-identity58.3%
*-commutative58.3%
sqrt-div62.0%
sqrt-div62.6%
frac-times62.5%
add-sqr-sqrt62.6%
Applied egg-rr76.4%
*-rgt-identity76.4%
*-commutative76.4%
distribute-lft-in81.4%
associate-*l/83.2%
associate-/l*83.8%
Simplified86.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (pow (* D M) 2.0) d))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (/ d h))))
(if (<= d -5.2e-269)
(* t_1 (* t_2 (+ 1.0 (* -0.125 (* (/ h l) (pow (* M (/ D d)) 2.0))))))
(if (<= d 3.2e-299)
(* (sqrt (* h (pow l -3.0))) (* t_0 0.125))
(if (<= d 5.1e-133)
(* (sqrt (/ h (pow l 3.0))) (* t_0 -0.125))
(*
t_2
(*
t_1
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (* M 0.5) (/ D d)) 2.0)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * M), 2.0) / d;
double t_1 = sqrt((d / l));
double t_2 = sqrt((d / h));
double tmp;
if (d <= -5.2e-269) {
tmp = t_1 * (t_2 * (1.0 + (-0.125 * ((h / l) * pow((M * (D / d)), 2.0)))));
} else if (d <= 3.2e-299) {
tmp = sqrt((h * pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 5.1e-133) {
tmp = sqrt((h / pow(l, 3.0))) * (t_0 * -0.125);
} else {
tmp = t_2 * (t_1 * (1.0 + (-0.5 * ((h / l) * pow(((M * 0.5) * (D / d)), 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((d_1 * m) ** 2.0d0) / d
t_1 = sqrt((d / l))
t_2 = sqrt((d / h))
if (d <= (-5.2d-269)) then
tmp = t_1 * (t_2 * (1.0d0 + ((-0.125d0) * ((h / l) * ((m * (d_1 / d)) ** 2.0d0)))))
else if (d <= 3.2d-299) then
tmp = sqrt((h * (l ** (-3.0d0)))) * (t_0 * 0.125d0)
else if (d <= 5.1d-133) then
tmp = sqrt((h / (l ** 3.0d0))) * (t_0 * (-0.125d0))
else
tmp = t_2 * (t_1 * (1.0d0 + ((-0.5d0) * ((h / l) * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)))))
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((D * M), 2.0) / d;
double t_1 = Math.sqrt((d / l));
double t_2 = Math.sqrt((d / h));
double tmp;
if (d <= -5.2e-269) {
tmp = t_1 * (t_2 * (1.0 + (-0.125 * ((h / l) * Math.pow((M * (D / d)), 2.0)))));
} else if (d <= 3.2e-299) {
tmp = Math.sqrt((h * Math.pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 5.1e-133) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (t_0 * -0.125);
} else {
tmp = t_2 * (t_1 * (1.0 + (-0.5 * ((h / l) * Math.pow(((M * 0.5) * (D / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * M), 2.0) / d t_1 = math.sqrt((d / l)) t_2 = math.sqrt((d / h)) tmp = 0 if d <= -5.2e-269: tmp = t_1 * (t_2 * (1.0 + (-0.125 * ((h / l) * math.pow((M * (D / d)), 2.0))))) elif d <= 3.2e-299: tmp = math.sqrt((h * math.pow(l, -3.0))) * (t_0 * 0.125) elif d <= 5.1e-133: tmp = math.sqrt((h / math.pow(l, 3.0))) * (t_0 * -0.125) else: tmp = t_2 * (t_1 * (1.0 + (-0.5 * ((h / l) * math.pow(((M * 0.5) * (D / d)), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = Float64((Float64(D * M) ^ 2.0) / d) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (d <= -5.2e-269) tmp = Float64(t_1 * Float64(t_2 * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(M * Float64(D / d)) ^ 2.0)))))); elseif (d <= 3.2e-299) tmp = Float64(sqrt(Float64(h * (l ^ -3.0))) * Float64(t_0 * 0.125)); elseif (d <= 5.1e-133) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(t_0 * -0.125)); else tmp = Float64(t_2 * Float64(t_1 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D * M) ^ 2.0) / d; t_1 = sqrt((d / l)); t_2 = sqrt((d / h)); tmp = 0.0; if (d <= -5.2e-269) tmp = t_1 * (t_2 * (1.0 + (-0.125 * ((h / l) * ((M * (D / d)) ^ 2.0))))); elseif (d <= 3.2e-299) tmp = sqrt((h * (l ^ -3.0))) * (t_0 * 0.125); elseif (d <= 5.1e-133) tmp = sqrt((h / (l ^ 3.0))) * (t_0 * -0.125); else tmp = t_2 * (t_1 * (1.0 + (-0.5 * ((h / l) * (((M * 0.5) * (D / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5.2e-269], N[(t$95$1 * N[(t$95$2 * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.2e-299], N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.1e-133], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * -0.125), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(D \cdot M\right)}^{2}}{d}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -5.2 \cdot 10^{-269}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{-299}:\\
\;\;\;\;\sqrt{h \cdot {\ell}^{-3}} \cdot \left(t\_0 \cdot 0.125\right)\\
\mathbf{elif}\;d \leq 5.1 \cdot 10^{-133}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(t\_0 \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if d < -5.2e-269Initial program 73.6%
Simplified71.8%
associate-*l/74.6%
clear-num74.6%
*-commutative74.6%
add-sqr-sqrt74.6%
pow274.6%
unpow274.6%
sqrt-prod45.7%
add-sqr-sqrt74.6%
associate-/l/74.6%
Applied egg-rr74.6%
associate-/r/74.6%
associate-*r/76.5%
Simplified76.5%
Taylor expanded in l around 0 44.1%
associate-*r*46.1%
times-frac44.4%
associate-*l/45.2%
unpow245.2%
unpow245.2%
times-frac55.7%
unpow255.7%
swap-sqr73.6%
unpow273.6%
*-commutative73.6%
*-commutative73.6%
Simplified73.6%
if -5.2e-269 < d < 3.20000000000000008e-299Initial program 25.6%
Simplified19.8%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt55.2%
*-commutative55.2%
mul-1-neg55.2%
Simplified55.2%
associate-*r/55.2%
div-inv55.2%
pow-flip55.2%
metadata-eval55.2%
pow-prod-down55.4%
Applied egg-rr55.4%
associate-/l*55.2%
distribute-rgt-neg-out55.2%
distribute-lft-neg-in55.2%
metadata-eval55.2%
associate-*r/55.2%
unpow255.2%
swap-sqr55.2%
unpow255.2%
unpow255.2%
*-commutative55.2%
unpow255.2%
unpow255.2%
swap-sqr55.2%
unpow255.2%
Simplified55.2%
if 3.20000000000000008e-299 < d < 5.0999999999999999e-133Initial program 40.4%
Simplified40.4%
add-sqr-sqrt40.4%
pow240.4%
sqrt-prod40.4%
sqrt-pow149.4%
metadata-eval49.4%
pow149.4%
*-commutative49.4%
div-inv49.4%
metadata-eval49.4%
Applied egg-rr49.4%
Taylor expanded in d around 0 46.3%
associate-*r*46.3%
*-commutative46.3%
unpow246.3%
unpow246.3%
swap-sqr68.1%
unpow268.1%
Simplified68.1%
if 5.0999999999999999e-133 < d Initial program 75.6%
Simplified75.7%
fma-undefine75.7%
Applied egg-rr75.7%
Final simplification72.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (pow (* D M) 2.0) d))
(t_1
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* -0.125 (* (/ h l) (pow (* M (/ D d)) 2.0))))))))
(if (<= d -3.9e-271)
t_1
(if (<= d 3.2e-299)
(* (sqrt (* h (pow l -3.0))) (* t_0 0.125))
(if (<= d 5.5e-134) (* (sqrt (/ h (pow l 3.0))) (* t_0 -0.125)) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * M), 2.0) / d;
double t_1 = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * pow((M * (D / d)), 2.0)))));
double tmp;
if (d <= -3.9e-271) {
tmp = t_1;
} else if (d <= 3.2e-299) {
tmp = sqrt((h * pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 5.5e-134) {
tmp = sqrt((h / pow(l, 3.0))) * (t_0 * -0.125);
} 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 = ((d_1 * m) ** 2.0d0) / d
t_1 = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.125d0) * ((h / l) * ((m * (d_1 / d)) ** 2.0d0)))))
if (d <= (-3.9d-271)) then
tmp = t_1
else if (d <= 3.2d-299) then
tmp = sqrt((h * (l ** (-3.0d0)))) * (t_0 * 0.125d0)
else if (d <= 5.5d-134) then
tmp = sqrt((h / (l ** 3.0d0))) * (t_0 * (-0.125d0))
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((D * M), 2.0) / d;
double t_1 = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * Math.pow((M * (D / d)), 2.0)))));
double tmp;
if (d <= -3.9e-271) {
tmp = t_1;
} else if (d <= 3.2e-299) {
tmp = Math.sqrt((h * Math.pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 5.5e-134) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (t_0 * -0.125);
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * M), 2.0) / d t_1 = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * math.pow((M * (D / d)), 2.0))))) tmp = 0 if d <= -3.9e-271: tmp = t_1 elif d <= 3.2e-299: tmp = math.sqrt((h * math.pow(l, -3.0))) * (t_0 * 0.125) elif d <= 5.5e-134: tmp = math.sqrt((h / math.pow(l, 3.0))) * (t_0 * -0.125) else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64((Float64(D * M) ^ 2.0) / d) t_1 = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(M * Float64(D / d)) ^ 2.0)))))) tmp = 0.0 if (d <= -3.9e-271) tmp = t_1; elseif (d <= 3.2e-299) tmp = Float64(sqrt(Float64(h * (l ^ -3.0))) * Float64(t_0 * 0.125)); elseif (d <= 5.5e-134) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(t_0 * -0.125)); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D * M) ^ 2.0) / d; t_1 = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * ((M * (D / d)) ^ 2.0))))); tmp = 0.0; if (d <= -3.9e-271) tmp = t_1; elseif (d <= 3.2e-299) tmp = sqrt((h * (l ^ -3.0))) * (t_0 * 0.125); elseif (d <= 5.5e-134) tmp = sqrt((h / (l ^ 3.0))) * (t_0 * -0.125); else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.9e-271], t$95$1, If[LessEqual[d, 3.2e-299], N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.5e-134], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * -0.125), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(D \cdot M\right)}^{2}}{d}\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{if}\;d \leq -3.9 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{-299}:\\
\;\;\;\;\sqrt{h \cdot {\ell}^{-3}} \cdot \left(t\_0 \cdot 0.125\right)\\
\mathbf{elif}\;d \leq 5.5 \cdot 10^{-134}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(t\_0 \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if d < -3.89999999999999997e-271 or 5.5000000000000002e-134 < d Initial program 74.6%
Simplified73.7%
associate-*l/75.1%
clear-num75.1%
*-commutative75.1%
add-sqr-sqrt75.1%
pow275.1%
unpow275.1%
sqrt-prod45.7%
add-sqr-sqrt75.1%
associate-/l/75.1%
Applied egg-rr75.1%
associate-/r/75.1%
associate-*r/76.0%
Simplified76.0%
Taylor expanded in l around 0 44.1%
associate-*r*46.0%
times-frac46.1%
associate-*l/46.6%
unpow246.6%
unpow246.6%
times-frac59.2%
unpow259.2%
swap-sqr74.6%
unpow274.6%
*-commutative74.6%
*-commutative74.6%
Simplified74.6%
if -3.89999999999999997e-271 < d < 3.20000000000000008e-299Initial program 25.6%
Simplified19.8%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt55.2%
*-commutative55.2%
mul-1-neg55.2%
Simplified55.2%
associate-*r/55.2%
div-inv55.2%
pow-flip55.2%
metadata-eval55.2%
pow-prod-down55.4%
Applied egg-rr55.4%
associate-/l*55.2%
distribute-rgt-neg-out55.2%
distribute-lft-neg-in55.2%
metadata-eval55.2%
associate-*r/55.2%
unpow255.2%
swap-sqr55.2%
unpow255.2%
unpow255.2%
*-commutative55.2%
unpow255.2%
unpow255.2%
swap-sqr55.2%
unpow255.2%
Simplified55.2%
if 3.20000000000000008e-299 < d < 5.5000000000000002e-134Initial program 40.4%
Simplified40.4%
add-sqr-sqrt40.4%
pow240.4%
sqrt-prod40.4%
sqrt-pow149.4%
metadata-eval49.4%
pow149.4%
*-commutative49.4%
div-inv49.4%
metadata-eval49.4%
Applied egg-rr49.4%
Taylor expanded in d around 0 46.3%
associate-*r*46.3%
*-commutative46.3%
unpow246.3%
unpow246.3%
swap-sqr68.1%
unpow268.1%
Simplified68.1%
Final simplification72.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.5e+244)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ 1.0 l) (* h (* -0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(* 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 <= 1.5e+244) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((1.0 / l) * (h * (-0.5 * pow(((D * M) / (d * 2.0)), 2.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) :: tmp
if (l <= 1.5d+244) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((1.0d0 / l) * (h * ((-0.5d0) * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))))
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 <= 1.5e+244) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((1.0 / l) * (h * (-0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))));
} 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 <= 1.5e+244: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((1.0 / l) * (h * (-0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))))) 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 <= 1.5e+244) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(1.0 / l) * Float64(h * Float64(-0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.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) tmp = 0.0; if (l <= 1.5e+244) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((1.0 / l) * (h * (-0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.5e+244], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[(-0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1.5 \cdot 10^{+244}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{1}{\ell} \cdot \left(h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.4999999999999999e244Initial program 70.1%
Simplified68.9%
associate-*l/70.1%
clear-num70.1%
*-commutative70.1%
add-sqr-sqrt70.1%
pow270.1%
unpow270.1%
sqrt-prod41.3%
add-sqr-sqrt70.1%
associate-/l/70.1%
Applied egg-rr70.1%
associate-/r/70.1%
associate-*r/71.3%
Simplified71.3%
if 1.4999999999999999e244 < l Initial program 24.5%
Simplified30.4%
add-sqr-sqrt30.4%
pow230.4%
sqrt-prod30.4%
sqrt-pow146.8%
metadata-eval46.8%
pow146.8%
*-commutative46.8%
div-inv46.8%
metadata-eval46.8%
Applied egg-rr46.8%
Taylor expanded in d around inf 65.3%
unpow-165.3%
metadata-eval65.3%
pow-sqr65.4%
rem-sqrt-square65.4%
rem-square-sqrt65.3%
fabs-sqr65.3%
rem-square-sqrt65.4%
Simplified65.4%
*-commutative65.4%
unpow-prod-down70.8%
Applied egg-rr70.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.6e+113)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l)))
(* (sqrt (/ d l)) (sqrt (/ 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 <= 1.6e+113) {
tmp = (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (sqrt((d / l)) * sqrt((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 <= 1.6d+113) then
tmp = (1.0d0 - (0.5d0 * ((h * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)) / l))) * (sqrt((d / l)) * sqrt((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 <= 1.6e+113) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (Math.sqrt((d / l)) * Math.sqrt((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 <= 1.6e+113: tmp = (1.0 - (0.5 * ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (math.sqrt((d / l)) * math.sqrt((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 <= 1.6e+113) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * sqrt(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 <= 1.6e+113) tmp = (1.0 - (0.5 * ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l))) * (sqrt((d / l)) * sqrt((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, 1.6e+113], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[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 1.6 \cdot 10^{+113}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 1.5999999999999999e113Initial program 71.4%
Simplified70.9%
associate-*r/72.8%
*-commutative72.8%
div-inv72.8%
metadata-eval72.8%
Applied egg-rr72.8%
if 1.5999999999999999e113 < l Initial program 44.5%
Simplified44.6%
add-sqr-sqrt44.6%
pow244.6%
sqrt-prod44.6%
sqrt-pow153.7%
metadata-eval53.7%
pow153.7%
*-commutative53.7%
div-inv53.7%
metadata-eval53.7%
Applied egg-rr53.7%
Taylor expanded in d around inf 52.4%
unpow-152.4%
metadata-eval52.4%
pow-sqr52.4%
rem-sqrt-square52.4%
rem-square-sqrt52.2%
fabs-sqr52.2%
rem-square-sqrt52.4%
Simplified52.4%
*-commutative52.4%
unpow-prod-down61.2%
Applied egg-rr61.2%
Final simplification70.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (pow (* D M) 2.0) d)) (t_1 (sqrt (* (/ d l) (/ d h)))))
(if (<= d -6e-75)
(* (+ 1.0 (* -0.5 (* (* (/ h l) (pow (/ (* D M) d) 2.0)) 0.25))) t_1)
(if (<= d 3.2e-299)
(* (sqrt (* h (pow l -3.0))) (* t_0 0.125))
(if (<= d 3.1e-103)
(* (sqrt (/ h (pow l 3.0))) (* t_0 -0.125))
(*
(+ 1.0 (* -0.5 (* (pow (* M (/ D d)) 2.0) (* (/ h l) 0.25))))
t_1))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * M), 2.0) / d;
double t_1 = sqrt(((d / l) * (d / h)));
double tmp;
if (d <= -6e-75) {
tmp = (1.0 + (-0.5 * (((h / l) * pow(((D * M) / d), 2.0)) * 0.25))) * t_1;
} else if (d <= 3.2e-299) {
tmp = sqrt((h * pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 3.1e-103) {
tmp = sqrt((h / pow(l, 3.0))) * (t_0 * -0.125);
} else {
tmp = (1.0 + (-0.5 * (pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * 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 = ((d_1 * m) ** 2.0d0) / d
t_1 = sqrt(((d / l) * (d / h)))
if (d <= (-6d-75)) then
tmp = (1.0d0 + ((-0.5d0) * (((h / l) * (((d_1 * m) / d) ** 2.0d0)) * 0.25d0))) * t_1
else if (d <= 3.2d-299) then
tmp = sqrt((h * (l ** (-3.0d0)))) * (t_0 * 0.125d0)
else if (d <= 3.1d-103) then
tmp = sqrt((h / (l ** 3.0d0))) * (t_0 * (-0.125d0))
else
tmp = (1.0d0 + ((-0.5d0) * (((m * (d_1 / d)) ** 2.0d0) * ((h / l) * 0.25d0)))) * 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((D * M), 2.0) / d;
double t_1 = Math.sqrt(((d / l) * (d / h)));
double tmp;
if (d <= -6e-75) {
tmp = (1.0 + (-0.5 * (((h / l) * Math.pow(((D * M) / d), 2.0)) * 0.25))) * t_1;
} else if (d <= 3.2e-299) {
tmp = Math.sqrt((h * Math.pow(l, -3.0))) * (t_0 * 0.125);
} else if (d <= 3.1e-103) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (t_0 * -0.125);
} else {
tmp = (1.0 + (-0.5 * (Math.pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * M), 2.0) / d t_1 = math.sqrt(((d / l) * (d / h))) tmp = 0 if d <= -6e-75: tmp = (1.0 + (-0.5 * (((h / l) * math.pow(((D * M) / d), 2.0)) * 0.25))) * t_1 elif d <= 3.2e-299: tmp = math.sqrt((h * math.pow(l, -3.0))) * (t_0 * 0.125) elif d <= 3.1e-103: tmp = math.sqrt((h / math.pow(l, 3.0))) * (t_0 * -0.125) else: tmp = (1.0 + (-0.5 * (math.pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64((Float64(D * M) ^ 2.0) / d) t_1 = sqrt(Float64(Float64(d / l) * Float64(d / h))) tmp = 0.0 if (d <= -6e-75) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0)) * 0.25))) * t_1); elseif (d <= 3.2e-299) tmp = Float64(sqrt(Float64(h * (l ^ -3.0))) * Float64(t_0 * 0.125)); elseif (d <= 3.1e-103) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(t_0 * -0.125)); else tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64((Float64(M * Float64(D / d)) ^ 2.0) * Float64(Float64(h / l) * 0.25)))) * t_1); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((D * M) ^ 2.0) / d; t_1 = sqrt(((d / l) * (d / h))); tmp = 0.0; if (d <= -6e-75) tmp = (1.0 + (-0.5 * (((h / l) * (((D * M) / d) ^ 2.0)) * 0.25))) * t_1; elseif (d <= 3.2e-299) tmp = sqrt((h * (l ^ -3.0))) * (t_0 * 0.125); elseif (d <= 3.1e-103) tmp = sqrt((h / (l ^ 3.0))) * (t_0 * -0.125); else tmp = (1.0 + (-0.5 * (((M * (D / d)) ^ 2.0) * ((h / l) * 0.25)))) * t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -6e-75], N[(N[(1.0 + N[(-0.5 * N[(N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 3.2e-299], N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.1e-103], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * -0.125), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{{\left(D \cdot M\right)}^{2}}{d}\\
t_1 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;d \leq -6 \cdot 10^{-75}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right) \cdot 0.25\right)\right) \cdot t\_1\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{-299}:\\
\;\;\;\;\sqrt{h \cdot {\ell}^{-3}} \cdot \left(t\_0 \cdot 0.125\right)\\
\mathbf{elif}\;d \leq 3.1 \cdot 10^{-103}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(t\_0 \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left({\left(M \cdot \frac{D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot 0.25\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if d < -5.9999999999999997e-75Initial program 80.2%
Simplified80.2%
add-sqr-sqrt80.1%
pow280.1%
sqrt-prod80.1%
sqrt-pow182.6%
metadata-eval82.6%
pow182.6%
*-commutative82.6%
div-inv82.6%
metadata-eval82.6%
Applied egg-rr82.6%
add-sqr-sqrt82.6%
pow282.6%
Applied egg-rr82.6%
Applied egg-rr67.8%
unpow167.8%
associate-*r*67.8%
associate-*l/67.9%
Simplified67.9%
if -5.9999999999999997e-75 < d < 3.20000000000000008e-299Initial program 46.6%
Simplified44.4%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt47.3%
*-commutative47.3%
mul-1-neg47.3%
Simplified47.3%
associate-*r/47.3%
div-inv47.3%
pow-flip49.4%
metadata-eval49.4%
pow-prod-down53.8%
Applied egg-rr53.8%
associate-/l*53.7%
distribute-rgt-neg-out53.7%
distribute-lft-neg-in53.7%
metadata-eval53.7%
associate-*r/53.7%
unpow253.7%
swap-sqr49.4%
unpow249.4%
unpow249.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
swap-sqr53.7%
unpow253.7%
Simplified53.7%
if 3.20000000000000008e-299 < d < 3.1000000000000001e-103Initial program 45.7%
Simplified45.8%
add-sqr-sqrt45.8%
pow245.8%
sqrt-prod45.7%
sqrt-pow153.5%
metadata-eval53.5%
pow153.5%
*-commutative53.5%
div-inv53.5%
metadata-eval53.5%
Applied egg-rr53.5%
Taylor expanded in d around 0 50.8%
associate-*r*50.8%
*-commutative50.8%
unpow250.8%
unpow250.8%
swap-sqr69.7%
unpow269.7%
Simplified69.7%
if 3.1000000000000001e-103 < d Initial program 75.3%
Simplified75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-prod75.4%
sqrt-pow178.2%
metadata-eval78.2%
pow178.2%
*-commutative78.2%
div-inv78.2%
metadata-eval78.2%
Applied egg-rr78.2%
add-sqr-sqrt78.1%
pow278.1%
pow1/278.1%
sqrt-pow178.1%
metadata-eval78.1%
Applied egg-rr78.1%
Applied egg-rr68.5%
unpow168.5%
cancel-sign-sub-inv68.5%
metadata-eval68.5%
*-commutative68.5%
*-commutative68.5%
associate-*l*68.5%
*-commutative68.5%
*-commutative68.5%
Simplified68.5%
Final simplification65.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* (/ d l) (/ d h)))))
(if (<= l -1.22e+58)
(* (+ 1.0 (* -0.5 (* (* (/ h l) (pow (/ (* D M) d) 2.0)) 0.25))) t_0)
(if (<= l -28.0)
(* (sqrt (* h (pow l -3.0))) (* (/ (pow (* D M) 2.0) d) 0.125))
(if (<= l 9.8e+112)
(* (+ 1.0 (* -0.5 (* (pow (* M (/ D d)) 2.0) (* (/ h l) 0.25)))) 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 = sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -1.22e+58) {
tmp = (1.0 + (-0.5 * (((h / l) * pow(((D * M) / d), 2.0)) * 0.25))) * t_0;
} else if (l <= -28.0) {
tmp = sqrt((h * pow(l, -3.0))) * ((pow((D * M), 2.0) / d) * 0.125);
} else if (l <= 9.8e+112) {
tmp = (1.0 + (-0.5 * (pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * 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 = sqrt(((d / l) * (d / h)))
if (l <= (-1.22d+58)) then
tmp = (1.0d0 + ((-0.5d0) * (((h / l) * (((d_1 * m) / d) ** 2.0d0)) * 0.25d0))) * t_0
else if (l <= (-28.0d0)) then
tmp = sqrt((h * (l ** (-3.0d0)))) * ((((d_1 * m) ** 2.0d0) / d) * 0.125d0)
else if (l <= 9.8d+112) then
tmp = (1.0d0 + ((-0.5d0) * (((m * (d_1 / d)) ** 2.0d0) * ((h / l) * 0.25d0)))) * 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 = Math.sqrt(((d / l) * (d / h)));
double tmp;
if (l <= -1.22e+58) {
tmp = (1.0 + (-0.5 * (((h / l) * Math.pow(((D * M) / d), 2.0)) * 0.25))) * t_0;
} else if (l <= -28.0) {
tmp = Math.sqrt((h * Math.pow(l, -3.0))) * ((Math.pow((D * M), 2.0) / d) * 0.125);
} else if (l <= 9.8e+112) {
tmp = (1.0 + (-0.5 * (Math.pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * 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 = math.sqrt(((d / l) * (d / h))) tmp = 0 if l <= -1.22e+58: tmp = (1.0 + (-0.5 * (((h / l) * math.pow(((D * M) / d), 2.0)) * 0.25))) * t_0 elif l <= -28.0: tmp = math.sqrt((h * math.pow(l, -3.0))) * ((math.pow((D * M), 2.0) / d) * 0.125) elif l <= 9.8e+112: tmp = (1.0 + (-0.5 * (math.pow((M * (D / d)), 2.0) * ((h / l) * 0.25)))) * 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 = sqrt(Float64(Float64(d / l) * Float64(d / h))) tmp = 0.0 if (l <= -1.22e+58) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0)) * 0.25))) * t_0); elseif (l <= -28.0) tmp = Float64(sqrt(Float64(h * (l ^ -3.0))) * Float64(Float64((Float64(D * M) ^ 2.0) / d) * 0.125)); elseif (l <= 9.8e+112) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64((Float64(M * Float64(D / d)) ^ 2.0) * Float64(Float64(h / l) * 0.25)))) * 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 = sqrt(((d / l) * (d / h))); tmp = 0.0; if (l <= -1.22e+58) tmp = (1.0 + (-0.5 * (((h / l) * (((D * M) / d) ^ 2.0)) * 0.25))) * t_0; elseif (l <= -28.0) tmp = sqrt((h * (l ^ -3.0))) * ((((D * M) ^ 2.0) / d) * 0.125); elseif (l <= 9.8e+112) tmp = (1.0 + (-0.5 * (((M * (D / d)) ^ 2.0) * ((h / l) * 0.25)))) * 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[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.22e+58], N[(N[(1.0 + N[(-0.5 * N[(N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, -28.0], N[(N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.8e+112], N[(N[(1.0 + N[(-0.5 * N[(N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], 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 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{if}\;\ell \leq -1.22 \cdot 10^{+58}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right) \cdot 0.25\right)\right) \cdot t\_0\\
\mathbf{elif}\;\ell \leq -28:\\
\;\;\;\;\sqrt{h \cdot {\ell}^{-3}} \cdot \left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot 0.125\right)\\
\mathbf{elif}\;\ell \leq 9.8 \cdot 10^{+112}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left({\left(M \cdot \frac{D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot 0.25\right)\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.21999999999999995e58Initial program 58.5%
Simplified58.4%
add-sqr-sqrt58.4%
pow258.4%
sqrt-prod58.4%
sqrt-pow162.5%
metadata-eval62.5%
pow162.5%
*-commutative62.5%
div-inv62.5%
metadata-eval62.5%
Applied egg-rr62.5%
add-sqr-sqrt62.5%
pow262.5%
Applied egg-rr62.5%
Applied egg-rr44.9%
unpow144.9%
associate-*r*44.9%
associate-*l/45.0%
Simplified45.0%
if -1.21999999999999995e58 < l < -28Initial program 59.1%
Simplified59.0%
Taylor expanded in h around -inf 0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt45.6%
*-commutative45.6%
mul-1-neg45.6%
Simplified45.6%
associate-*r/45.6%
div-inv45.6%
pow-flip45.6%
metadata-eval45.6%
pow-prod-down73.1%
Applied egg-rr73.1%
associate-/l*73.1%
distribute-rgt-neg-out73.1%
distribute-lft-neg-in73.1%
metadata-eval73.1%
associate-*r/73.1%
unpow273.1%
swap-sqr45.6%
unpow245.6%
unpow245.6%
*-commutative45.6%
unpow245.6%
unpow245.6%
swap-sqr73.1%
unpow273.1%
Simplified73.1%
if -28 < l < 9.80000000000000008e112Initial program 76.3%
Simplified75.7%
add-sqr-sqrt75.7%
pow275.7%
sqrt-prod75.7%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
div-inv76.9%
metadata-eval76.9%
Applied egg-rr76.9%
add-sqr-sqrt76.7%
pow276.7%
pow1/276.7%
sqrt-pow176.8%
metadata-eval76.8%
Applied egg-rr76.8%
Applied egg-rr69.5%
unpow169.5%
cancel-sign-sub-inv69.5%
metadata-eval69.5%
*-commutative69.5%
*-commutative69.5%
associate-*l*69.5%
*-commutative69.5%
*-commutative69.5%
Simplified69.5%
if 9.80000000000000008e112 < l Initial program 44.5%
Simplified44.6%
add-sqr-sqrt44.6%
pow244.6%
sqrt-prod44.6%
sqrt-pow153.7%
metadata-eval53.7%
pow153.7%
*-commutative53.7%
div-inv53.7%
metadata-eval53.7%
Applied egg-rr53.7%
Taylor expanded in d around inf 52.4%
unpow-152.4%
metadata-eval52.4%
pow-sqr52.4%
rem-sqrt-square52.4%
rem-square-sqrt52.2%
fabs-sqr52.2%
rem-square-sqrt52.4%
Simplified52.4%
*-commutative52.4%
unpow-prod-down61.2%
Applied egg-rr61.2%
Final simplification63.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.42e+113)
(*
(+ 1.0 (* -0.5 (* (* (/ h l) (pow (/ (* D M) d) 2.0)) 0.25)))
(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 <= 1.42e+113) {
tmp = (1.0 + (-0.5 * (((h / l) * pow(((D * M) / d), 2.0)) * 0.25))) * 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 <= 1.42d+113) then
tmp = (1.0d0 + ((-0.5d0) * (((h / l) * (((d_1 * m) / d) ** 2.0d0)) * 0.25d0))) * 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 <= 1.42e+113) {
tmp = (1.0 + (-0.5 * (((h / l) * Math.pow(((D * M) / d), 2.0)) * 0.25))) * 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 <= 1.42e+113: tmp = (1.0 + (-0.5 * (((h / l) * math.pow(((D * M) / d), 2.0)) * 0.25))) * 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 <= 1.42e+113) tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0)) * 0.25))) * 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 <= 1.42e+113) tmp = (1.0 + (-0.5 * (((h / l) * (((D * M) / d) ^ 2.0)) * 0.25))) * 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, 1.42e+113], N[(N[(1.0 + N[(-0.5 * N[(N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 0.25), $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 1.42 \cdot 10^{+113}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right) \cdot 0.25\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 < 1.42e113Initial program 71.4%
Simplified70.9%
add-sqr-sqrt70.9%
pow270.9%
sqrt-prod70.9%
sqrt-pow172.6%
metadata-eval72.6%
pow172.6%
*-commutative72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
add-sqr-sqrt72.6%
pow272.6%
Applied egg-rr72.6%
Applied egg-rr62.2%
unpow162.2%
associate-*r*62.2%
associate-*l/62.7%
Simplified62.7%
if 1.42e113 < l Initial program 44.5%
Simplified44.6%
add-sqr-sqrt44.6%
pow244.6%
sqrt-prod44.6%
sqrt-pow153.7%
metadata-eval53.7%
pow153.7%
*-commutative53.7%
div-inv53.7%
metadata-eval53.7%
Applied egg-rr53.7%
Taylor expanded in d around inf 52.4%
unpow-152.4%
metadata-eval52.4%
pow-sqr52.4%
rem-sqrt-square52.4%
rem-square-sqrt52.2%
fabs-sqr52.2%
rem-square-sqrt52.4%
Simplified52.4%
*-commutative52.4%
unpow-prod-down61.2%
Applied egg-rr61.2%
Final simplification62.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -8.6e-246)
(* d (- (pow (* h l) -0.5)))
(if (<= l -2e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l 1.85e-216)
(* d (/ -1.0 (sqrt (* h l))))
(* 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 <= -8.6e-246) {
tmp = d * -pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= 1.85e-216) {
tmp = d * (-1.0 / sqrt((h * l)));
} 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 <= (-8.6d-246)) then
tmp = d * -((h * l) ** (-0.5d0))
else if (l <= (-2d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= 1.85d-216) then
tmp = d * ((-1.0d0) / sqrt((h * l)))
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 <= -8.6e-246) {
tmp = d * -Math.pow((h * l), -0.5);
} else if (l <= -2e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= 1.85e-216) {
tmp = d * (-1.0 / Math.sqrt((h * l)));
} 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 <= -8.6e-246: tmp = d * -math.pow((h * l), -0.5) elif l <= -2e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= 1.85e-216: tmp = d * (-1.0 / math.sqrt((h * l))) 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 <= -8.6e-246) tmp = Float64(d * Float64(-(Float64(h * l) ^ -0.5))); elseif (l <= -2e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= 1.85e-216) tmp = Float64(d * Float64(-1.0 / sqrt(Float64(h * l)))); 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 <= -8.6e-246) tmp = d * -((h * l) ^ -0.5); elseif (l <= -2e-310) tmp = d * (((h * l) ^ 2.0) ^ -0.25); elseif (l <= 1.85e-216) tmp = d * (-1.0 / sqrt((h * l))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -8.6e-246], N[(d * (-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -2e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.85e-216], N[(d * N[(-1.0 / N[Sqrt[N[(h * l), $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 -8.6 \cdot 10^{-246}:\\
\;\;\;\;d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq 1.85 \cdot 10^{-216}:\\
\;\;\;\;d \cdot \frac{-1}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -8.59999999999999985e-246Initial program 65.6%
Simplified65.6%
add-sqr-sqrt65.6%
pow265.6%
sqrt-prod65.5%
sqrt-pow167.4%
metadata-eval67.4%
pow167.4%
*-commutative67.4%
div-inv67.4%
metadata-eval67.4%
Applied egg-rr67.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt39.8%
neg-mul-139.8%
unpow-139.8%
metadata-eval39.8%
pow-sqr39.8%
rem-sqrt-square40.2%
rem-square-sqrt40.0%
fabs-sqr40.0%
rem-square-sqrt40.2%
Simplified40.2%
if -8.59999999999999985e-246 < l < -1.999999999999994e-310Initial program 86.6%
Simplified86.6%
Taylor expanded in d around inf 54.5%
log1p-expm1-u73.4%
pow1/273.4%
inv-pow73.4%
pow-pow73.4%
metadata-eval73.4%
Applied egg-rr73.4%
log1p-expm1-u54.5%
sqr-pow54.5%
pow-prod-down60.7%
pow260.7%
*-commutative60.7%
metadata-eval60.7%
Applied egg-rr60.7%
if -1.999999999999994e-310 < l < 1.84999999999999998e-216Initial program 82.7%
Simplified82.7%
add-sqr-sqrt82.7%
pow282.7%
sqrt-prod82.7%
sqrt-pow182.7%
metadata-eval82.7%
pow182.7%
*-commutative82.7%
div-inv82.7%
metadata-eval82.7%
Applied egg-rr82.7%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt44.9%
neg-mul-144.9%
unpow-144.9%
metadata-eval44.9%
pow-sqr44.9%
rem-sqrt-square44.9%
rem-square-sqrt44.9%
fabs-sqr44.9%
rem-square-sqrt44.9%
Simplified44.9%
add-sqr-sqrt44.9%
unpow-prod-down44.9%
Applied egg-rr44.9%
pow-sqr44.9%
metadata-eval44.9%
unpow-144.9%
Simplified44.9%
if 1.84999999999999998e-216 < l Initial program 62.7%
Simplified61.9%
add-sqr-sqrt61.9%
pow261.9%
sqrt-prod61.9%
sqrt-pow166.7%
metadata-eval66.7%
pow166.7%
*-commutative66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
Taylor expanded in d around inf 41.9%
unpow-141.9%
metadata-eval41.9%
pow-sqr41.9%
rem-sqrt-square41.9%
rem-square-sqrt41.7%
fabs-sqr41.7%
rem-square-sqrt41.9%
Simplified41.9%
*-commutative41.9%
unpow-prod-down49.1%
Applied egg-rr49.1%
Final simplification45.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (<= l -9e-254)
(* d (- t_0))
(if (<= l 3.6e-308)
(* d t_0)
(if (<= l 1.16e-216)
(* d (/ -1.0 (sqrt (* h l))))
(* d (* (pow l -0.5) (pow h -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (l <= -9e-254) {
tmp = d * -t_0;
} else if (l <= 3.6e-308) {
tmp = d * t_0;
} else if (l <= 1.16e-216) {
tmp = d * (-1.0 / sqrt((h * l)));
} 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 = (h * l) ** (-0.5d0)
if (l <= (-9d-254)) then
tmp = d * -t_0
else if (l <= 3.6d-308) then
tmp = d * t_0
else if (l <= 1.16d-216) then
tmp = d * ((-1.0d0) / sqrt((h * l)))
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 = Math.pow((h * l), -0.5);
double tmp;
if (l <= -9e-254) {
tmp = d * -t_0;
} else if (l <= 3.6e-308) {
tmp = d * t_0;
} else if (l <= 1.16e-216) {
tmp = d * (-1.0 / Math.sqrt((h * l)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if l <= -9e-254: tmp = d * -t_0 elif l <= 3.6e-308: tmp = d * t_0 elif l <= 1.16e-216: tmp = d * (-1.0 / math.sqrt((h * l))) 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(h * l) ^ -0.5 tmp = 0.0 if (l <= -9e-254) tmp = Float64(d * Float64(-t_0)); elseif (l <= 3.6e-308) tmp = Float64(d * t_0); elseif (l <= 1.16e-216) tmp = Float64(d * Float64(-1.0 / sqrt(Float64(h * l)))); 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 = (h * l) ^ -0.5; tmp = 0.0; if (l <= -9e-254) tmp = d * -t_0; elseif (l <= 3.6e-308) tmp = d * t_0; elseif (l <= 1.16e-216) tmp = d * (-1.0 / sqrt((h * l))); 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[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -9e-254], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[l, 3.6e-308], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 1.16e-216], N[(d * N[(-1.0 / N[Sqrt[N[(h * l), $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}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -9 \cdot 10^{-254}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{-308}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{elif}\;\ell \leq 1.16 \cdot 10^{-216}:\\
\;\;\;\;d \cdot \frac{-1}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9e-254Initial program 65.6%
Simplified65.6%
add-sqr-sqrt65.6%
pow265.6%
sqrt-prod65.5%
sqrt-pow167.4%
metadata-eval67.4%
pow167.4%
*-commutative67.4%
div-inv67.4%
metadata-eval67.4%
Applied egg-rr67.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt39.8%
neg-mul-139.8%
unpow-139.8%
metadata-eval39.8%
pow-sqr39.8%
rem-sqrt-square40.2%
rem-square-sqrt40.0%
fabs-sqr40.0%
rem-square-sqrt40.2%
Simplified40.2%
if -9e-254 < l < 3.5999999999999999e-308Initial program 86.6%
Simplified86.6%
add-sqr-sqrt86.6%
pow286.6%
sqrt-prod86.6%
sqrt-pow186.6%
metadata-eval86.6%
pow186.6%
*-commutative86.6%
div-inv86.6%
metadata-eval86.6%
Applied egg-rr86.6%
Taylor expanded in d around inf 54.5%
unpow-154.5%
metadata-eval54.5%
pow-sqr54.5%
rem-sqrt-square54.5%
rem-square-sqrt54.5%
fabs-sqr54.5%
rem-square-sqrt54.5%
Simplified54.5%
if 3.5999999999999999e-308 < l < 1.15999999999999993e-216Initial program 82.7%
Simplified82.7%
add-sqr-sqrt82.7%
pow282.7%
sqrt-prod82.7%
sqrt-pow182.7%
metadata-eval82.7%
pow182.7%
*-commutative82.7%
div-inv82.7%
metadata-eval82.7%
Applied egg-rr82.7%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt44.9%
neg-mul-144.9%
unpow-144.9%
metadata-eval44.9%
pow-sqr44.9%
rem-sqrt-square44.9%
rem-square-sqrt44.9%
fabs-sqr44.9%
rem-square-sqrt44.9%
Simplified44.9%
add-sqr-sqrt44.9%
unpow-prod-down44.9%
Applied egg-rr44.9%
pow-sqr44.9%
metadata-eval44.9%
unpow-144.9%
Simplified44.9%
if 1.15999999999999993e-216 < l Initial program 62.7%
Simplified61.9%
add-sqr-sqrt61.9%
pow261.9%
sqrt-prod61.9%
sqrt-pow166.7%
metadata-eval66.7%
pow166.7%
*-commutative66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
Taylor expanded in d around inf 41.9%
unpow-141.9%
metadata-eval41.9%
pow-sqr41.9%
rem-sqrt-square41.9%
rem-square-sqrt41.7%
fabs-sqr41.7%
rem-square-sqrt41.9%
Simplified41.9%
*-commutative41.9%
unpow-prod-down49.1%
Applied egg-rr49.1%
Final simplification45.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (or (<= l -4.2e-246) (and (not (<= l -2e-310)) (<= l 1.25e-216)))
(* d (- t_0))
(* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if ((l <= -4.2e-246) || (!(l <= -2e-310) && (l <= 1.25e-216))) {
tmp = d * -t_0;
} else {
tmp = d * t_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) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if ((l <= (-4.2d-246)) .or. (.not. (l <= (-2d-310))) .and. (l <= 1.25d-216)) then
tmp = d * -t_0
else
tmp = d * t_0
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((h * l), -0.5);
double tmp;
if ((l <= -4.2e-246) || (!(l <= -2e-310) && (l <= 1.25e-216))) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if (l <= -4.2e-246) or (not (l <= -2e-310) and (l <= 1.25e-216)): tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if ((l <= -4.2e-246) || (!(l <= -2e-310) && (l <= 1.25e-216))) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if ((l <= -4.2e-246) || (~((l <= -2e-310)) && (l <= 1.25e-216))) tmp = d * -t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[Or[LessEqual[l, -4.2e-246], And[N[Not[LessEqual[l, -2e-310]], $MachinePrecision], LessEqual[l, 1.25e-216]]], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{-246} \lor \neg \left(\ell \leq -2 \cdot 10^{-310}\right) \land \ell \leq 1.25 \cdot 10^{-216}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -4.19999999999999989e-246 or -1.999999999999994e-310 < l < 1.25000000000000005e-216Initial program 68.7%
Simplified68.7%
add-sqr-sqrt68.7%
pow268.7%
sqrt-prod68.7%
sqrt-pow170.2%
metadata-eval70.2%
pow170.2%
*-commutative70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.7%
neg-mul-140.7%
unpow-140.7%
metadata-eval40.7%
pow-sqr40.7%
rem-sqrt-square41.0%
rem-square-sqrt40.9%
fabs-sqr40.9%
rem-square-sqrt41.0%
Simplified41.0%
if -4.19999999999999989e-246 < l < -1.999999999999994e-310 or 1.25000000000000005e-216 < l Initial program 65.4%
Simplified64.8%
add-sqr-sqrt64.8%
pow264.8%
sqrt-prod64.7%
sqrt-pow169.0%
metadata-eval69.0%
pow169.0%
*-commutative69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
Taylor expanded in d around inf 43.3%
unpow-143.3%
metadata-eval43.3%
pow-sqr43.3%
rem-sqrt-square43.3%
rem-square-sqrt43.2%
fabs-sqr43.2%
rem-square-sqrt43.3%
Simplified43.3%
Final simplification42.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (<= l -2e-252)
(* d (- t_0))
(if (<= l -3.1e-308)
(* d t_0)
(if (<= l 3.6e-215)
(* d (/ -1.0 (sqrt (* h l))))
(* d (sqrt (/ (/ 1.0 l) h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (l <= -2e-252) {
tmp = d * -t_0;
} else if (l <= -3.1e-308) {
tmp = d * t_0;
} else if (l <= 3.6e-215) {
tmp = d * (-1.0 / sqrt((h * l)));
} else {
tmp = d * sqrt(((1.0 / l) / 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 = (h * l) ** (-0.5d0)
if (l <= (-2d-252)) then
tmp = d * -t_0
else if (l <= (-3.1d-308)) then
tmp = d * t_0
else if (l <= 3.6d-215) then
tmp = d * ((-1.0d0) / sqrt((h * l)))
else
tmp = d * sqrt(((1.0d0 / l) / h))
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((h * l), -0.5);
double tmp;
if (l <= -2e-252) {
tmp = d * -t_0;
} else if (l <= -3.1e-308) {
tmp = d * t_0;
} else if (l <= 3.6e-215) {
tmp = d * (-1.0 / Math.sqrt((h * l)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if l <= -2e-252: tmp = d * -t_0 elif l <= -3.1e-308: tmp = d * t_0 elif l <= 3.6e-215: tmp = d * (-1.0 / math.sqrt((h * l))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (l <= -2e-252) tmp = Float64(d * Float64(-t_0)); elseif (l <= -3.1e-308) tmp = Float64(d * t_0); elseif (l <= 3.6e-215) tmp = Float64(d * Float64(-1.0 / sqrt(Float64(h * l)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if (l <= -2e-252) tmp = d * -t_0; elseif (l <= -3.1e-308) tmp = d * t_0; elseif (l <= 3.6e-215) tmp = d * (-1.0 / sqrt((h * l))); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -2e-252], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[l, -3.1e-308], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 3.6e-215], N[(d * N[(-1.0 / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-252}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{elif}\;\ell \leq -3.1 \cdot 10^{-308}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{-215}:\\
\;\;\;\;d \cdot \frac{-1}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -1.99999999999999989e-252Initial program 65.6%
Simplified65.6%
add-sqr-sqrt65.6%
pow265.6%
sqrt-prod65.5%
sqrt-pow167.4%
metadata-eval67.4%
pow167.4%
*-commutative67.4%
div-inv67.4%
metadata-eval67.4%
Applied egg-rr67.4%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt39.8%
neg-mul-139.8%
unpow-139.8%
metadata-eval39.8%
pow-sqr39.8%
rem-sqrt-square40.2%
rem-square-sqrt40.0%
fabs-sqr40.0%
rem-square-sqrt40.2%
Simplified40.2%
if -1.99999999999999989e-252 < l < -3.09999999999999992e-308Initial program 86.6%
Simplified86.6%
add-sqr-sqrt86.6%
pow286.6%
sqrt-prod86.6%
sqrt-pow186.6%
metadata-eval86.6%
pow186.6%
*-commutative86.6%
div-inv86.6%
metadata-eval86.6%
Applied egg-rr86.6%
Taylor expanded in d around inf 54.5%
unpow-154.5%
metadata-eval54.5%
pow-sqr54.5%
rem-sqrt-square54.5%
rem-square-sqrt54.5%
fabs-sqr54.5%
rem-square-sqrt54.5%
Simplified54.5%
if -3.09999999999999992e-308 < l < 3.5999999999999999e-215Initial program 82.7%
Simplified82.7%
add-sqr-sqrt82.7%
pow282.7%
sqrt-prod82.7%
sqrt-pow182.7%
metadata-eval82.7%
pow182.7%
*-commutative82.7%
div-inv82.7%
metadata-eval82.7%
Applied egg-rr82.7%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt44.9%
neg-mul-144.9%
unpow-144.9%
metadata-eval44.9%
pow-sqr44.9%
rem-sqrt-square44.9%
rem-square-sqrt44.9%
fabs-sqr44.9%
rem-square-sqrt44.9%
Simplified44.9%
add-sqr-sqrt44.9%
unpow-prod-down44.9%
Applied egg-rr44.9%
pow-sqr44.9%
metadata-eval44.9%
unpow-144.9%
Simplified44.9%
if 3.5999999999999999e-215 < l Initial program 62.7%
Simplified61.9%
add-sqr-sqrt61.9%
pow261.9%
sqrt-prod61.9%
sqrt-pow166.7%
metadata-eval66.7%
pow166.7%
*-commutative66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
add-sqr-sqrt66.7%
pow266.7%
Applied egg-rr66.7%
Taylor expanded in d around inf 41.9%
associate-/l/42.1%
Simplified42.1%
Final simplification42.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)) (t_1 (* d (- t_0))))
(if (<= l -1.4e-254)
t_1
(if (<= l -6e-309)
(* d t_0)
(if (<= l 2.25e-215) t_1 (* d (sqrt (/ (/ 1.0 l) h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double t_1 = d * -t_0;
double tmp;
if (l <= -1.4e-254) {
tmp = t_1;
} else if (l <= -6e-309) {
tmp = d * t_0;
} else if (l <= 2.25e-215) {
tmp = t_1;
} else {
tmp = d * sqrt(((1.0 / l) / 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) :: t_1
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
t_1 = d * -t_0
if (l <= (-1.4d-254)) then
tmp = t_1
else if (l <= (-6d-309)) then
tmp = d * t_0
else if (l <= 2.25d-215) then
tmp = t_1
else
tmp = d * sqrt(((1.0d0 / l) / h))
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((h * l), -0.5);
double t_1 = d * -t_0;
double tmp;
if (l <= -1.4e-254) {
tmp = t_1;
} else if (l <= -6e-309) {
tmp = d * t_0;
} else if (l <= 2.25e-215) {
tmp = t_1;
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) t_1 = d * -t_0 tmp = 0 if l <= -1.4e-254: tmp = t_1 elif l <= -6e-309: tmp = d * t_0 elif l <= 2.25e-215: tmp = t_1 else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 t_1 = Float64(d * Float64(-t_0)) tmp = 0.0 if (l <= -1.4e-254) tmp = t_1; elseif (l <= -6e-309) tmp = Float64(d * t_0); elseif (l <= 2.25e-215) tmp = t_1; else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; t_1 = d * -t_0; tmp = 0.0; if (l <= -1.4e-254) tmp = t_1; elseif (l <= -6e-309) tmp = d * t_0; elseif (l <= 2.25e-215) tmp = t_1; else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(d * (-t$95$0)), $MachinePrecision]}, If[LessEqual[l, -1.4e-254], t$95$1, If[LessEqual[l, -6e-309], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 2.25e-215], t$95$1, N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
t_1 := d \cdot \left(-t\_0\right)\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -6 \cdot 10^{-309}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -1.39999999999999992e-254 or -6.000000000000001e-309 < l < 2.25e-215Initial program 68.7%
Simplified68.7%
add-sqr-sqrt68.7%
pow268.7%
sqrt-prod68.7%
sqrt-pow170.2%
metadata-eval70.2%
pow170.2%
*-commutative70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.7%
neg-mul-140.7%
unpow-140.7%
metadata-eval40.7%
pow-sqr40.7%
rem-sqrt-square41.0%
rem-square-sqrt40.9%
fabs-sqr40.9%
rem-square-sqrt41.0%
Simplified41.0%
if -1.39999999999999992e-254 < l < -6.000000000000001e-309Initial program 86.6%
Simplified86.6%
add-sqr-sqrt86.6%
pow286.6%
sqrt-prod86.6%
sqrt-pow186.6%
metadata-eval86.6%
pow186.6%
*-commutative86.6%
div-inv86.6%
metadata-eval86.6%
Applied egg-rr86.6%
Taylor expanded in d around inf 54.5%
unpow-154.5%
metadata-eval54.5%
pow-sqr54.5%
rem-sqrt-square54.5%
rem-square-sqrt54.5%
fabs-sqr54.5%
rem-square-sqrt54.5%
Simplified54.5%
if 2.25e-215 < l Initial program 62.7%
Simplified61.9%
add-sqr-sqrt61.9%
pow261.9%
sqrt-prod61.9%
sqrt-pow166.7%
metadata-eval66.7%
pow166.7%
*-commutative66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
add-sqr-sqrt66.7%
pow266.7%
Applied egg-rr66.7%
Taylor expanded in d around inf 41.9%
associate-/l/42.1%
Simplified42.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)) (t_1 (* d (- t_0))))
(if (<= l -7e-250)
t_1
(if (<= l -1.9e-308)
(* d t_0)
(if (<= l 8.5e-216) t_1 (* d (sqrt (/ (/ 1.0 h) l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double t_1 = d * -t_0;
double tmp;
if (l <= -7e-250) {
tmp = t_1;
} else if (l <= -1.9e-308) {
tmp = d * t_0;
} else if (l <= 8.5e-216) {
tmp = t_1;
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
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 = (h * l) ** (-0.5d0)
t_1 = d * -t_0
if (l <= (-7d-250)) then
tmp = t_1
else if (l <= (-1.9d-308)) then
tmp = d * t_0
else if (l <= 8.5d-216) then
tmp = t_1
else
tmp = d * sqrt(((1.0d0 / h) / l))
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((h * l), -0.5);
double t_1 = d * -t_0;
double tmp;
if (l <= -7e-250) {
tmp = t_1;
} else if (l <= -1.9e-308) {
tmp = d * t_0;
} else if (l <= 8.5e-216) {
tmp = t_1;
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) t_1 = d * -t_0 tmp = 0 if l <= -7e-250: tmp = t_1 elif l <= -1.9e-308: tmp = d * t_0 elif l <= 8.5e-216: tmp = t_1 else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 t_1 = Float64(d * Float64(-t_0)) tmp = 0.0 if (l <= -7e-250) tmp = t_1; elseif (l <= -1.9e-308) tmp = Float64(d * t_0); elseif (l <= 8.5e-216) tmp = t_1; else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; t_1 = d * -t_0; tmp = 0.0; if (l <= -7e-250) tmp = t_1; elseif (l <= -1.9e-308) tmp = d * t_0; elseif (l <= 8.5e-216) tmp = t_1; else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(d * (-t$95$0)), $MachinePrecision]}, If[LessEqual[l, -7e-250], t$95$1, If[LessEqual[l, -1.9e-308], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 8.5e-216], t$95$1, N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
t_1 := d \cdot \left(-t\_0\right)\\
\mathbf{if}\;\ell \leq -7 \cdot 10^{-250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1.9 \cdot 10^{-308}:\\
\;\;\;\;d \cdot t\_0\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < -6.9999999999999998e-250 or -1.9000000000000001e-308 < l < 8.50000000000000003e-216Initial program 68.7%
Simplified68.7%
add-sqr-sqrt68.7%
pow268.7%
sqrt-prod68.7%
sqrt-pow170.2%
metadata-eval70.2%
pow170.2%
*-commutative70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.7%
neg-mul-140.7%
unpow-140.7%
metadata-eval40.7%
pow-sqr40.7%
rem-sqrt-square41.0%
rem-square-sqrt40.9%
fabs-sqr40.9%
rem-square-sqrt41.0%
Simplified41.0%
if -6.9999999999999998e-250 < l < -1.9000000000000001e-308Initial program 86.6%
Simplified86.6%
add-sqr-sqrt86.6%
pow286.6%
sqrt-prod86.6%
sqrt-pow186.6%
metadata-eval86.6%
pow186.6%
*-commutative86.6%
div-inv86.6%
metadata-eval86.6%
Applied egg-rr86.6%
Taylor expanded in d around inf 54.5%
unpow-154.5%
metadata-eval54.5%
pow-sqr54.5%
rem-sqrt-square54.5%
rem-square-sqrt54.5%
fabs-sqr54.5%
rem-square-sqrt54.5%
Simplified54.5%
if 8.50000000000000003e-216 < l Initial program 62.7%
Simplified61.9%
Taylor expanded in d around inf 41.9%
associate-/r*42.1%
Simplified42.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -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 * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 67.1%
Simplified66.7%
add-sqr-sqrt66.7%
pow266.7%
sqrt-prod66.7%
sqrt-pow169.6%
metadata-eval69.6%
pow169.6%
*-commutative69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
Taylor expanded in d around inf 28.2%
unpow-128.2%
metadata-eval28.2%
pow-sqr28.2%
rem-sqrt-square28.2%
rem-square-sqrt28.1%
fabs-sqr28.1%
rem-square-sqrt28.2%
Simplified28.2%
herbie shell --seed 2024107
(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)))))