
(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 22 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 -2.7e-135)
(*
(* (/ t_0 (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(if (<= l -5e-310)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(* (sqrt (/ d h)) (/ t_0 (sqrt (- l)))))
(*
d
(/
(fma h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 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 (l <= -2.7e-135) {
tmp = ((t_0 / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))));
} else if (l <= -5e-310) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (sqrt((d / h)) * (t_0 / sqrt(-l)));
} else {
tmp = d * (fma(h, (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / 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 (l <= -2.7e-135) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))))); elseif (l <= -5e-310) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l))))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / 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[l, -2.7e-135], N[(N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / 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}\;\ell \leq -2.7 \cdot 10^{-135}:\\
\;\;\;\;\left(\frac{t\_0}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.69999999999999999e-135Initial program 63.9%
Simplified63.9%
frac-2neg63.0%
sqrt-div78.2%
Applied egg-rr79.1%
if -2.69999999999999999e-135 < l < -4.999999999999985e-310Initial program 55.9%
Simplified52.9%
associate-*r/62.9%
frac-times65.9%
*-commutative65.9%
*-un-lft-identity65.9%
times-frac65.9%
*-commutative65.9%
associate-/l/65.9%
times-frac65.9%
*-un-lft-identity65.9%
associate-*r/65.9%
add-sqr-sqrt65.9%
pow265.9%
sqrt-pow165.9%
metadata-eval65.9%
pow165.9%
associate-/l/65.9%
Applied egg-rr65.9%
frac-2neg65.9%
sqrt-div82.2%
Applied egg-rr82.2%
if -4.999999999999985e-310 < l Initial program 67.2%
Simplified67.2%
Applied egg-rr83.5%
unpow183.5%
associate-*l/87.8%
associate-/l*89.2%
Simplified94.1%
Final simplification86.7%
(FPCore (d h l M D)
:precision binary64
(if (<= h -2e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l))))
(*
d
(/
(fma h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2e-310) {
tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = d * (fma(h, (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / 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}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 61.9%
Simplified61.2%
associate-*r/63.8%
frac-times64.5%
*-commutative64.5%
*-un-lft-identity64.5%
times-frac63.8%
*-commutative63.8%
associate-/l/63.8%
times-frac64.5%
*-un-lft-identity64.5%
associate-*r/63.8%
add-sqr-sqrt63.8%
pow263.8%
sqrt-pow163.8%
metadata-eval63.8%
pow163.8%
associate-/l/63.8%
Applied egg-rr63.8%
frac-2neg63.8%
sqrt-div76.7%
Applied egg-rr76.7%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
Applied egg-rr83.5%
unpow183.5%
associate-*l/87.8%
associate-/l*89.2%
Simplified94.1%
Final simplification85.0%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.2e-159)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))))
(if (<= d -1.55e-307)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(*
d
(/
(fma h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.2e-159) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (sqrt((d / h)) * (sqrt(-d) / sqrt(-l)));
} else if (d <= -1.55e-307) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = d * (fma(h, (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.2e-159) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); elseif (d <= -1.55e-307) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(d * Float64(fma(h, Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.2e-159], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-307], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / 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 -4.2 \cdot 10^{-159}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-307}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -4.1999999999999998e-159Initial program 70.5%
Simplified69.5%
associate-*r/72.9%
frac-times73.9%
*-commutative73.9%
*-un-lft-identity73.9%
times-frac73.0%
*-commutative73.0%
associate-/l/73.0%
times-frac73.9%
*-un-lft-identity73.9%
associate-*r/73.0%
add-sqr-sqrt73.0%
pow273.0%
sqrt-pow173.0%
metadata-eval73.0%
pow173.0%
associate-/l/73.0%
Applied egg-rr73.0%
frac-2neg73.0%
sqrt-div83.1%
Applied egg-rr83.1%
if -4.1999999999999998e-159 < d < -1.5499999999999999e-307Initial program 39.0%
Simplified39.0%
*-commutative39.0%
sqrt-unprod24.9%
Applied egg-rr24.9%
Taylor expanded in d around -inf 62.5%
if -1.5499999999999999e-307 < d Initial program 66.7%
Simplified66.7%
Applied egg-rr82.8%
unpow182.8%
associate-*l/87.1%
associate-/l*88.5%
Simplified93.3%
Final simplification85.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l))))
(if (<= h -4.3e+250)
(* (/ 1.0 (sqrt (/ l d))) (* (sqrt (/ d h)) (+ 1.0 (* h t_0))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(* d (/ (fma h t_0 1.0) (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l);
double tmp;
if (h <= -4.3e+250) {
tmp = (1.0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0 + (h * t_0)));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = d * (fma(h, t_0, 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)) tmp = 0.0 if (h <= -4.3e+250) tmp = Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * t_0)))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(d * Float64(fma(h, t_0, 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -4.3e+250], N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * t$95$0 + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\\
\mathbf{if}\;h \leq -4.3 \cdot 10^{+250}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot t\_0\right)\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, t\_0, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -4.3e250Initial program 56.3%
Simplified56.3%
clear-num56.4%
sqrt-div56.4%
metadata-eval56.4%
Applied egg-rr56.4%
associate-*l/75.4%
*-commutative75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-pow175.4%
metadata-eval75.4%
pow175.4%
associate-/l/75.4%
Applied egg-rr75.4%
associate-/l*75.4%
*-commutative75.4%
associate-/l*75.5%
*-rgt-identity75.5%
associate-/l*75.5%
*-commutative75.5%
associate-/r*75.5%
metadata-eval75.5%
Simplified75.5%
if -4.3e250 < h < -1.999999999999994e-310Initial program 62.7%
Simplified61.9%
*-commutative61.9%
sqrt-unprod47.5%
Applied egg-rr47.5%
Taylor expanded in d around -inf 73.4%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
Applied egg-rr83.5%
unpow183.5%
associate-*l/87.8%
associate-/l*89.2%
Simplified94.1%
Final simplification83.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.4e+143)
(* (- d) (pow (* h l) -0.5))
(if (<= d -1.36e-45)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ (/ (* D M) d) 2.0) 2.0))))))
(if (<= d 1.5e-305)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(* d (/ (pow l -0.5) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.4e+143) {
tmp = -d * pow((h * l), -0.5);
} else if (d <= -1.36e-45) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((((D * M) / d) / 2.0), 2.0)))));
} else if (d <= 1.5e-305) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (pow(l, -0.5) / 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) :: tmp
if (d <= (-2.4d+143)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (d <= (-1.36d-45)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((((d_1 * m) / d) / 2.0d0) ** 2.0d0)))))
else if (d <= 1.5d-305) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else
tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d * ((l ** (-0.5d0)) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.4e+143) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (d <= -1.36e-45) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((((D * M) / d) / 2.0), 2.0)))));
} else if (d <= 1.5e-305) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.4e+143: tmp = -d * math.pow((h * l), -0.5) elif d <= -1.36e-45: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((((D * M) / d) / 2.0), 2.0))))) elif d <= 1.5e-305: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) else: tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (math.pow(l, -0.5) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.4e+143) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (d <= -1.36e-45) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(Float64(D * M) / d) / 2.0) ^ 2.0)))))); elseif (d <= 1.5e-305) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d * Float64((l ^ -0.5) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -2.4e+143) tmp = -d * ((h * l) ^ -0.5); elseif (d <= -1.36e-45) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((((D * M) / d) / 2.0) ^ 2.0))))); elseif (d <= 1.5e-305) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); else tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d * ((l ^ -0.5) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.4e+143], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.36e-45], 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[(N[(D * M), $MachinePrecision] / d), $MachinePrecision] / 2.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e-305], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.4 \cdot 10^{+143}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;d \leq -1.36 \cdot 10^{-45}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{\frac{D \cdot M}{d}}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;d \leq 1.5 \cdot 10^{-305}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if d < -2.3999999999999998e143Initial program 58.7%
Simplified58.7%
add-sqr-sqrt58.7%
pow258.7%
sqrt-prod58.7%
sqrt-pow158.7%
metadata-eval58.7%
frac-times58.7%
*-commutative58.7%
*-un-lft-identity58.7%
times-frac58.7%
*-commutative58.7%
associate-/l/58.7%
times-frac58.7%
*-un-lft-identity58.7%
associate-*r/58.7%
pow158.7%
associate-/l/58.7%
Applied egg-rr58.7%
associate-*l*58.7%
Simplified58.7%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt78.1%
neg-mul-178.1%
Simplified78.1%
if -2.3999999999999998e143 < d < -1.35999999999999998e-45Initial program 81.5%
Simplified81.5%
associate-*r/81.5%
*-un-lft-identity81.5%
times-frac81.5%
associate-/l/81.5%
*-commutative81.5%
times-frac81.5%
*-commutative81.5%
*-un-lft-identity81.5%
frac-times79.2%
associate-*l/79.2%
associate-*r/81.5%
Applied egg-rr81.5%
if -1.35999999999999998e-45 < d < 1.5000000000000001e-305Initial program 50.9%
Simplified50.9%
*-commutative50.9%
sqrt-unprod34.3%
Applied egg-rr34.3%
Taylor expanded in d around -inf 68.4%
if 1.5000000000000001e-305 < d Initial program 67.0%
Simplified66.9%
associate-*r/68.7%
frac-times68.8%
*-commutative68.8%
*-un-lft-identity68.8%
times-frac69.5%
*-commutative69.5%
associate-/l/69.5%
times-frac68.8%
*-un-lft-identity68.8%
associate-*r/69.5%
add-sqr-sqrt69.5%
pow269.5%
sqrt-pow169.5%
metadata-eval69.5%
pow169.5%
associate-/l/69.5%
Applied egg-rr69.5%
*-commutative69.5%
sqrt-div77.2%
sqrt-div86.5%
frac-times86.5%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
associate-/l/83.5%
Simplified83.5%
div-inv83.5%
pow1/283.5%
pow-flip83.5%
metadata-eval83.5%
Applied egg-rr83.5%
associate-*l/84.6%
associate-/l*86.6%
Simplified86.6%
Final simplification80.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.2e+216)
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(if (<= d -1.55e-307)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(if (<= d 1.65e-130)
(*
d
(/
(fma -0.5 (* h (/ (pow (/ (* D M) (* d 2.0)) 2.0) l)) 1.0)
(sqrt (* h l))))
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(/ (/ d (sqrt h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.2e+216) {
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
} else if (d <= -1.55e-307) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else if (d <= 1.65e-130) {
tmp = d * (fma(-0.5, (h * (pow(((D * M) / (d * 2.0)), 2.0) / l)), 1.0) / sqrt((h * l)));
} else {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * ((d / sqrt(h)) / sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.2e+216) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (d <= -1.55e-307) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); elseif (d <= 1.65e-130) tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) / l)), 1.0) / sqrt(Float64(h * l)))); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(Float64(d / sqrt(h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.2e+216], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-307], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.65e-130], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.2 \cdot 10^{+216}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-307}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{elif}\;d \leq 1.65 \cdot 10^{-130}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.20000000000000007e216Initial program 56.6%
Simplified56.6%
add-sqr-sqrt56.6%
pow256.6%
sqrt-prod56.6%
sqrt-pow156.6%
metadata-eval56.6%
frac-times56.6%
*-commutative56.6%
*-un-lft-identity56.6%
times-frac56.6%
*-commutative56.6%
associate-/l/56.6%
times-frac56.6%
*-un-lft-identity56.6%
associate-*r/56.6%
pow156.6%
associate-/l/56.6%
Applied egg-rr56.6%
associate-*l*56.6%
Simplified56.6%
Taylor expanded in D around 0 62.7%
frac-2neg62.7%
sqrt-div81.1%
Applied egg-rr81.1%
if -6.20000000000000007e216 < d < -1.5499999999999999e-307Initial program 63.4%
Simplified62.6%
*-commutative62.6%
sqrt-unprod48.3%
Applied egg-rr48.3%
Taylor expanded in d around -inf 68.7%
if -1.5499999999999999e-307 < d < 1.6499999999999999e-130Initial program 48.8%
Simplified46.3%
associate-*r/43.8%
frac-times46.4%
*-commutative46.4%
*-un-lft-identity46.4%
times-frac46.4%
*-commutative46.4%
associate-/l/46.4%
times-frac46.4%
*-un-lft-identity46.4%
associate-*r/46.4%
add-sqr-sqrt46.4%
pow246.4%
sqrt-pow146.4%
metadata-eval46.4%
pow146.4%
associate-/l/46.4%
Applied egg-rr46.4%
*-commutative46.4%
sqrt-div56.9%
sqrt-div72.9%
frac-times72.8%
add-sqr-sqrt72.9%
Applied egg-rr72.9%
associate-/l/67.5%
Simplified67.5%
associate-/l/72.9%
cancel-sign-sub-inv72.9%
associate-/l*73.0%
add-sqr-sqrt73.0%
pow273.0%
unpow-prod-down73.0%
associate-*r*70.3%
cancel-sign-sub-inv70.3%
associate-*l/84.2%
Applied egg-rr78.8%
associate-/l*78.7%
+-commutative78.7%
fma-define78.7%
associate-*r/81.3%
*-commutative81.3%
associate-/l*84.0%
associate-*r/84.0%
*-commutative84.0%
Simplified84.0%
if 1.6499999999999999e-130 < d Initial program 74.3%
Simplified75.3%
associate-*r/77.7%
frac-times76.7%
*-commutative76.7%
*-un-lft-identity76.7%
times-frac77.7%
*-commutative77.7%
associate-/l/77.7%
times-frac76.7%
*-un-lft-identity76.7%
associate-*r/77.7%
add-sqr-sqrt77.7%
pow277.7%
sqrt-pow177.7%
metadata-eval77.7%
pow177.7%
associate-/l/77.7%
Applied egg-rr77.7%
*-commutative77.7%
sqrt-div84.1%
sqrt-div90.4%
frac-times90.3%
add-sqr-sqrt90.5%
Applied egg-rr90.5%
associate-/l/88.4%
Simplified88.4%
Final simplification78.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -4e+250)
(*
(/ 1.0 (sqrt (/ l d)))
(*
(sqrt (/ d h))
(+ 1.0 (* h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l))))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(* d (/ (pow l -0.5) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4e+250) {
tmp = (1.0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0 + (h * (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)))));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (pow(l, -0.5) / 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) :: tmp
if (h <= (-4d+250)) then
tmp = (1.0d0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0d0 + (h * (((d_1 * (m * (0.5d0 / d))) ** 2.0d0) * ((-0.5d0) / l)))))
else if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else
tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d * ((l ** (-0.5d0)) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4e+250) {
tmp = (1.0 / Math.sqrt((l / d))) * (Math.sqrt((d / h)) * (1.0 + (h * (Math.pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)))));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -4e+250: tmp = (1.0 / math.sqrt((l / d))) * (math.sqrt((d / h)) * (1.0 + (h * (math.pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l))))) elif h <= -2e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) else: tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (math.pow(l, -0.5) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -4e+250) tmp = Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)))))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d * Float64((l ^ -0.5) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -4e+250) tmp = (1.0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0 + (h * (((D * (M * (0.5 / d))) ^ 2.0) * (-0.5 / l))))); elseif (h <= -2e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); else tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d * ((l ^ -0.5) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4e+250], N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4 \cdot 10^{+250}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -3.9999999999999997e250Initial program 56.3%
Simplified56.3%
clear-num56.4%
sqrt-div56.4%
metadata-eval56.4%
Applied egg-rr56.4%
associate-*l/75.4%
*-commutative75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-pow175.4%
metadata-eval75.4%
pow175.4%
associate-/l/75.4%
Applied egg-rr75.4%
associate-/l*75.4%
*-commutative75.4%
associate-/l*75.5%
*-rgt-identity75.5%
associate-/l*75.5%
*-commutative75.5%
associate-/r*75.5%
metadata-eval75.5%
Simplified75.5%
if -3.9999999999999997e250 < h < -1.999999999999994e-310Initial program 62.7%
Simplified61.9%
*-commutative61.9%
sqrt-unprod47.5%
Applied egg-rr47.5%
Taylor expanded in d around -inf 73.4%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
associate-*r/68.2%
frac-times68.2%
*-commutative68.2%
*-un-lft-identity68.2%
times-frac68.9%
*-commutative68.9%
associate-/l/68.9%
times-frac68.2%
*-un-lft-identity68.2%
associate-*r/68.9%
add-sqr-sqrt68.9%
pow268.9%
sqrt-pow168.9%
metadata-eval68.9%
pow168.9%
associate-/l/68.9%
Applied egg-rr68.9%
*-commutative68.9%
sqrt-div76.6%
sqrt-div85.8%
frac-times85.8%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
associate-/l/82.8%
Simplified82.8%
div-inv82.8%
pow1/282.8%
pow-flip82.8%
metadata-eval82.8%
Applied egg-rr82.8%
associate-*l/83.9%
associate-/l*85.9%
Simplified85.9%
Final simplification79.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
(if (<= h -4.5e+251)
(* t_0 (* (sqrt (/ d l)) (sqrt (/ d h))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(* t_0 (* d (/ (pow l -0.5) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (h <= -4.5e+251) {
tmp = t_0 * (sqrt((d / l)) * sqrt((d / h)));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = t_0 * (d * (pow(l, -0.5) / 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 = 1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
if (h <= (-4.5d+251)) then
tmp = t_0 * (sqrt((d / l)) * sqrt((d / h)))
else if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else
tmp = t_0 * (d * ((l ** (-0.5d0)) / 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 = 1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (h <= -4.5e+251) {
tmp = t_0 * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = t_0 * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l)) tmp = 0 if h <= -4.5e+251: tmp = t_0 * (math.sqrt((d / l)) * math.sqrt((d / h))) elif h <= -2e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) else: tmp = t_0 * (d * (math.pow(l, -0.5) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) tmp = 0.0 if (h <= -4.5e+251) tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(t_0 * Float64(d * Float64((l ^ -0.5) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l)); tmp = 0.0; if (h <= -4.5e+251) tmp = t_0 * (sqrt((d / l)) * sqrt((d / h))); elseif (h <= -2e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); else tmp = t_0 * (d * ((l ^ -0.5) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -4.5e+251], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;h \leq -4.5 \cdot 10^{+251}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -4.4999999999999998e251Initial program 56.3%
Simplified56.3%
associate-*r/75.4%
frac-times75.4%
*-commutative75.4%
*-un-lft-identity75.4%
times-frac75.4%
*-commutative75.4%
associate-/l/75.4%
times-frac75.4%
*-un-lft-identity75.4%
associate-*r/75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-pow175.4%
metadata-eval75.4%
pow175.4%
associate-/l/75.4%
Applied egg-rr75.4%
if -4.4999999999999998e251 < h < -1.999999999999994e-310Initial program 62.7%
Simplified61.9%
*-commutative61.9%
sqrt-unprod47.5%
Applied egg-rr47.5%
Taylor expanded in d around -inf 73.4%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
associate-*r/68.2%
frac-times68.2%
*-commutative68.2%
*-un-lft-identity68.2%
times-frac68.9%
*-commutative68.9%
associate-/l/68.9%
times-frac68.2%
*-un-lft-identity68.2%
associate-*r/68.9%
add-sqr-sqrt68.9%
pow268.9%
sqrt-pow168.9%
metadata-eval68.9%
pow168.9%
associate-/l/68.9%
Applied egg-rr68.9%
*-commutative68.9%
sqrt-div76.6%
sqrt-div85.8%
frac-times85.8%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
associate-/l/82.8%
Simplified82.8%
div-inv82.8%
pow1/282.8%
pow-flip82.8%
metadata-eval82.8%
Applied egg-rr82.8%
associate-*l/83.9%
associate-/l*85.9%
Simplified85.9%
Final simplification79.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
(if (<= h -3.2e+252)
(* t_0 (sqrt (* (/ d l) (/ d h))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(* t_0 (* d (/ (pow l -0.5) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (h <= -3.2e+252) {
tmp = t_0 * sqrt(((d / l) * (d / h)));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = t_0 * (d * (pow(l, -0.5) / 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 = 1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
if (h <= (-3.2d+252)) then
tmp = t_0 * sqrt(((d / l) * (d / h)))
else if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else
tmp = t_0 * (d * ((l ** (-0.5d0)) / 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 = 1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (h <= -3.2e+252) {
tmp = t_0 * Math.sqrt(((d / l) * (d / h)));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = t_0 * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l)) tmp = 0 if h <= -3.2e+252: tmp = t_0 * math.sqrt(((d / l) * (d / h))) elif h <= -2e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) else: tmp = t_0 * (d * (math.pow(l, -0.5) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) tmp = 0.0 if (h <= -3.2e+252) tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(t_0 * Float64(d * Float64((l ^ -0.5) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l)); tmp = 0.0; if (h <= -3.2e+252) tmp = t_0 * sqrt(((d / l) * (d / h))); elseif (h <= -2e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); else tmp = t_0 * (d * ((l ^ -0.5) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+252], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+252}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -3.2000000000000002e252Initial program 56.3%
Simplified56.3%
associate-*r/75.4%
frac-times75.4%
*-commutative75.4%
*-un-lft-identity75.4%
times-frac75.4%
*-commutative75.4%
associate-/l/75.4%
times-frac75.4%
*-un-lft-identity75.4%
associate-*r/75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-pow175.4%
metadata-eval75.4%
pow175.4%
associate-/l/75.4%
Applied egg-rr75.4%
*-commutative56.3%
sqrt-unprod38.5%
Applied egg-rr57.7%
if -3.2000000000000002e252 < h < -1.999999999999994e-310Initial program 62.7%
Simplified61.9%
*-commutative61.9%
sqrt-unprod47.5%
Applied egg-rr47.5%
Taylor expanded in d around -inf 73.4%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
associate-*r/68.2%
frac-times68.2%
*-commutative68.2%
*-un-lft-identity68.2%
times-frac68.9%
*-commutative68.9%
associate-/l/68.9%
times-frac68.2%
*-un-lft-identity68.2%
associate-*r/68.9%
add-sqr-sqrt68.9%
pow268.9%
sqrt-pow168.9%
metadata-eval68.9%
pow168.9%
associate-/l/68.9%
Applied egg-rr68.9%
*-commutative68.9%
sqrt-div76.6%
sqrt-div85.8%
frac-times85.8%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
associate-/l/82.8%
Simplified82.8%
div-inv82.8%
pow1/282.8%
pow-flip82.8%
metadata-eval82.8%
Applied egg-rr82.8%
associate-*l/83.9%
associate-/l*85.9%
Simplified85.9%
Final simplification78.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* D (/ M (* d 2.0))) 2.0)))
(if (<= h -7.8e+251)
(* (- 1.0 (* 0.5 (/ (* h t_0) l))) (sqrt (* (/ d l) (/ d h))))
(if (<= h -2e-310)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(* (/ d (sqrt h)) (/ (+ 1.0 (* (/ h l) (* -0.5 t_0))) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * (M / (d * 2.0))), 2.0);
double tmp;
if (h <= -7.8e+251) {
tmp = (1.0 - (0.5 * ((h * t_0) / l))) * sqrt(((d / l) * (d / h)));
} else if (h <= -2e-310) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (d / sqrt(h)) * ((1.0 + ((h / l) * (-0.5 * t_0))) / sqrt(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) :: tmp
t_0 = (d_1 * (m / (d * 2.0d0))) ** 2.0d0
if (h <= (-7.8d+251)) then
tmp = (1.0d0 - (0.5d0 * ((h * t_0) / l))) * sqrt(((d / l) * (d / h)))
else if (h <= (-2d-310)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else
tmp = (d / sqrt(h)) * ((1.0d0 + ((h / l) * ((-0.5d0) * t_0))) / sqrt(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((D * (M / (d * 2.0))), 2.0);
double tmp;
if (h <= -7.8e+251) {
tmp = (1.0 - (0.5 * ((h * t_0) / l))) * Math.sqrt(((d / l) * (d / h)));
} else if (h <= -2e-310) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else {
tmp = (d / Math.sqrt(h)) * ((1.0 + ((h / l) * (-0.5 * t_0))) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * (M / (d * 2.0))), 2.0) tmp = 0 if h <= -7.8e+251: tmp = (1.0 - (0.5 * ((h * t_0) / l))) * math.sqrt(((d / l) * (d / h))) elif h <= -2e-310: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) else: tmp = (d / math.sqrt(h)) * ((1.0 + ((h / l) * (-0.5 * t_0))) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0 tmp = 0.0 if (h <= -7.8e+251) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_0) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (h <= -2e-310) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); else tmp = Float64(Float64(d / sqrt(h)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * t_0))) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (D * (M / (d * 2.0))) ^ 2.0; tmp = 0.0; if (h <= -7.8e+251) tmp = (1.0 - (0.5 * ((h * t_0) / l))) * sqrt(((d / l) * (d / h))); elseif (h <= -2e-310) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); else tmp = (d / sqrt(h)) * ((1.0 + ((h / l) * (-0.5 * t_0))) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[h, -7.8e+251], N[(N[(1.0 - N[(0.5 * N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\\
\mathbf{if}\;h \leq -7.8 \cdot 10^{+251}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t\_0}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h}} \cdot \frac{1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot t\_0\right)}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -7.79999999999999951e251Initial program 56.3%
Simplified56.3%
associate-*r/75.4%
frac-times75.4%
*-commutative75.4%
*-un-lft-identity75.4%
times-frac75.4%
*-commutative75.4%
associate-/l/75.4%
times-frac75.4%
*-un-lft-identity75.4%
associate-*r/75.4%
add-sqr-sqrt75.4%
pow275.4%
sqrt-pow175.4%
metadata-eval75.4%
pow175.4%
associate-/l/75.4%
Applied egg-rr75.4%
*-commutative56.3%
sqrt-unprod38.5%
Applied egg-rr57.7%
if -7.79999999999999951e251 < h < -1.999999999999994e-310Initial program 62.7%
Simplified61.9%
*-commutative61.9%
sqrt-unprod47.5%
Applied egg-rr47.5%
Taylor expanded in d around -inf 73.4%
if -1.999999999999994e-310 < h Initial program 67.2%
Simplified67.2%
associate-*r/68.2%
frac-times68.2%
*-commutative68.2%
*-un-lft-identity68.2%
times-frac68.9%
*-commutative68.9%
associate-/l/68.9%
times-frac68.2%
*-un-lft-identity68.2%
associate-*r/68.9%
add-sqr-sqrt68.9%
pow268.9%
sqrt-pow168.9%
metadata-eval68.9%
pow168.9%
associate-/l/68.9%
Applied egg-rr68.9%
*-commutative68.9%
sqrt-div76.6%
sqrt-div85.8%
frac-times85.8%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
associate-/l/82.8%
Simplified82.8%
associate-*l/85.5%
cancel-sign-sub-inv85.5%
metadata-eval85.5%
associate-/l*83.0%
Applied egg-rr83.0%
associate-/l*83.0%
associate-*r*83.0%
*-commutative83.0%
Simplified83.0%
Final simplification77.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.45e-294)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(if (<= l 3.2e+204)
(*
d
(/
(fma -0.5 (* h (/ (pow (/ (* D M) (* d 2.0)) 2.0) l)) 1.0)
(sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.45e-294) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else if (l <= 3.2e+204) {
tmp = d * (fma(-0.5, (h * (pow(((D * M) / (d * 2.0)), 2.0) / l)), 1.0) / sqrt((h * l)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.45e-294) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); elseif (l <= 3.2e+204) tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) / l)), 1.0) / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.45e-294], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+204], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+204}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.45e-294Initial program 62.9%
Simplified62.1%
*-commutative62.1%
sqrt-unprod47.1%
Applied egg-rr47.1%
Taylor expanded in d around -inf 68.0%
if -1.45e-294 < l < 3.2e204Initial program 68.0%
Simplified68.0%
associate-*r/70.2%
frac-times70.3%
*-commutative70.3%
*-un-lft-identity70.3%
times-frac71.1%
*-commutative71.1%
associate-/l/71.1%
times-frac70.3%
*-un-lft-identity70.3%
associate-*r/71.1%
add-sqr-sqrt71.1%
pow271.1%
sqrt-pow171.1%
metadata-eval71.1%
pow171.1%
associate-/l/71.1%
Applied egg-rr71.1%
*-commutative71.1%
sqrt-div75.6%
sqrt-div85.0%
frac-times84.9%
add-sqr-sqrt85.1%
Applied egg-rr85.1%
associate-/l/83.1%
Simplified83.1%
associate-/l/85.1%
cancel-sign-sub-inv85.1%
associate-/l*81.1%
add-sqr-sqrt81.1%
pow281.1%
unpow-prod-down82.9%
associate-*r*82.0%
cancel-sign-sub-inv82.0%
associate-*l/86.3%
Applied egg-rr74.8%
associate-/l*75.6%
+-commutative75.6%
fma-define75.6%
associate-*r/81.5%
*-commutative81.5%
associate-/l*81.5%
associate-*r/80.6%
*-commutative80.6%
Simplified80.6%
if 3.2e204 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification74.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
(if (<= l -2.25e+26)
(* (- d) (pow (* h l) -0.5))
(if (<= l 5.8e-290)
(* t_0 (sqrt (* (/ d l) (/ d h))))
(if (<= l 1e+204)
(* t_0 (/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2.25e+26) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= 5.8e-290) {
tmp = t_0 * sqrt(((d / l) * (d / h)));
} else if (l <= 1e+204) {
tmp = t_0 * (d / sqrt((h * l)));
} 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 = 1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
if (l <= (-2.25d+26)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= 5.8d-290) then
tmp = t_0 * sqrt(((d / l) * (d / h)))
else if (l <= 1d+204) then
tmp = t_0 * (d / sqrt((h * l)))
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 = 1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2.25e+26) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= 5.8e-290) {
tmp = t_0 * Math.sqrt(((d / l) * (d / h)));
} else if (l <= 1e+204) {
tmp = t_0 * (d / Math.sqrt((h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l)) tmp = 0 if l <= -2.25e+26: tmp = -d * math.pow((h * l), -0.5) elif l <= 5.8e-290: tmp = t_0 * math.sqrt(((d / l) * (d / h))) elif l <= 1e+204: tmp = t_0 * (d / math.sqrt((h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -2.25e+26) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= 5.8e-290) tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (l <= 1e+204) tmp = Float64(t_0 * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l)); tmp = 0.0; if (l <= -2.25e+26) tmp = -d * ((h * l) ^ -0.5); elseif (l <= 5.8e-290) tmp = t_0 * sqrt(((d / l) * (d / h))); elseif (l <= 1e+204) tmp = t_0 * (d / sqrt((h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.25e+26], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e-290], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+204], N[(t$95$0 * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -2.25 \cdot 10^{+26}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-290}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 10^{+204}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.24999999999999989e26Initial program 59.9%
Simplified59.9%
add-sqr-sqrt59.9%
pow259.9%
sqrt-prod59.9%
sqrt-pow163.0%
metadata-eval63.0%
frac-times64.6%
*-commutative64.6%
*-un-lft-identity64.6%
times-frac63.0%
*-commutative63.0%
associate-/l/63.0%
times-frac64.6%
*-un-lft-identity64.6%
associate-*r/63.0%
pow163.0%
associate-/l/63.0%
Applied egg-rr63.0%
associate-*l*61.5%
Simplified61.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
neg-mul-153.3%
Simplified53.3%
if -2.24999999999999989e26 < l < 5.79999999999999989e-290Initial program 64.8%
Simplified63.4%
associate-*r/69.4%
frac-times70.8%
*-commutative70.8%
*-un-lft-identity70.8%
times-frac69.4%
*-commutative69.4%
associate-/l/69.4%
times-frac70.8%
*-un-lft-identity70.8%
associate-*r/69.4%
add-sqr-sqrt69.4%
pow269.4%
sqrt-pow169.4%
metadata-eval69.4%
pow169.4%
associate-/l/69.4%
Applied egg-rr69.4%
*-commutative63.4%
sqrt-unprod51.6%
Applied egg-rr57.6%
if 5.79999999999999989e-290 < l < 9.99999999999999989e203Initial program 68.8%
Simplified68.7%
associate-*r/71.0%
frac-times71.0%
*-commutative71.0%
*-un-lft-identity71.0%
times-frac71.9%
*-commutative71.9%
associate-/l/71.9%
times-frac71.0%
*-un-lft-identity71.0%
associate-*r/71.9%
add-sqr-sqrt71.9%
pow271.9%
sqrt-pow171.9%
metadata-eval71.9%
pow171.9%
associate-/l/71.9%
Applied egg-rr71.9%
*-commutative71.9%
sqrt-div76.7%
sqrt-div86.4%
frac-times86.3%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
associate-/l/84.5%
Simplified84.5%
associate-/l/86.5%
div-inv86.5%
sqrt-unprod80.5%
*-commutative80.5%
Applied egg-rr80.5%
associate-*r/80.6%
*-rgt-identity80.6%
Simplified80.6%
if 9.99999999999999989e203 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification67.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.4e+25)
(* (- d) (pow (* h l) -0.5))
(if (<= l 5.1e-290)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* 0.5 (* (/ h l) (pow (/ (* D (* 0.5 M)) d) 2.0)))))
(if (<= l 2.9e+205)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.4e+25) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= 5.1e-290) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * pow(((D * (0.5 * M)) / d), 2.0))));
} else if (l <= 2.9e+205) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((h * l)));
} 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) :: tmp
if (l <= (-1.4d+25)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= 5.1d-290) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 * (0.5d0 * m)) / d) ** 2.0d0))))
else if (l <= 2.9d+205) then
tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((h * l)))
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 tmp;
if (l <= -1.4e+25) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= 5.1e-290) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D * (0.5 * M)) / d), 2.0))));
} else if (l <= 2.9e+205) {
tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.4e+25: tmp = -d * math.pow((h * l), -0.5) elif l <= 5.1e-290: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * math.pow(((D * (0.5 * M)) / d), 2.0)))) elif l <= 2.9e+205: tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.4e+25) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= 5.1e-290) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0))))); elseif (l <= 2.9e+205) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.4e+25) tmp = -d * ((h * l) ^ -0.5); elseif (l <= 5.1e-290) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * (((D * (0.5 * M)) / d) ^ 2.0)))); elseif (l <= 2.9e+205) tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.4e+25], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.1e-290], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+205], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{+25}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 5.1 \cdot 10^{-290}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+205}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.4000000000000001e25Initial program 59.9%
Simplified59.9%
add-sqr-sqrt59.9%
pow259.9%
sqrt-prod59.9%
sqrt-pow163.0%
metadata-eval63.0%
frac-times64.6%
*-commutative64.6%
*-un-lft-identity64.6%
times-frac63.0%
*-commutative63.0%
associate-/l/63.0%
times-frac64.6%
*-un-lft-identity64.6%
associate-*r/63.0%
pow163.0%
associate-/l/63.0%
Applied egg-rr63.0%
associate-*l*61.5%
Simplified61.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt53.3%
neg-mul-153.3%
Simplified53.3%
if -1.4000000000000001e25 < l < 5.1e-290Initial program 64.8%
Simplified63.4%
*-commutative63.4%
sqrt-unprod51.6%
Applied egg-rr51.6%
associate-*r/53.0%
div-inv53.0%
metadata-eval53.0%
Applied egg-rr53.0%
if 5.1e-290 < l < 2.9000000000000001e205Initial program 68.8%
Simplified68.7%
associate-*r/71.0%
frac-times71.0%
*-commutative71.0%
*-un-lft-identity71.0%
times-frac71.9%
*-commutative71.9%
associate-/l/71.9%
times-frac71.0%
*-un-lft-identity71.0%
associate-*r/71.9%
add-sqr-sqrt71.9%
pow271.9%
sqrt-pow171.9%
metadata-eval71.9%
pow171.9%
associate-/l/71.9%
Applied egg-rr71.9%
*-commutative71.9%
sqrt-div76.7%
sqrt-div86.4%
frac-times86.3%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
associate-/l/84.5%
Simplified84.5%
associate-/l/86.5%
div-inv86.5%
sqrt-unprod80.5%
*-commutative80.5%
Applied egg-rr80.5%
associate-*r/80.6%
*-rgt-identity80.6%
Simplified80.6%
if 2.9000000000000001e205 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification65.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -9e-89)
(* (- d) (pow (* h l) -0.5))
(if (<= l 5.1e-290)
(*
(- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))
(sqrt (* (/ d l) (/ d h))))
(if (<= l 2.35e+210)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9e-89) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= 5.1e-290) {
tmp = (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * sqrt(((d / l) * (d / h)));
} else if (l <= 2.35e+210) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((h * l)));
} 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) :: tmp
if (l <= (-9d-89)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= 5.1d-290) then
tmp = (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * sqrt(((d / l) * (d / h)))
else if (l <= 2.35d+210) then
tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((h * l)))
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 tmp;
if (l <= -9e-89) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= 5.1e-290) {
tmp = (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * Math.sqrt(((d / l) * (d / h)));
} else if (l <= 2.35e+210) {
tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -9e-89: tmp = -d * math.pow((h * l), -0.5) elif l <= 5.1e-290: tmp = (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * math.sqrt(((d / l) * (d / h))) elif l <= 2.35e+210: tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -9e-89) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= 5.1e-290) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (l <= 2.35e+210) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -9e-89) tmp = -d * ((h * l) ^ -0.5); elseif (l <= 5.1e-290) tmp = (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * sqrt(((d / l) * (d / h))); elseif (l <= 2.35e+210) tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-89], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.1e-290], N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.35e+210], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-89}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 5.1 \cdot 10^{-290}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 2.35 \cdot 10^{+210}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -8.9999999999999998e-89Initial program 63.1%
Simplified63.1%
add-sqr-sqrt63.1%
pow263.1%
sqrt-prod63.1%
sqrt-pow165.4%
metadata-eval65.4%
frac-times66.6%
*-commutative66.6%
*-un-lft-identity66.6%
times-frac64.3%
*-commutative64.3%
associate-/l/64.3%
times-frac66.6%
*-un-lft-identity66.6%
associate-*r/64.3%
pow164.3%
associate-/l/64.3%
Applied egg-rr64.3%
associate-*l*63.2%
Simplified63.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.5%
neg-mul-151.5%
Simplified51.5%
if -8.9999999999999998e-89 < l < 5.1e-290Initial program 61.4%
Simplified59.3%
*-commutative59.3%
sqrt-unprod53.4%
Applied egg-rr53.4%
if 5.1e-290 < l < 2.35e210Initial program 68.8%
Simplified68.7%
associate-*r/71.0%
frac-times71.0%
*-commutative71.0%
*-un-lft-identity71.0%
times-frac71.9%
*-commutative71.9%
associate-/l/71.9%
times-frac71.0%
*-un-lft-identity71.0%
associate-*r/71.9%
add-sqr-sqrt71.9%
pow271.9%
sqrt-pow171.9%
metadata-eval71.9%
pow171.9%
associate-/l/71.9%
Applied egg-rr71.9%
*-commutative71.9%
sqrt-div76.7%
sqrt-div86.4%
frac-times86.3%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
associate-/l/84.5%
Simplified84.5%
associate-/l/86.5%
div-inv86.5%
sqrt-unprod80.5%
*-commutative80.5%
Applied egg-rr80.5%
associate-*r/80.6%
*-rgt-identity80.6%
Simplified80.6%
if 2.35e210 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification65.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.1e-86)
(* (- d) (pow (* h l) -0.5))
(if (<= l -1.45e-294)
(* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
(if (<= l 3.05e+206)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.1e-86) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -1.45e-294) {
tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else if (l <= 3.05e+206) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((h * l)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.1e-86) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -1.45e-294) tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); elseif (l <= 3.05e+206) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.1e-86], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.45e-294], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.05e+206], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.1 \cdot 10^{-86}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+206}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.09999999999999989e-86Initial program 63.4%
Simplified63.5%
add-sqr-sqrt63.4%
pow263.4%
sqrt-prod63.4%
sqrt-pow165.8%
metadata-eval65.8%
frac-times67.0%
*-commutative67.0%
*-un-lft-identity67.0%
times-frac64.7%
*-commutative64.7%
associate-/l/64.7%
times-frac67.0%
*-un-lft-identity67.0%
associate-*r/64.7%
pow164.7%
associate-/l/64.7%
Applied egg-rr64.7%
associate-*l*63.5%
Simplified63.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.5%
neg-mul-151.5%
Simplified51.5%
if -3.09999999999999989e-86 < l < -1.45e-294Initial program 61.9%
Simplified59.7%
add-sqr-sqrt59.7%
pow259.7%
sqrt-prod59.8%
sqrt-pow159.8%
metadata-eval59.8%
frac-times61.9%
*-commutative61.9%
*-un-lft-identity61.9%
times-frac61.9%
*-commutative61.9%
associate-/l/61.9%
times-frac61.9%
*-un-lft-identity61.9%
associate-*r/61.9%
pow161.9%
associate-/l/61.9%
Applied egg-rr61.9%
associate-*l*61.8%
Simplified61.8%
Taylor expanded in d around inf 13.1%
unpow1/213.1%
rem-exp-log13.1%
exp-neg13.1%
exp-prod13.1%
distribute-lft-neg-out13.1%
distribute-rgt-neg-in13.1%
metadata-eval13.1%
exp-to-pow13.1%
Simplified13.1%
expm1-log1p-u13.1%
expm1-undefine42.7%
Applied egg-rr42.7%
sub-neg42.7%
metadata-eval42.7%
+-commutative42.7%
log1p-undefine42.7%
rem-exp-log42.7%
+-commutative42.7%
fma-define42.7%
Simplified42.7%
if -1.45e-294 < l < 3.04999999999999983e206Initial program 68.0%
Simplified68.0%
associate-*r/70.2%
frac-times70.3%
*-commutative70.3%
*-un-lft-identity70.3%
times-frac71.1%
*-commutative71.1%
associate-/l/71.1%
times-frac70.3%
*-un-lft-identity70.3%
associate-*r/71.1%
add-sqr-sqrt71.1%
pow271.1%
sqrt-pow171.1%
metadata-eval71.1%
pow171.1%
associate-/l/71.1%
Applied egg-rr71.1%
*-commutative71.1%
sqrt-div75.6%
sqrt-div85.0%
frac-times84.9%
add-sqr-sqrt85.1%
Applied egg-rr85.1%
associate-/l/83.1%
Simplified83.1%
associate-/l/85.1%
div-inv85.1%
sqrt-unprod78.4%
*-commutative78.4%
Applied egg-rr78.4%
associate-*r/78.6%
*-rgt-identity78.6%
Simplified78.6%
if 3.04999999999999983e206 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification63.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.25e-82)
(* (- d) (pow (* h l) -0.5))
(if (<= l -5e-310)
(* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
(if (<= l 7e+203)
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0))))
(/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.25e-82) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -5e-310) {
tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else if (l <= 7e+203) {
tmp = (1.0 + ((h / l) * (-0.5 * pow((D * (M / (d * 2.0))), 2.0)))) * (d / sqrt((h * l)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.25e-82) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -5e-310) tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); elseif (l <= 7e+203) tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.25e-82], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+203], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.25 \cdot 10^{-82}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{+203}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.2499999999999999e-82Initial program 63.4%
Simplified63.5%
add-sqr-sqrt63.4%
pow263.4%
sqrt-prod63.4%
sqrt-pow165.8%
metadata-eval65.8%
frac-times67.0%
*-commutative67.0%
*-un-lft-identity67.0%
times-frac64.7%
*-commutative64.7%
associate-/l/64.7%
times-frac67.0%
*-un-lft-identity67.0%
associate-*r/64.7%
pow164.7%
associate-/l/64.7%
Applied egg-rr64.7%
associate-*l*63.5%
Simplified63.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.5%
neg-mul-151.5%
Simplified51.5%
if -2.2499999999999999e-82 < l < -4.999999999999985e-310Initial program 59.3%
Simplified57.2%
add-sqr-sqrt57.2%
pow257.2%
sqrt-prod57.3%
sqrt-pow157.4%
metadata-eval57.4%
frac-times59.5%
*-commutative59.5%
*-un-lft-identity59.5%
times-frac59.5%
*-commutative59.5%
associate-/l/59.5%
times-frac59.5%
*-un-lft-identity59.5%
associate-*r/59.5%
pow159.5%
associate-/l/59.5%
Applied egg-rr59.5%
associate-*l*59.4%
Simplified59.4%
Taylor expanded in d around inf 12.8%
unpow1/212.8%
rem-exp-log12.8%
exp-neg12.8%
exp-prod12.8%
distribute-lft-neg-out12.8%
distribute-rgt-neg-in12.8%
metadata-eval12.8%
exp-to-pow12.8%
Simplified12.8%
expm1-log1p-u12.8%
expm1-undefine41.1%
Applied egg-rr41.1%
sub-neg41.1%
metadata-eval41.1%
+-commutative41.1%
log1p-undefine41.1%
rem-exp-log41.1%
+-commutative41.1%
fma-define41.1%
Simplified41.1%
if -4.999999999999985e-310 < l < 7.00000000000000062e203Initial program 69.4%
Simplified69.3%
associate-*r/71.5%
frac-times71.6%
*-commutative71.6%
*-un-lft-identity71.6%
times-frac72.5%
*-commutative72.5%
associate-/l/72.5%
times-frac71.6%
*-un-lft-identity71.6%
associate-*r/72.5%
add-sqr-sqrt72.5%
pow272.5%
sqrt-pow172.5%
metadata-eval72.5%
pow172.5%
associate-/l/72.5%
Applied egg-rr72.5%
*-commutative72.5%
sqrt-div77.1%
sqrt-div86.7%
frac-times86.6%
add-sqr-sqrt86.8%
Applied egg-rr86.8%
associate-/l/84.8%
Simplified84.8%
associate-/l/86.8%
cancel-sign-sub-inv86.8%
associate-/l*82.7%
add-sqr-sqrt82.7%
pow282.7%
unpow-prod-down84.6%
associate-*r*83.7%
cancel-sign-sub-inv83.7%
associate-*l/88.0%
Applied egg-rr76.3%
associate-*l/75.0%
associate-*r*75.0%
*-commutative75.0%
Simplified75.0%
if 7.00000000000000062e203 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification61.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.45e-294)
(*
(* d (sqrt (/ 1.0 (* h l))))
(+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
(if (<= l 2.9e+206)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
(/ d (sqrt (* h l))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.45e-294) {
tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else if (l <= 2.9e+206) {
tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((h * l)));
} 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) :: tmp
if (l <= (-1.45d-294)) then
tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
else if (l <= 2.9d+206) then
tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((h * l)))
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 tmp;
if (l <= -1.45e-294) {
tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
} else if (l <= 2.9e+206) {
tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.45e-294: tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0) elif l <= 2.9e+206: tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.45e-294) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0)); elseif (l <= 2.9e+206) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.45e-294) tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0); elseif (l <= 2.9e+206) tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.45e-294], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+206], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+206}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.45e-294Initial program 62.9%
Simplified62.1%
*-commutative62.1%
sqrt-unprod47.1%
Applied egg-rr47.1%
Taylor expanded in d around -inf 68.0%
if -1.45e-294 < l < 2.9e206Initial program 68.0%
Simplified68.0%
associate-*r/70.2%
frac-times70.3%
*-commutative70.3%
*-un-lft-identity70.3%
times-frac71.1%
*-commutative71.1%
associate-/l/71.1%
times-frac70.3%
*-un-lft-identity70.3%
associate-*r/71.1%
add-sqr-sqrt71.1%
pow271.1%
sqrt-pow171.1%
metadata-eval71.1%
pow171.1%
associate-/l/71.1%
Applied egg-rr71.1%
*-commutative71.1%
sqrt-div75.6%
sqrt-div85.0%
frac-times84.9%
add-sqr-sqrt85.1%
Applied egg-rr85.1%
associate-/l/83.1%
Simplified83.1%
associate-/l/85.1%
div-inv85.1%
sqrt-unprod78.4%
*-commutative78.4%
Applied egg-rr78.4%
associate-*r/78.6%
*-rgt-identity78.6%
Simplified78.6%
if 2.9e206 < l Initial program 57.8%
Simplified57.8%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
Simplified49.6%
sqrt-div49.6%
metadata-eval49.6%
*-commutative49.6%
Applied egg-rr49.6%
un-div-inv49.6%
sqrt-prod78.3%
associate-/r*70.2%
Applied egg-rr70.2%
associate-/l/78.3%
Simplified78.3%
Final simplification73.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.8e-87)
(* (- d) (pow (* h l) -0.5))
(if (<= l -5e-310)
(* d (pow (+ -1.0 (fma h l 1.0)) -0.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 (l <= -4.8e-87) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -5e-310) {
tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.8e-87) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -5e-310) tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-87], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 -4.8 \cdot 10^{-87}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -4.7999999999999999e-87Initial program 63.4%
Simplified63.5%
add-sqr-sqrt63.4%
pow263.4%
sqrt-prod63.4%
sqrt-pow165.8%
metadata-eval65.8%
frac-times67.0%
*-commutative67.0%
*-un-lft-identity67.0%
times-frac64.7%
*-commutative64.7%
associate-/l/64.7%
times-frac67.0%
*-un-lft-identity67.0%
associate-*r/64.7%
pow164.7%
associate-/l/64.7%
Applied egg-rr64.7%
associate-*l*63.5%
Simplified63.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt51.5%
neg-mul-151.5%
Simplified51.5%
if -4.7999999999999999e-87 < l < -4.999999999999985e-310Initial program 59.3%
Simplified57.2%
add-sqr-sqrt57.2%
pow257.2%
sqrt-prod57.3%
sqrt-pow157.4%
metadata-eval57.4%
frac-times59.5%
*-commutative59.5%
*-un-lft-identity59.5%
times-frac59.5%
*-commutative59.5%
associate-/l/59.5%
times-frac59.5%
*-un-lft-identity59.5%
associate-*r/59.5%
pow159.5%
associate-/l/59.5%
Applied egg-rr59.5%
associate-*l*59.4%
Simplified59.4%
Taylor expanded in d around inf 12.8%
unpow1/212.8%
rem-exp-log12.8%
exp-neg12.8%
exp-prod12.8%
distribute-lft-neg-out12.8%
distribute-rgt-neg-in12.8%
metadata-eval12.8%
exp-to-pow12.8%
Simplified12.8%
expm1-log1p-u12.8%
expm1-undefine41.1%
Applied egg-rr41.1%
sub-neg41.1%
metadata-eval41.1%
+-commutative41.1%
log1p-undefine41.1%
rem-exp-log41.1%
+-commutative41.1%
fma-define41.1%
Simplified41.1%
if -4.999999999999985e-310 < l Initial program 67.2%
Simplified67.2%
add-sqr-sqrt67.2%
pow267.2%
sqrt-prod67.2%
sqrt-pow168.7%
metadata-eval68.7%
frac-times68.8%
*-commutative68.8%
*-un-lft-identity68.8%
times-frac69.5%
*-commutative69.5%
associate-/l/69.5%
times-frac68.8%
*-un-lft-identity68.8%
associate-*r/69.5%
pow169.5%
associate-/l/69.5%
Applied egg-rr69.5%
associate-*l*68.7%
Simplified68.7%
Taylor expanded in d around inf 40.0%
unpow1/240.0%
rem-exp-log37.8%
exp-neg37.8%
exp-prod38.4%
distribute-lft-neg-out38.4%
distribute-rgt-neg-in38.4%
metadata-eval38.4%
exp-to-pow40.6%
Simplified40.6%
*-commutative40.6%
unpow-prod-down49.1%
Applied egg-rr49.1%
Final simplification48.4%
(FPCore (d h l M D) :precision binary64 (if (<= d 8e-279) (* (- d) (pow (* h l) -0.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 (d <= 8e-279) {
tmp = -d * pow((h * l), -0.5);
} 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 (d <= 8d-279) then
tmp = -d * ((h * l) ** (-0.5d0))
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 (d <= 8e-279) {
tmp = -d * Math.pow((h * l), -0.5);
} 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 d <= 8e-279: tmp = -d * math.pow((h * l), -0.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 (d <= 8e-279) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); 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 (d <= 8e-279) tmp = -d * ((h * l) ^ -0.5); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 8e-279], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $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}\;d \leq 8 \cdot 10^{-279}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 8.00000000000000044e-279Initial program 61.5%
Simplified60.8%
add-sqr-sqrt60.8%
pow260.8%
sqrt-prod60.9%
sqrt-pow162.3%
metadata-eval62.3%
frac-times63.7%
*-commutative63.7%
*-un-lft-identity63.7%
times-frac62.3%
*-commutative62.3%
associate-/l/62.3%
times-frac63.7%
*-un-lft-identity63.7%
associate-*r/62.3%
pow162.3%
associate-/l/62.3%
Applied egg-rr62.3%
associate-*l*61.6%
Simplified61.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.1%
neg-mul-142.1%
Simplified42.1%
if 8.00000000000000044e-279 < d Initial program 68.2%
Simplified68.1%
add-sqr-sqrt68.1%
pow268.1%
sqrt-prod68.1%
sqrt-pow169.7%
metadata-eval69.7%
frac-times69.8%
*-commutative69.8%
*-un-lft-identity69.8%
times-frac70.6%
*-commutative70.6%
associate-/l/70.6%
times-frac69.8%
*-un-lft-identity69.8%
associate-*r/70.6%
pow170.6%
associate-/l/70.6%
Applied egg-rr70.6%
associate-*l*69.8%
Simplified69.8%
Taylor expanded in d around inf 41.4%
unpow1/241.4%
rem-exp-log39.0%
exp-neg39.0%
exp-prod39.6%
distribute-lft-neg-out39.6%
distribute-rgt-neg-in39.6%
metadata-eval39.6%
exp-to-pow42.0%
Simplified42.0%
*-commutative42.0%
unpow-prod-down51.2%
Applied egg-rr51.2%
Final simplification46.2%
(FPCore (d h l M D) :precision binary64 (if (<= d 1.35e-278) (* (- d) (pow (* h l) -0.5)) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.35e-278) {
tmp = -d * pow((h * l), -0.5);
} 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) :: tmp
if (d <= 1.35d-278) then
tmp = -d * ((h * l) ** (-0.5d0))
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 tmp;
if (d <= 1.35e-278) {
tmp = -d * Math.pow((h * l), -0.5);
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.35e-278: tmp = -d * math.pow((h * l), -0.5) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.35e-278) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 1.35e-278) tmp = -d * ((h * l) ^ -0.5); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.35e-278], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.35 \cdot 10^{-278}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < 1.3500000000000001e-278Initial program 61.5%
Simplified60.8%
add-sqr-sqrt60.8%
pow260.8%
sqrt-prod60.9%
sqrt-pow162.3%
metadata-eval62.3%
frac-times63.7%
*-commutative63.7%
*-un-lft-identity63.7%
times-frac62.3%
*-commutative62.3%
associate-/l/62.3%
times-frac63.7%
*-un-lft-identity63.7%
associate-*r/62.3%
pow162.3%
associate-/l/62.3%
Applied egg-rr62.3%
associate-*l*61.6%
Simplified61.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.1%
neg-mul-142.1%
Simplified42.1%
if 1.3500000000000001e-278 < d Initial program 68.2%
Simplified68.1%
Taylor expanded in d around inf 41.4%
*-commutative41.4%
Simplified41.4%
sqrt-div41.9%
metadata-eval41.9%
*-commutative41.9%
Applied egg-rr41.9%
un-div-inv42.0%
sqrt-prod51.2%
associate-/r*49.5%
Applied egg-rr49.5%
associate-/l/51.2%
Simplified51.2%
Final simplification46.1%
(FPCore (d h l M D) :precision binary64 (if (<= d 1.7e-278) (* (- d) (pow (* h l) -0.5)) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.7e-278) {
tmp = -d * pow((h * l), -0.5);
} else {
tmp = d / sqrt((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) :: tmp
if (d <= 1.7d-278) then
tmp = -d * ((h * l) ** (-0.5d0))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.7e-278) {
tmp = -d * Math.pow((h * l), -0.5);
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.7e-278: tmp = -d * math.pow((h * l), -0.5) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.7e-278) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 1.7e-278) tmp = -d * ((h * l) ^ -0.5); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.7e-278], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.7 \cdot 10^{-278}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 1.7e-278Initial program 61.5%
Simplified60.8%
add-sqr-sqrt60.8%
pow260.8%
sqrt-prod60.9%
sqrt-pow162.3%
metadata-eval62.3%
frac-times63.7%
*-commutative63.7%
*-un-lft-identity63.7%
times-frac62.3%
*-commutative62.3%
associate-/l/62.3%
times-frac63.7%
*-un-lft-identity63.7%
associate-*r/62.3%
pow162.3%
associate-/l/62.3%
Applied egg-rr62.3%
associate-*l*61.6%
Simplified61.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow1/20.0%
rem-exp-log0.0%
exp-neg0.0%
exp-prod0.0%
distribute-lft-neg-out0.0%
distribute-rgt-neg-in0.0%
metadata-eval0.0%
exp-to-pow0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.1%
neg-mul-142.1%
Simplified42.1%
if 1.7e-278 < d Initial program 68.2%
Simplified68.1%
Taylor expanded in d around inf 41.4%
*-commutative41.4%
Simplified41.4%
sqrt-div41.9%
metadata-eval41.9%
*-commutative41.9%
Applied egg-rr41.9%
un-div-inv42.0%
*-commutative42.0%
Applied egg-rr42.0%
Final simplification42.1%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((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 / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 64.5%
Simplified64.1%
Taylor expanded in d around inf 22.8%
*-commutative22.8%
Simplified22.8%
sqrt-div23.1%
metadata-eval23.1%
*-commutative23.1%
Applied egg-rr23.1%
un-div-inv23.1%
*-commutative23.1%
Applied egg-rr23.1%
Final simplification23.1%
herbie shell --seed 2024118
(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)))))