
(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 29 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
(if (<= d -5e-310)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(-
1.0
(*
0.5
(pow (* (/ D (* d (/ 2.0 M))) (/ (sqrt (- h)) (sqrt (- l)))) 2.0))))
(if (<= d 7.2e-208)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(fma (/ h l) (* (pow (* M (/ D (* d 2.0))) 2.0) -0.5) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow(((D / (d * (2.0 / M))) * (sqrt(-h) / sqrt(-l))), 2.0)));
} else if (d <= 7.2e-208) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = fma((h / l), (pow((M * (D / (d * 2.0))), 2.0) * -0.5), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(D / Float64(d * Float64(2.0 / M))) * Float64(sqrt(Float64(-h)) / sqrt(Float64(-l)))) ^ 2.0)))); elseif (d <= 7.2e-208) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(fma(Float64(h / l), Float64((Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-h)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.2e-208], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{D}{d \cdot \frac{2}{M}} \cdot \frac{\sqrt{-h}}{\sqrt{-\ell}}\right)}^{2}\right)\\
\mathbf{elif}\;d \leq 7.2 \cdot 10^{-208}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
Simplified68.8%
add-sqr-sqrt68.8%
pow268.8%
sqrt-prod68.8%
unpow268.8%
sqrt-prod45.4%
add-sqr-sqrt72.7%
clear-num72.6%
frac-times74.8%
*-un-lft-identity74.8%
*-commutative74.8%
Applied egg-rr74.8%
frac-2neg74.8%
sqrt-div78.2%
Applied egg-rr78.2%
if -4.999999999999985e-310 < d < 7.1999999999999997e-208Initial program 22.7%
Simplified22.5%
Taylor expanded in d around 0 44.4%
expm1-log1p-u44.4%
expm1-udef44.4%
associate-*l/44.1%
*-commutative44.1%
sqrt-div44.1%
sqrt-pow158.1%
metadata-eval58.1%
associate-*l/58.4%
pow-prod-down68.3%
Applied egg-rr68.3%
expm1-def68.3%
expm1-log1p69.1%
associate-*r/69.3%
associate-/l*69.1%
Simplified69.1%
if 7.1999999999999997e-208 < d Initial program 68.6%
Simplified68.6%
Applied egg-rr36.6%
expm1-def56.2%
expm1-log1p82.3%
*-commutative82.3%
+-commutative82.3%
*-commutative82.3%
associate-*r*82.3%
fma-def82.3%
Simplified82.3%
Final simplification78.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= t_0 INFINITY)
t_0
(* -0.125 (/ (sqrt h) (* (pow l 1.5) (/ d (pow (* D M) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = -0.125 * (sqrt(h) / (pow(l, 1.5) * (d / pow((D * M), 2.0))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = -0.125 * (Math.sqrt(h) / (Math.pow(l, 1.5) * (d / Math.pow((D * M), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = -0.125 * (math.sqrt(h) / (math.pow(l, 1.5) * (d / math.pow((D * M), 2.0)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(-0.125 * Float64(sqrt(h) / Float64((l ^ 1.5) * Float64(d / (Float64(D * M) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = -0.125 * (sqrt(h) / ((l ^ 1.5) * (d / ((D * M) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(-0.125 * N[(N[Sqrt[h], $MachinePrecision] / N[(N[Power[l, 1.5], $MachinePrecision] * N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{h}}{{\ell}^{1.5} \cdot \frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < +inf.0Initial program 80.4%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in d around 0 17.5%
sqrt-div19.5%
clear-num19.5%
frac-times19.5%
metadata-eval19.5%
sqrt-prod19.5%
*-un-lft-identity19.5%
pow-prod-down25.4%
sqrt-pow137.0%
metadata-eval37.0%
Applied egg-rr37.0%
Final simplification71.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(fma (/ h l) (* -0.5 (pow (/ D (* d (/ 2.0 M))) 2.0)) 1.0)))
(if (<= d 1.45e-207)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(fma (/ h l) (* (pow (* M (/ D (* d 2.0))) 2.0) -0.5) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * fma((h / l), (-0.5 * pow((D / (d * (2.0 / M))), 2.0)), 1.0));
} else if (d <= 1.45e-207) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = fma((h / l), (pow((M * (D / (d * 2.0))), 2.0) * -0.5), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * fma(Float64(h / l), Float64(-0.5 * (Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0)), 1.0))); elseif (d <= 1.45e-207) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(fma(Float64(h / l), Float64((Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e-207], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2}, 1\right)\right)\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-207}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
Simplified69.6%
frac-2neg69.6%
sqrt-div76.4%
Applied egg-rr76.4%
if -4.999999999999985e-310 < d < 1.45000000000000006e-207Initial program 22.7%
Simplified22.5%
Taylor expanded in d around 0 44.4%
expm1-log1p-u44.4%
expm1-udef44.4%
associate-*l/44.1%
*-commutative44.1%
sqrt-div44.1%
sqrt-pow158.1%
metadata-eval58.1%
associate-*l/58.4%
pow-prod-down68.3%
Applied egg-rr68.3%
expm1-def68.3%
expm1-log1p69.1%
associate-*r/69.3%
associate-/l*69.1%
Simplified69.1%
if 1.45000000000000006e-207 < d Initial program 68.6%
Simplified68.6%
Applied egg-rr36.6%
expm1-def56.2%
expm1-log1p82.3%
*-commutative82.3%
+-commutative82.3%
*-commutative82.3%
associate-*r*82.3%
fma-def82.3%
Simplified82.3%
Final simplification78.0%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (/ D (* d (/ 2.0 M))) 2.0)) l))))
(if (<= d 1.7e-229)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(/ d (sqrt l))
(/
(fma (pow (* 0.5 (/ M (/ d D))) 2.0) (* (/ h l) -0.5) 1.0)
(sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow((D / (d * (2.0 / M))), 2.0)) / l)));
} else if (d <= 1.7e-229) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = (d / sqrt(l)) * (fma(pow((0.5 * (M / (d / D))), 2.0), ((h / l) * -0.5), 1.0) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0)) / l)))); elseif (d <= 1.7e-229) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(Float64(d / sqrt(l)) * Float64(fma((Float64(0.5 * Float64(M / Float64(d / D))) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(d / 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[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e-229], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[N[(0.5 * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2}}{\ell}\right)\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{-229}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \frac{\mathsf{fma}\left({\left(0.5 \cdot \frac{M}{\frac{d}{D}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
Simplified68.8%
associate-*r/70.6%
clear-num70.6%
frac-times71.5%
*-un-lft-identity71.5%
*-commutative71.5%
Applied egg-rr71.5%
if -4.999999999999985e-310 < d < 1.7e-229Initial program 20.7%
Simplified20.4%
Taylor expanded in d around 0 39.6%
expm1-log1p-u39.6%
expm1-udef39.6%
associate-*l/39.1%
*-commutative39.1%
sqrt-div39.1%
sqrt-pow151.1%
metadata-eval51.1%
associate-*l/51.6%
pow-prod-down68.8%
Applied egg-rr68.8%
expm1-def68.8%
expm1-log1p70.3%
associate-*r/70.4%
associate-/l*70.3%
Simplified70.3%
if 1.7e-229 < d Initial program 64.1%
Simplified64.1%
Applied egg-rr32.8%
Simplified80.4%
Final simplification75.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d 5e-310)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (/ D (* d (/ 2.0 M))) 2.0)) l))))
(if (<= d 1.35e-207)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(fma (/ h l) (* (pow (* M (/ D (* d 2.0))) 2.0) -0.5) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5e-310) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow((D / (d * (2.0 / M))), 2.0)) / l)));
} else if (d <= 1.35e-207) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = fma((h / l), (pow((M * (D / (d * 2.0))), 2.0) * -0.5), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= 5e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0)) / l)))); elseif (d <= 1.35e-207) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(fma(Float64(h / l), Float64((Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5e-310], N[(N[(N[Sqrt[N[(d / 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[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-207], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2}}{\ell}\right)\\
\mathbf{elif}\;d \leq 1.35 \cdot 10^{-207}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < 4.999999999999985e-310Initial program 69.6%
Simplified68.8%
associate-*r/70.6%
clear-num70.6%
frac-times71.5%
*-un-lft-identity71.5%
*-commutative71.5%
Applied egg-rr71.5%
if 4.999999999999985e-310 < d < 1.35e-207Initial program 22.7%
Simplified22.5%
Taylor expanded in d around 0 44.4%
expm1-log1p-u44.4%
expm1-udef44.4%
associate-*l/44.1%
*-commutative44.1%
sqrt-div44.1%
sqrt-pow158.1%
metadata-eval58.1%
associate-*l/58.4%
pow-prod-down68.3%
Applied egg-rr68.3%
expm1-def68.3%
expm1-log1p69.1%
associate-*r/69.3%
associate-/l*69.1%
Simplified69.1%
if 1.35e-207 < d Initial program 68.6%
Simplified68.6%
Applied egg-rr36.6%
expm1-def56.2%
expm1-log1p82.3%
*-commutative82.3%
+-commutative82.3%
*-commutative82.3%
associate-*r*82.3%
fma-def82.3%
Simplified82.3%
Final simplification75.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (pow (* (sqrt (/ h l)) (* 0.5 (/ (* D M) d))) 2.0))))
(if (<= d 1.12e-207)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(fma (/ h l) (* (pow (* M (/ D (* d 2.0))) 2.0) -0.5) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow((sqrt((h / l)) * (0.5 * ((D * M) / d))), 2.0)));
} else if (d <= 1.12e-207) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = fma((h / l), (pow((M * (D / (d * 2.0))), 2.0) * -0.5), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(sqrt(Float64(h / l)) * Float64(0.5 * Float64(Float64(D * M) / d))) ^ 2.0)))); elseif (d <= 1.12e-207) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(fma(Float64(h / l), Float64((Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(0.5 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.12e-207], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(0.5 \cdot \frac{D \cdot M}{d}\right)\right)}^{2}\right)\\
\mathbf{elif}\;d \leq 1.12 \cdot 10^{-207}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
Simplified68.8%
add-sqr-sqrt68.8%
pow268.8%
sqrt-prod68.8%
unpow268.8%
sqrt-prod45.4%
add-sqr-sqrt72.7%
clear-num72.6%
frac-times74.8%
*-un-lft-identity74.8%
*-commutative74.8%
Applied egg-rr74.8%
Taylor expanded in D around 0 74.2%
if -4.999999999999985e-310 < d < 1.12000000000000001e-207Initial program 22.7%
Simplified22.5%
Taylor expanded in d around 0 44.4%
expm1-log1p-u44.4%
expm1-udef44.4%
associate-*l/44.1%
*-commutative44.1%
sqrt-div44.1%
sqrt-pow158.1%
metadata-eval58.1%
associate-*l/58.4%
pow-prod-down68.3%
Applied egg-rr68.3%
expm1-def68.3%
expm1-log1p69.1%
associate-*r/69.3%
associate-/l*69.1%
Simplified69.1%
if 1.12000000000000001e-207 < d Initial program 68.6%
Simplified68.6%
Applied egg-rr36.6%
expm1-def56.2%
expm1-log1p82.3%
*-commutative82.3%
+-commutative82.3%
*-commutative82.3%
associate-*r*82.3%
fma-def82.3%
Simplified82.3%
Final simplification76.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (pow (* (/ D (* d (/ 2.0 M))) (sqrt (/ h l))) 2.0))))
(if (<= d 7.6e-208)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(*
(fma (/ h l) (* (pow (* M (/ D (* d 2.0))) 2.0) -0.5) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow(((D / (d * (2.0 / M))) * sqrt((h / l))), 2.0)));
} else if (d <= 7.6e-208) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else {
tmp = fma((h / l), (pow((M * (D / (d * 2.0))), 2.0) * -0.5), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(D / Float64(d * Float64(2.0 / M))) * sqrt(Float64(h / l))) ^ 2.0)))); elseif (d <= 7.6e-208) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); else tmp = Float64(fma(Float64(h / l), Float64((Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.6e-208], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{D}{d \cdot \frac{2}{M}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{elif}\;d \leq 7.6 \cdot 10^{-208}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
Simplified68.8%
add-sqr-sqrt68.8%
pow268.8%
sqrt-prod68.8%
unpow268.8%
sqrt-prod45.4%
add-sqr-sqrt72.7%
clear-num72.6%
frac-times74.8%
*-un-lft-identity74.8%
*-commutative74.8%
Applied egg-rr74.8%
if -4.999999999999985e-310 < d < 7.60000000000000023e-208Initial program 22.7%
Simplified22.5%
Taylor expanded in d around 0 44.4%
expm1-log1p-u44.4%
expm1-udef44.4%
associate-*l/44.1%
*-commutative44.1%
sqrt-div44.1%
sqrt-pow158.1%
metadata-eval58.1%
associate-*l/58.4%
pow-prod-down68.3%
Applied egg-rr68.3%
expm1-def68.3%
expm1-log1p69.1%
associate-*r/69.3%
associate-/l*69.1%
Simplified69.1%
if 7.60000000000000023e-208 < d Initial program 68.6%
Simplified68.6%
Applied egg-rr36.6%
expm1-def56.2%
expm1-log1p82.3%
*-commutative82.3%
+-commutative82.3%
*-commutative82.3%
associate-*r*82.3%
fma-def82.3%
Simplified82.3%
Final simplification77.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ M 2.0) (/ D d)) 2.0))))))))
(if (<= d -5e-310)
t_0
(if (<= d 6e-124)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(if (<= d 7e+67) t_0 (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow(((M / 2.0) * (D / d)), 2.0)))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 6e-124) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else if (d <= 7e+67) {
tmp = t_0;
} else {
tmp = d * (sqrt((1.0 / h)) / 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 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0)))))
if (d <= (-5d-310)) then
tmp = t_0
else if (d <= 6d-124) then
tmp = (-0.125d0) * ((sqrt(h) / (l ** 1.5d0)) / (d / ((d_1 * m) ** 2.0d0)))
else if (d <= 7d+67) then
tmp = t_0
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((M / 2.0) * (D / d)), 2.0)))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 6e-124) {
tmp = -0.125 * ((Math.sqrt(h) / Math.pow(l, 1.5)) / (d / Math.pow((D * M), 2.0)));
} else if (d <= 7e+67) {
tmp = t_0;
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((M / 2.0) * (D / d)), 2.0))))) tmp = 0 if d <= -5e-310: tmp = t_0 elif d <= 6e-124: tmp = -0.125 * ((math.sqrt(h) / math.pow(l, 1.5)) / (d / math.pow((D * M), 2.0))) elif d <= 7e+67: tmp = t_0 else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))))) tmp = 0.0 if (d <= -5e-310) tmp = t_0; elseif (d <= 6e-124) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); elseif (d <= 7e+67) tmp = t_0; else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * (((M / 2.0) * (D / d)) ^ 2.0))))); tmp = 0.0; if (d <= -5e-310) tmp = t_0; elseif (d <= 6e-124) tmp = -0.125 * ((sqrt(h) / (l ^ 1.5)) / (d / ((D * M) ^ 2.0))); elseif (d <= 7e+67) tmp = t_0; else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-310], t$95$0, If[LessEqual[d, 6e-124], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+67], t$95$0, N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 6 \cdot 10^{-124}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310 or 6e-124 < d < 7e67Initial program 72.9%
Simplified71.7%
if -4.999999999999985e-310 < d < 6e-124Initial program 31.7%
Simplified31.6%
Taylor expanded in d around 0 34.2%
expm1-log1p-u34.0%
expm1-udef34.0%
associate-*l/32.0%
*-commutative32.0%
sqrt-div36.4%
sqrt-pow147.0%
metadata-eval47.0%
associate-*l/49.0%
pow-prod-down59.0%
Applied egg-rr59.0%
expm1-def59.6%
expm1-log1p60.8%
associate-*r/60.9%
associate-/l*60.8%
Simplified60.8%
if 7e67 < d Initial program 65.6%
Simplified65.6%
Taylor expanded in d around inf 70.9%
associate-/r*70.9%
sqrt-div83.8%
Applied egg-rr83.8%
Final simplification72.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))))
(if (<= d -5e-310)
t_0
(if (<= d 1.4e-121)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(if (<= d 4.8e+67) t_0 (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 1.4e-121) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else if (d <= 4.8e+67) {
tmp = t_0;
} else {
tmp = d * (sqrt((1.0 / h)) / 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 = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h / l) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0))))
if (d <= (-5d-310)) then
tmp = t_0
else if (d <= 1.4d-121) then
tmp = (-0.125d0) * ((sqrt(h) / (l ** 1.5d0)) / (d / ((d_1 * m) ** 2.0d0)))
else if (d <= 4.8d+67) then
tmp = t_0
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 1.4e-121) {
tmp = -0.125 * ((Math.sqrt(h) / Math.pow(l, 1.5)) / (d / Math.pow((D * M), 2.0)));
} else if (d <= 4.8e+67) {
tmp = t_0;
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) tmp = 0 if d <= -5e-310: tmp = t_0 elif d <= 1.4e-121: tmp = -0.125 * ((math.sqrt(h) / math.pow(l, 1.5)) / (d / math.pow((D * M), 2.0))) elif d <= 4.8e+67: tmp = t_0 else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0))))) tmp = 0.0 if (d <= -5e-310) tmp = t_0; elseif (d <= 1.4e-121) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); elseif (d <= 4.8e+67) tmp = t_0; else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0)))); tmp = 0.0; if (d <= -5e-310) tmp = t_0; elseif (d <= 1.4e-121) tmp = -0.125 * ((sqrt(h) / (l ^ 1.5)) / (d / ((D * M) ^ 2.0))); elseif (d <= 4.8e+67) tmp = t_0; else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-310], t$95$0, If[LessEqual[d, 1.4e-121], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.8e+67], t$95$0, N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\\
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 1.4 \cdot 10^{-121}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 4.8 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310 or 1.4000000000000001e-121 < d < 4.80000000000000004e67Initial program 72.9%
Simplified72.3%
if -4.999999999999985e-310 < d < 1.4000000000000001e-121Initial program 31.7%
Simplified31.6%
Taylor expanded in d around 0 34.2%
expm1-log1p-u34.0%
expm1-udef34.0%
associate-*l/32.0%
*-commutative32.0%
sqrt-div36.4%
sqrt-pow147.0%
metadata-eval47.0%
associate-*l/49.0%
pow-prod-down59.0%
Applied egg-rr59.0%
expm1-def59.6%
expm1-log1p60.8%
associate-*r/60.9%
associate-/l*60.8%
Simplified60.8%
if 4.80000000000000004e67 < d Initial program 65.6%
Simplified65.6%
Taylor expanded in d around inf 70.9%
associate-/r*70.9%
sqrt-div83.8%
Applied egg-rr83.8%
Final simplification72.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (/ h l) (pow (/ (/ (* D M) 2.0) d) 2.0)))))))
(if (<= d -5e-310)
t_0
(if (<= d 1.2e-120)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(if (<= d 7e+67) t_0 (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * pow((((D * M) / 2.0) / d), 2.0))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 1.2e-120) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else if (d <= 7e+67) {
tmp = t_0;
} else {
tmp = d * (sqrt((1.0 / h)) / 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 = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h / l) * ((((d_1 * m) / 2.0d0) / d) ** 2.0d0))))
if (d <= (-5d-310)) then
tmp = t_0
else if (d <= 1.2d-120) then
tmp = (-0.125d0) * ((sqrt(h) / (l ** 1.5d0)) / (d / ((d_1 * m) ** 2.0d0)))
else if (d <= 7d+67) then
tmp = t_0
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * Math.pow((((D * M) / 2.0) / d), 2.0))));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 1.2e-120) {
tmp = -0.125 * ((Math.sqrt(h) / Math.pow(l, 1.5)) / (d / Math.pow((D * M), 2.0)));
} else if (d <= 7e+67) {
tmp = t_0;
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * math.pow((((D * M) / 2.0) / d), 2.0)))) tmp = 0 if d <= -5e-310: tmp = t_0 elif d <= 1.2e-120: tmp = -0.125 * ((math.sqrt(h) / math.pow(l, 1.5)) / (d / math.pow((D * M), 2.0))) elif d <= 7e+67: tmp = t_0 else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(Float64(D * M) / 2.0) / d) ^ 2.0))))) tmp = 0.0 if (d <= -5e-310) tmp = t_0; elseif (d <= 1.2e-120) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); elseif (d <= 7e+67) tmp = t_0; else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h / l) * ((((D * M) / 2.0) / d) ^ 2.0)))); tmp = 0.0; if (d <= -5e-310) tmp = t_0; elseif (d <= 1.2e-120) tmp = -0.125 * ((sqrt(h) / (l ^ 1.5)) / (d / ((D * M) ^ 2.0))); elseif (d <= 7e+67) tmp = t_0; else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(N[(D * M), $MachinePrecision] / 2.0), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-310], t$95$0, If[LessEqual[d, 1.2e-120], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+67], t$95$0, N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{\frac{D \cdot M}{2}}{d}\right)}^{2}\right)\right)\\
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 1.2 \cdot 10^{-120}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310 or 1.2e-120 < d < 7e67Initial program 72.9%
Simplified72.3%
frac-times72.9%
associate-/r*72.9%
Applied egg-rr72.9%
if -4.999999999999985e-310 < d < 1.2e-120Initial program 31.7%
Simplified31.6%
Taylor expanded in d around 0 34.2%
expm1-log1p-u34.0%
expm1-udef34.0%
associate-*l/32.0%
*-commutative32.0%
sqrt-div36.4%
sqrt-pow147.0%
metadata-eval47.0%
associate-*l/49.0%
pow-prod-down59.0%
Applied egg-rr59.0%
expm1-def59.6%
expm1-log1p60.8%
associate-*r/60.9%
associate-/l*60.8%
Simplified60.8%
if 7e67 < d Initial program 65.6%
Simplified65.6%
Taylor expanded in d around inf 70.9%
associate-/r*70.9%
sqrt-div83.8%
Applied egg-rr83.8%
Final simplification72.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (/ D (* d (/ 2.0 M))) 2.0)) l))))))
(if (<= d -5e-310)
t_0
(if (<= d 5.3e-166)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(if (<= d 1.46e+110) t_0 (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow((D / (d * (2.0 / M))), 2.0)) / l)));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 5.3e-166) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else if (d <= 1.46e+110) {
tmp = t_0;
} else {
tmp = d * (sqrt((1.0 / h)) / 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 = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h * ((d_1 / (d * (2.0d0 / m))) ** 2.0d0)) / l)))
if (d <= (-5d-310)) then
tmp = t_0
else if (d <= 5.3d-166) then
tmp = (-0.125d0) * ((sqrt(h) / (l ** 1.5d0)) / (d / ((d_1 * m) ** 2.0d0)))
else if (d <= 1.46d+110) then
tmp = t_0
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h * Math.pow((D / (d * (2.0 / M))), 2.0)) / l)));
double tmp;
if (d <= -5e-310) {
tmp = t_0;
} else if (d <= 5.3e-166) {
tmp = -0.125 * ((Math.sqrt(h) / Math.pow(l, 1.5)) / (d / Math.pow((D * M), 2.0)));
} else if (d <= 1.46e+110) {
tmp = t_0;
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h * math.pow((D / (d * (2.0 / M))), 2.0)) / l))) tmp = 0 if d <= -5e-310: tmp = t_0 elif d <= 5.3e-166: tmp = -0.125 * ((math.sqrt(h) / math.pow(l, 1.5)) / (d / math.pow((D * M), 2.0))) elif d <= 1.46e+110: tmp = t_0 else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0)) / l)))) tmp = 0.0 if (d <= -5e-310) tmp = t_0; elseif (d <= 5.3e-166) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); elseif (d <= 1.46e+110) tmp = t_0; else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * ((D / (d * (2.0 / M))) ^ 2.0)) / l))); tmp = 0.0; if (d <= -5e-310) tmp = t_0; elseif (d <= 5.3e-166) tmp = -0.125 * ((sqrt(h) / (l ^ 1.5)) / (d / ((D * M) ^ 2.0))); elseif (d <= 1.46e+110) tmp = t_0; else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / 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[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5e-310], t$95$0, If[LessEqual[d, 5.3e-166], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.46e+110], t$95$0, N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 5.3 \cdot 10^{-166}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 1.46 \cdot 10^{+110}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310 or 5.29999999999999996e-166 < d < 1.46e110Initial program 72.0%
Simplified71.4%
associate-*r/73.8%
clear-num73.8%
frac-times74.4%
*-un-lft-identity74.4%
*-commutative74.4%
Applied egg-rr74.4%
if -4.999999999999985e-310 < d < 5.29999999999999996e-166Initial program 29.4%
Simplified29.3%
Taylor expanded in d around 0 37.6%
expm1-log1p-u37.6%
expm1-udef37.6%
associate-*l/37.3%
*-commutative37.3%
sqrt-div40.0%
sqrt-pow152.5%
metadata-eval52.5%
associate-*l/52.8%
pow-prod-down62.1%
Applied egg-rr62.1%
expm1-def62.1%
expm1-log1p63.1%
associate-*r/63.2%
associate-/l*63.0%
Simplified63.0%
if 1.46e110 < d Initial program 62.4%
Simplified62.4%
Taylor expanded in d around inf 72.0%
associate-/r*71.8%
sqrt-div84.0%
Applied egg-rr84.0%
Final simplification74.1%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.12e-178)
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(if (<= d -5e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(if (<= d 1.9e-125)
(* -0.125 (/ (sqrt h) (* (pow l 1.5) (/ d (pow (* D M) 2.0)))))
(if (<= d 7.8e+65)
(*
(/ d (sqrt (* h l)))
(+ 1.0 (* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.12e-178) {
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
} else if (d <= -5e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else if (d <= 1.9e-125) {
tmp = -0.125 * (sqrt(h) / (pow(l, 1.5) * (d / pow((D * M), 2.0))));
} else if (d <= 7.8e+65) {
tmp = (d / sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * pow(((D * M) / d), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.12e-178) {
tmp = Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (d <= -5e-310) {
tmp = d * Math.log1p(Math.expm1(Math.pow((h * l), -0.5)));
} else if (d <= 1.9e-125) {
tmp = -0.125 * (Math.sqrt(h) / (Math.pow(l, 1.5) * (d / Math.pow((D * M), 2.0))));
} else if (d <= 7.8e+65) {
tmp = (d / Math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.12e-178: tmp = math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l)) elif d <= -5e-310: tmp = d * math.log1p(math.expm1(math.pow((h * l), -0.5))) elif d <= 1.9e-125: tmp = -0.125 * (math.sqrt(h) / (math.pow(l, 1.5) * (d / math.pow((D * M), 2.0)))) elif d <= 7.8e+65: tmp = (d / math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.12e-178) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (d <= -5e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); elseif (d <= 1.9e-125) tmp = Float64(-0.125 * Float64(sqrt(h) / Float64((l ^ 1.5) * Float64(d / (Float64(D * M) ^ 2.0))))); elseif (d <= 7.8e+65) tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.12e-178], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.9e-125], N[(-0.125 * N[(N[Sqrt[h], $MachinePrecision] / N[(N[Power[l, 1.5], $MachinePrecision] * N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.8e+65], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.12 \cdot 10^{-178}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{elif}\;d \leq 1.9 \cdot 10^{-125}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{h}}{{\ell}^{1.5} \cdot \frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 7.8 \cdot 10^{+65}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.12e-178Initial program 74.6%
Simplified74.6%
Taylor expanded in h around 0 47.9%
frac-2neg47.9%
sqrt-div50.9%
Applied egg-rr50.9%
if -1.12e-178 < d < -4.999999999999985e-310Initial program 49.7%
Simplified49.5%
Taylor expanded in d around inf 18.6%
log1p-expm1-u34.8%
inv-pow34.8%
sqrt-pow134.8%
metadata-eval34.8%
Applied egg-rr34.8%
if -4.999999999999985e-310 < d < 1.9000000000000001e-125Initial program 31.7%
Simplified31.6%
Taylor expanded in d around 0 34.2%
sqrt-div38.7%
clear-num38.7%
frac-times38.7%
metadata-eval38.7%
sqrt-prod38.7%
*-un-lft-identity38.7%
pow-prod-down45.4%
sqrt-pow160.3%
metadata-eval60.3%
Applied egg-rr60.3%
if 1.9000000000000001e-125 < d < 7.7999999999999996e65Initial program 84.2%
Simplified84.2%
add-sqr-sqrt84.2%
pow284.2%
sqrt-prod84.2%
unpow284.2%
sqrt-prod37.6%
add-sqr-sqrt84.2%
clear-num84.2%
frac-times84.2%
*-un-lft-identity84.2%
*-commutative84.2%
Applied egg-rr84.2%
Taylor expanded in D around 0 84.3%
Applied egg-rr10.2%
expm1-def33.9%
expm1-log1p81.3%
*-commutative81.3%
associate-*r*81.3%
associate-*l*81.3%
associate-/r/81.3%
associate-*l/81.3%
metadata-eval81.3%
Simplified81.3%
if 7.7999999999999996e65 < d Initial program 66.9%
Simplified66.9%
Taylor expanded in d around inf 70.2%
associate-/r*70.1%
sqrt-div84.4%
Applied egg-rr84.4%
Final simplification61.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.15e-166)
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(if (<= d -5e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(if (<= d 1.9e-125)
(* -0.125 (/ (/ (sqrt h) (pow l 1.5)) (/ d (pow (* D M) 2.0))))
(if (<= d 5.5e+64)
(*
(/ d (sqrt (* h l)))
(+ 1.0 (* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.15e-166) {
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
} else if (d <= -5e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else if (d <= 1.9e-125) {
tmp = -0.125 * ((sqrt(h) / pow(l, 1.5)) / (d / pow((D * M), 2.0)));
} else if (d <= 5.5e+64) {
tmp = (d / sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * pow(((D * M) / d), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.15e-166) {
tmp = Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (d <= -5e-310) {
tmp = d * Math.log1p(Math.expm1(Math.pow((h * l), -0.5)));
} else if (d <= 1.9e-125) {
tmp = -0.125 * ((Math.sqrt(h) / Math.pow(l, 1.5)) / (d / Math.pow((D * M), 2.0)));
} else if (d <= 5.5e+64) {
tmp = (d / Math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.15e-166: tmp = math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l)) elif d <= -5e-310: tmp = d * math.log1p(math.expm1(math.pow((h * l), -0.5))) elif d <= 1.9e-125: tmp = -0.125 * ((math.sqrt(h) / math.pow(l, 1.5)) / (d / math.pow((D * M), 2.0))) elif d <= 5.5e+64: tmp = (d / math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.15e-166) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (d <= -5e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); elseif (d <= 1.9e-125) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) / (l ^ 1.5)) / Float64(d / (Float64(D * M) ^ 2.0)))); elseif (d <= 5.5e+64) tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.15e-166], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.9e-125], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] / N[(d / N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.5e+64], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.15 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{elif}\;d \leq 1.9 \cdot 10^{-125}:\\
\;\;\;\;-0.125 \cdot \frac{\frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{d}{{\left(D \cdot M\right)}^{2}}}\\
\mathbf{elif}\;d \leq 5.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.15e-166Initial program 74.6%
Simplified74.6%
Taylor expanded in h around 0 47.9%
frac-2neg47.9%
sqrt-div50.9%
Applied egg-rr50.9%
if -2.15e-166 < d < -4.999999999999985e-310Initial program 49.7%
Simplified49.5%
Taylor expanded in d around inf 18.6%
log1p-expm1-u34.8%
inv-pow34.8%
sqrt-pow134.8%
metadata-eval34.8%
Applied egg-rr34.8%
if -4.999999999999985e-310 < d < 1.9000000000000001e-125Initial program 31.7%
Simplified31.6%
Taylor expanded in d around 0 34.2%
expm1-log1p-u34.0%
expm1-udef34.0%
associate-*l/32.0%
*-commutative32.0%
sqrt-div36.4%
sqrt-pow147.0%
metadata-eval47.0%
associate-*l/49.0%
pow-prod-down59.0%
Applied egg-rr59.0%
expm1-def59.6%
expm1-log1p60.8%
associate-*r/60.9%
associate-/l*60.8%
Simplified60.8%
if 1.9000000000000001e-125 < d < 5.4999999999999996e64Initial program 84.2%
Simplified84.2%
add-sqr-sqrt84.2%
pow284.2%
sqrt-prod84.2%
unpow284.2%
sqrt-prod37.6%
add-sqr-sqrt84.2%
clear-num84.2%
frac-times84.2%
*-un-lft-identity84.2%
*-commutative84.2%
Applied egg-rr84.2%
Taylor expanded in D around 0 84.3%
Applied egg-rr10.2%
expm1-def33.9%
expm1-log1p81.3%
*-commutative81.3%
associate-*r*81.3%
associate-*l*81.3%
associate-/r/81.3%
associate-*l/81.3%
metadata-eval81.3%
Simplified81.3%
if 5.4999999999999996e64 < d Initial program 66.9%
Simplified66.9%
Taylor expanded in d around inf 70.2%
associate-/r*70.1%
sqrt-div84.4%
Applied egg-rr84.4%
Final simplification61.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* h l)))
(t_1 (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))))
(if (<= l -7.2e+140)
t_1
(if (<= l -9e-151)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l -4.6e-238)
t_1
(if (<= l 6.8e-302)
(/ d (log (exp t_0)))
(if (<= l 2.65e+215)
(*
(/ d t_0)
(+ 1.0 (* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h * l));
double t_1 = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
double tmp;
if (l <= -7.2e+140) {
tmp = t_1;
} else if (l <= -9e-151) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= -4.6e-238) {
tmp = t_1;
} else if (l <= 6.8e-302) {
tmp = d / log(exp(t_0));
} else if (l <= 2.65e+215) {
tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * pow(((D * M) / d), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: t_1
real(8) :: tmp
t_0 = sqrt((h * l))
t_1 = sqrt((d / h)) * (sqrt(-d) / sqrt(-l))
if (l <= (-7.2d+140)) then
tmp = t_1
else if (l <= (-9d-151)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= (-4.6d-238)) then
tmp = t_1
else if (l <= 6.8d-302) then
tmp = d / log(exp(t_0))
else if (l <= 2.65d+215) then
tmp = (d / t_0) * (1.0d0 + ((-0.125d0) * ((h / l) * (((d_1 * m) / d) ** 2.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((h * l));
double t_1 = Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l));
double tmp;
if (l <= -7.2e+140) {
tmp = t_1;
} else if (l <= -9e-151) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= -4.6e-238) {
tmp = t_1;
} else if (l <= 6.8e-302) {
tmp = d / Math.log(Math.exp(t_0));
} else if (l <= 2.65e+215) {
tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h * l)) t_1 = math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l)) tmp = 0 if l <= -7.2e+140: tmp = t_1 elif l <= -9e-151: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= -4.6e-238: tmp = t_1 elif l <= 6.8e-302: tmp = d / math.log(math.exp(t_0)) elif l <= 2.65e+215: tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h * l)) t_1 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) tmp = 0.0 if (l <= -7.2e+140) tmp = t_1; elseif (l <= -9e-151) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= -4.6e-238) tmp = t_1; elseif (l <= 6.8e-302) tmp = Float64(d / log(exp(t_0))); elseif (l <= 2.65e+215) tmp = Float64(Float64(d / t_0) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h * l)); t_1 = sqrt((d / h)) * (sqrt(-d) / sqrt(-l)); tmp = 0.0; if (l <= -7.2e+140) tmp = t_1; elseif (l <= -9e-151) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= -4.6e-238) tmp = t_1; elseif (l <= 6.8e-302) tmp = d / log(exp(t_0)); elseif (l <= 2.65e+215) tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * (((D * M) / d) ^ 2.0)))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.2e+140], t$95$1, If[LessEqual[l, -9e-151], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-238], t$95$1, If[LessEqual[l, 6.8e-302], N[(d / N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.65e+215], N[(N[(d / t$95$0), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{h \cdot \ell}\\
t_1 := \sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{if}\;\ell \leq -7.2 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -9 \cdot 10^{-151}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-302}:\\
\;\;\;\;\frac{d}{\log \left(e^{t\_0}\right)}\\
\mathbf{elif}\;\ell \leq 2.65 \cdot 10^{+215}:\\
\;\;\;\;\frac{d}{t\_0} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -7.1999999999999999e140 or -9.0000000000000005e-151 < l < -4.60000000000000009e-238Initial program 64.1%
Simplified64.1%
Taylor expanded in h around 0 47.6%
frac-2neg47.6%
sqrt-div52.4%
Applied egg-rr52.4%
if -7.1999999999999999e140 < l < -9.0000000000000005e-151Initial program 69.0%
Simplified67.4%
clear-num67.3%
sqrt-div68.8%
metadata-eval68.8%
Applied egg-rr68.8%
Taylor expanded in d around -inf 53.4%
associate-*r*53.4%
neg-mul-153.4%
Simplified53.4%
if -4.60000000000000009e-238 < l < 6.8e-302Initial program 82.2%
Simplified82.2%
Taylor expanded in h around 0 18.2%
*-rgt-identity18.2%
expm1-log1p-u18.2%
expm1-udef18.4%
sqrt-div5.9%
sqrt-div5.9%
frac-times5.9%
add-sqr-sqrt5.9%
sqrt-prod6.2%
Applied egg-rr6.2%
expm1-def6.3%
expm1-log1p48.6%
Simplified48.6%
add-log-exp77.0%
Applied egg-rr77.0%
if 6.8e-302 < l < 2.65e215Initial program 60.7%
Simplified60.6%
add-sqr-sqrt60.6%
pow260.6%
sqrt-prod60.6%
unpow260.6%
sqrt-prod36.4%
add-sqr-sqrt62.4%
clear-num62.4%
frac-times60.7%
*-un-lft-identity60.7%
*-commutative60.7%
Applied egg-rr60.7%
Taylor expanded in D around 0 63.4%
Applied egg-rr25.7%
expm1-def39.3%
expm1-log1p70.5%
*-commutative70.5%
associate-*r*70.5%
associate-*l*70.5%
associate-/r/70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if 2.65e215 < l Initial program 51.2%
Simplified51.2%
Taylor expanded in d around inf 41.8%
associate-/r*41.6%
sqrt-div65.6%
Applied egg-rr65.6%
Final simplification63.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* h l))))
(if (<= l -7.4e+143)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -5.6e-238)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l 6.8e-302)
(/ d (log (exp t_0)))
(if (<= l 5.4e+215)
(* (/ d t_0) (+ 1.0 (* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h * l));
double tmp;
if (l <= -7.4e+143) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -5.6e-238) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d / log(exp(t_0));
} else if (l <= 5.4e+215) {
tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * pow(((D * M) / d), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / 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 = sqrt((h * l))
if (l <= (-7.4d+143)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-5.6d-238)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= 6.8d-302) then
tmp = d / log(exp(t_0))
else if (l <= 5.4d+215) then
tmp = (d / t_0) * (1.0d0 + ((-0.125d0) * ((h / l) * (((d_1 * m) / d) ** 2.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / 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.sqrt((h * l));
double tmp;
if (l <= -7.4e+143) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -5.6e-238) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d / Math.log(Math.exp(t_0));
} else if (l <= 5.4e+215) {
tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h * l)) tmp = 0 if l <= -7.4e+143: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -5.6e-238: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= 6.8e-302: tmp = d / math.log(math.exp(t_0)) elif l <= 5.4e+215: tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h * l)) tmp = 0.0 if (l <= -7.4e+143) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -5.6e-238) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= 6.8e-302) tmp = Float64(d / log(exp(t_0))); elseif (l <= 5.4e+215) tmp = Float64(Float64(d / t_0) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h * l)); tmp = 0.0; if (l <= -7.4e+143) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -5.6e-238) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= 6.8e-302) tmp = d / log(exp(t_0)); elseif (l <= 5.4e+215) tmp = (d / t_0) * (1.0 + (-0.125 * ((h / l) * (((D * M) / d) ^ 2.0)))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -7.4e+143], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.6e-238], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.8e-302], N[(d / N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.4e+215], N[(N[(d / t$95$0), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{h \cdot \ell}\\
\mathbf{if}\;\ell \leq -7.4 \cdot 10^{+143}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -5.6 \cdot 10^{-238}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-302}:\\
\;\;\;\;\frac{d}{\log \left(e^{t\_0}\right)}\\
\mathbf{elif}\;\ell \leq 5.4 \cdot 10^{+215}:\\
\;\;\;\;\frac{d}{t\_0} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -7.4000000000000003e143Initial program 68.6%
Simplified68.5%
Taylor expanded in h around 0 57.1%
if -7.4000000000000003e143 < l < -5.60000000000000008e-238Initial program 66.6%
Simplified65.4%
clear-num64.1%
sqrt-div65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in d around -inf 49.3%
associate-*r*49.3%
neg-mul-149.3%
Simplified49.3%
if -5.60000000000000008e-238 < l < 6.8e-302Initial program 82.2%
Simplified82.2%
Taylor expanded in h around 0 18.2%
*-rgt-identity18.2%
expm1-log1p-u18.2%
expm1-udef18.4%
sqrt-div5.9%
sqrt-div5.9%
frac-times5.9%
add-sqr-sqrt5.9%
sqrt-prod6.2%
Applied egg-rr6.2%
expm1-def6.3%
expm1-log1p48.6%
Simplified48.6%
add-log-exp77.0%
Applied egg-rr77.0%
if 6.8e-302 < l < 5.4e215Initial program 60.7%
Simplified60.6%
add-sqr-sqrt60.6%
pow260.6%
sqrt-prod60.6%
unpow260.6%
sqrt-prod36.4%
add-sqr-sqrt62.4%
clear-num62.4%
frac-times60.7%
*-un-lft-identity60.7%
*-commutative60.7%
Applied egg-rr60.7%
Taylor expanded in D around 0 63.4%
Applied egg-rr25.7%
expm1-def39.3%
expm1-log1p70.5%
*-commutative70.5%
associate-*r*70.5%
associate-*l*70.5%
associate-/r/70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if 5.4e215 < l Initial program 51.2%
Simplified51.2%
Taylor expanded in d around inf 41.8%
associate-/r*41.6%
sqrt-div65.6%
Applied egg-rr65.6%
Final simplification62.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e+143)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -2.65e-238)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l 6.8e-302)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l 2.65e+215)
(*
(/ d (sqrt (* h l)))
(+ 1.0 (* -0.125 (* (/ h l) (pow (/ (* D M) d) 2.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e+143) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -2.65e-238) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= 2.65e+215) {
tmp = (d / sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * pow(((D * M) / d), 2.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: tmp
if (l <= (-6d+143)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-2.65d-238)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= 6.8d-302) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= 2.65d+215) then
tmp = (d / sqrt((h * l))) * (1.0d0 + ((-0.125d0) * ((h / l) * (((d_1 * m) / d) ** 2.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e+143) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -2.65e-238) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= 2.65e+215) {
tmp = (d / Math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * Math.pow(((D * M) / d), 2.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -6e+143: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -2.65e-238: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= 6.8e-302: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= 2.65e+215: tmp = (d / math.sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * math.pow(((D * M) / d), 2.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e+143) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -2.65e-238) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= 6.8e-302) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= 2.65e+215) tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(Float64(D * M) / d) ^ 2.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -6e+143) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -2.65e-238) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= 6.8e-302) tmp = d * (((h * l) ^ 2.0) ^ -0.25); elseif (l <= 2.65e+215) tmp = (d / sqrt((h * l))) * (1.0 + (-0.125 * ((h / l) * (((D * M) / d) ^ 2.0)))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e+143], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.65e-238], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.8e-302], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.65e+215], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{+143}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -2.65 \cdot 10^{-238}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-302}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq 2.65 \cdot 10^{+215}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -6.0000000000000001e143Initial program 68.6%
Simplified68.5%
Taylor expanded in h around 0 57.1%
if -6.0000000000000001e143 < l < -2.64999999999999984e-238Initial program 66.6%
Simplified65.4%
clear-num64.1%
sqrt-div65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in d around -inf 49.3%
associate-*r*49.3%
neg-mul-149.3%
Simplified49.3%
if -2.64999999999999984e-238 < l < 6.8e-302Initial program 82.2%
Simplified82.1%
clear-num82.1%
sqrt-div82.3%
metadata-eval82.3%
Applied egg-rr82.3%
Taylor expanded in d around inf 48.6%
unpow-148.6%
metadata-eval48.6%
pow-sqr48.6%
rem-sqrt-square48.6%
rem-square-sqrt48.6%
fabs-sqr48.6%
rem-square-sqrt48.6%
Simplified48.6%
sqr-pow48.6%
metadata-eval48.6%
metadata-eval48.6%
Applied egg-rr48.6%
pow-prod-down59.9%
pow259.9%
Applied egg-rr59.9%
if 6.8e-302 < l < 2.65e215Initial program 60.7%
Simplified60.6%
add-sqr-sqrt60.6%
pow260.6%
sqrt-prod60.6%
unpow260.6%
sqrt-prod36.4%
add-sqr-sqrt62.4%
clear-num62.4%
frac-times60.7%
*-un-lft-identity60.7%
*-commutative60.7%
Applied egg-rr60.7%
Taylor expanded in D around 0 63.4%
Applied egg-rr25.7%
expm1-def39.3%
expm1-log1p70.5%
*-commutative70.5%
associate-*r*70.5%
associate-*l*70.5%
associate-/r/70.5%
associate-*l/70.5%
metadata-eval70.5%
Simplified70.5%
if 2.65e215 < l Initial program 51.2%
Simplified51.2%
Taylor expanded in d around inf 41.8%
associate-/r*41.6%
sqrt-div65.6%
Applied egg-rr65.6%
Final simplification61.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.7e+142)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -3e-238)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l 6.8e-302)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l 1.82e-109)
(* -0.125 (* (* (* D M) (* M (/ D d))) (sqrt (/ h (pow l 3.0)))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.7e+142) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -3e-238) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= 1.82e-109) {
tmp = -0.125 * (((D * M) * (M * (D / d))) * sqrt((h / pow(l, 3.0))));
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: tmp
if (l <= (-4.7d+142)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-3d-238)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= 6.8d-302) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= 1.82d-109) then
tmp = (-0.125d0) * (((d_1 * m) * (m * (d_1 / d))) * sqrt((h / (l ** 3.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.7e+142) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -3e-238) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= 6.8e-302) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= 1.82e-109) {
tmp = -0.125 * (((D * M) * (M * (D / d))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.7e+142: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -3e-238: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= 6.8e-302: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= 1.82e-109: tmp = -0.125 * (((D * M) * (M * (D / d))) * math.sqrt((h / math.pow(l, 3.0)))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.7e+142) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -3e-238) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= 6.8e-302) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= 1.82e-109) tmp = Float64(-0.125 * Float64(Float64(Float64(D * M) * Float64(M * Float64(D / d))) * sqrt(Float64(h / (l ^ 3.0))))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4.7e+142) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -3e-238) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= 6.8e-302) tmp = d * (((h * l) ^ 2.0) ^ -0.25); elseif (l <= 1.82e-109) tmp = -0.125 * (((D * M) * (M * (D / d))) * sqrt((h / (l ^ 3.0)))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.7e+142], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3e-238], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.8e-302], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.82e-109], N[(-0.125 * N[(N[(N[(D * M), $MachinePrecision] * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.7 \cdot 10^{+142}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -3 \cdot 10^{-238}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-302}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq 1.82 \cdot 10^{-109}:\\
\;\;\;\;-0.125 \cdot \left(\left(\left(D \cdot M\right) \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.7e142Initial program 68.6%
Simplified68.5%
Taylor expanded in h around 0 57.1%
if -4.7e142 < l < -3e-238Initial program 66.6%
Simplified65.4%
clear-num64.1%
sqrt-div65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in d around -inf 49.3%
associate-*r*49.3%
neg-mul-149.3%
Simplified49.3%
if -3e-238 < l < 6.8e-302Initial program 82.2%
Simplified82.1%
clear-num82.1%
sqrt-div82.3%
metadata-eval82.3%
Applied egg-rr82.3%
Taylor expanded in d around inf 48.6%
unpow-148.6%
metadata-eval48.6%
pow-sqr48.6%
rem-sqrt-square48.6%
rem-square-sqrt48.6%
fabs-sqr48.6%
rem-square-sqrt48.6%
Simplified48.6%
sqr-pow48.6%
metadata-eval48.6%
metadata-eval48.6%
Applied egg-rr48.6%
pow-prod-down59.9%
pow259.9%
Applied egg-rr59.9%
if 6.8e-302 < l < 1.8200000000000001e-109Initial program 60.4%
Simplified60.4%
Taylor expanded in d around 0 46.1%
pow-prod-down52.1%
pow252.1%
*-un-lft-identity52.1%
times-frac54.9%
associate-/l*52.2%
Applied egg-rr52.2%
/-rgt-identity52.2%
*-commutative52.2%
associate-/r/54.9%
Simplified54.9%
if 1.8200000000000001e-109 < l Initial program 58.7%
Simplified58.6%
Taylor expanded in d around inf 52.0%
associate-/r*52.0%
sqrt-div58.1%
Applied egg-rr58.1%
Final simplification54.8%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d 2.6e+64)
(* -0.125 (/ (* (sqrt h) (* (* D M) (* D M))) (* d (pow l 1.5))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= 2.6e+64) {
tmp = -0.125 * ((sqrt(h) * ((D * M) * (D * M))) / (d * pow(l, 1.5)));
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: tmp
if (d <= (-5d-310)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= 2.6d+64) then
tmp = (-0.125d0) * ((sqrt(h) * ((d_1 * m) * (d_1 * m))) / (d * (l ** 1.5d0)))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(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 <= -5e-310) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= 2.6e+64) {
tmp = -0.125 * ((Math.sqrt(h) * ((D * M) * (D * M))) / (d * Math.pow(l, 1.5)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5e-310: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= 2.6e+64: tmp = -0.125 * ((math.sqrt(h) * ((D * M) * (D * M))) / (d * math.pow(l, 1.5))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= 2.6e+64) tmp = Float64(-0.125 * Float64(Float64(sqrt(h) * Float64(Float64(D * M) * Float64(D * M))) / Float64(d * (l ^ 1.5)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -5e-310) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= 2.6e+64) tmp = -0.125 * ((sqrt(h) * ((D * M) * (D * M))) / (d * (l ^ 1.5))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, 2.6e+64], N[(-0.125 * N[(N[(N[Sqrt[h], $MachinePrecision] * N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq 2.6 \cdot 10^{+64}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{h} \cdot \left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)}{d \cdot {\ell}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 69.6%
metadata-eval69.6%
associate-*l*69.6%
frac-times68.8%
add-sqr-sqrt68.8%
pow268.8%
Applied egg-rr74.8%
metadata-eval74.8%
pow1/274.8%
clear-num74.0%
sqrt-div74.7%
metadata-eval74.7%
Applied egg-rr74.7%
Taylor expanded in d around -inf 41.9%
mul-1-neg41.9%
distribute-rgt-neg-in41.9%
*-commutative41.9%
associate-/r*42.6%
Simplified42.6%
if -4.999999999999985e-310 < d < 2.59999999999999997e64Initial program 53.3%
Simplified53.2%
Taylor expanded in d around 0 34.7%
sqrt-div38.6%
frac-times38.5%
pow-prod-down45.3%
sqrt-pow154.1%
metadata-eval54.1%
Applied egg-rr54.1%
unpow254.1%
Applied egg-rr54.1%
if 2.59999999999999997e64 < d Initial program 66.9%
Simplified66.9%
Taylor expanded in d around inf 70.2%
associate-/r*70.1%
sqrt-div84.4%
Applied egg-rr84.4%
Final simplification54.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.5e+143)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -4.8e-238)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l -5e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.5e+143) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -4.8e-238) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= -5e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: tmp
if (l <= (-5.5d+143)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-4.8d-238)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (l <= (-5d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.5e+143) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -4.8e-238) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (l <= -5e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.5e+143: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -4.8e-238: tmp = -d * math.sqrt((1.0 / (h * l))) elif l <= -5e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.5e+143) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -4.8e-238) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= -5e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -5.5e+143) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -4.8e-238) tmp = -d * sqrt((1.0 / (h * l))); elseif (l <= -5e-310) tmp = d * (((h * l) ^ 2.0) ^ -0.25); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.5e+143], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.8e-238], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{+143}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -4.8 \cdot 10^{-238}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.4999999999999997e143Initial program 68.6%
Simplified68.5%
Taylor expanded in h around 0 57.1%
if -5.4999999999999997e143 < l < -4.7999999999999997e-238Initial program 66.6%
Simplified65.4%
clear-num64.1%
sqrt-div65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in d around -inf 49.3%
associate-*r*49.3%
neg-mul-149.3%
Simplified49.3%
if -4.7999999999999997e-238 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.2%
clear-num87.2%
sqrt-div87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Taylor expanded in d around inf 45.4%
unpow-145.4%
metadata-eval45.4%
pow-sqr45.4%
rem-sqrt-square45.4%
rem-square-sqrt45.4%
fabs-sqr45.4%
rem-square-sqrt45.4%
Simplified45.4%
sqr-pow45.4%
metadata-eval45.4%
metadata-eval45.4%
Applied egg-rr45.4%
pow-prod-down57.4%
pow257.4%
Applied egg-rr57.4%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified58.7%
Taylor expanded in d around inf 43.4%
associate-/r*43.3%
sqrt-div50.5%
Applied egg-rr50.5%
Final simplification51.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.3e-238)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l -5e-310)
(* d (cbrt (pow (* h l) -1.5)))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.3e-238) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.3e-238) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.3e-238) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.3e-238], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-238}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.3000000000000001e-238Initial program 67.0%
metadata-eval67.0%
associate-*l*67.0%
frac-times66.1%
add-sqr-sqrt66.1%
pow266.1%
Applied egg-rr73.0%
metadata-eval73.0%
pow1/273.0%
clear-num72.1%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-in46.2%
*-commutative46.2%
associate-/r*46.9%
Simplified46.9%
if -1.3000000000000001e-238 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.2%
clear-num87.2%
sqrt-div87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Taylor expanded in d around inf 45.4%
unpow-145.4%
metadata-eval45.4%
pow-sqr45.4%
rem-sqrt-square45.4%
rem-square-sqrt45.4%
fabs-sqr45.4%
rem-square-sqrt45.4%
Simplified45.4%
sqr-pow45.4%
metadata-eval45.4%
metadata-eval45.4%
Applied egg-rr45.4%
add-cbrt-cube45.4%
add-cbrt-cube45.4%
cbrt-unprod51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
Applied egg-rr51.3%
pow-sqr51.3%
metadata-eval51.3%
Simplified51.3%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified58.7%
clear-num58.7%
sqrt-div58.6%
metadata-eval58.6%
Applied egg-rr58.6%
Taylor expanded in d around inf 43.4%
unpow-143.4%
metadata-eval43.4%
pow-sqr43.4%
rem-sqrt-square43.4%
rem-square-sqrt43.2%
fabs-sqr43.2%
rem-square-sqrt43.4%
Simplified43.4%
*-commutative43.4%
unpow-prod-down50.5%
Applied egg-rr50.5%
Final simplification49.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.6e-238)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l -5e-310)
(* d (cbrt (pow (* h l) -1.5)))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.6e-238) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.6e-238) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.6e-238) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.6e-238], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.6 \cdot 10^{-238}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.6000000000000001e-238Initial program 67.0%
metadata-eval67.0%
associate-*l*67.0%
frac-times66.1%
add-sqr-sqrt66.1%
pow266.1%
Applied egg-rr73.0%
metadata-eval73.0%
pow1/273.0%
clear-num72.1%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-in46.2%
*-commutative46.2%
associate-/r*46.9%
Simplified46.9%
if -2.6000000000000001e-238 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.2%
clear-num87.2%
sqrt-div87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Taylor expanded in d around inf 45.4%
unpow-145.4%
metadata-eval45.4%
pow-sqr45.4%
rem-sqrt-square45.4%
rem-square-sqrt45.4%
fabs-sqr45.4%
rem-square-sqrt45.4%
Simplified45.4%
sqr-pow45.4%
metadata-eval45.4%
metadata-eval45.4%
Applied egg-rr45.4%
add-cbrt-cube45.4%
add-cbrt-cube45.4%
cbrt-unprod51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
Applied egg-rr51.3%
pow-sqr51.3%
metadata-eval51.3%
Simplified51.3%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified58.7%
Taylor expanded in d around inf 43.4%
associate-/r*43.3%
sqrt-div50.5%
Applied egg-rr50.5%
Final simplification49.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.8e-238)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l -5e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.8e-238) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else {
tmp = d * (sqrt((1.0 / h)) / 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) :: tmp
if (l <= (-4.8d-238)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= (-5d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.8e-238) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.8e-238: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= -5e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.8e-238) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4.8e-238) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= -5e-310) tmp = d * (((h * l) ^ 2.0) ^ -0.25); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-238], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-238}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.7999999999999997e-238Initial program 67.0%
metadata-eval67.0%
associate-*l*67.0%
frac-times66.1%
add-sqr-sqrt66.1%
pow266.1%
Applied egg-rr73.0%
metadata-eval73.0%
pow1/273.0%
clear-num72.1%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-in46.2%
*-commutative46.2%
associate-/r*46.9%
Simplified46.9%
if -4.7999999999999997e-238 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.2%
clear-num87.2%
sqrt-div87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Taylor expanded in d around inf 45.4%
unpow-145.4%
metadata-eval45.4%
pow-sqr45.4%
rem-sqrt-square45.4%
rem-square-sqrt45.4%
fabs-sqr45.4%
rem-square-sqrt45.4%
Simplified45.4%
sqr-pow45.4%
metadata-eval45.4%
metadata-eval45.4%
Applied egg-rr45.4%
pow-prod-down57.4%
pow257.4%
Applied egg-rr57.4%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified58.7%
Taylor expanded in d around inf 43.4%
associate-/r*43.3%
sqrt-div50.5%
Applied egg-rr50.5%
Final simplification49.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -8e-239)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= l -5e-310)
(* d (cbrt (pow (* h l) -1.5)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8e-239) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8e-239) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -8e-239) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-310) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -8e-239], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8 \cdot 10^{-239}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -8.0000000000000006e-239Initial program 67.0%
metadata-eval67.0%
associate-*l*67.0%
frac-times66.1%
add-sqr-sqrt66.1%
pow266.1%
Applied egg-rr73.0%
metadata-eval73.0%
pow1/273.0%
clear-num72.1%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-in46.2%
*-commutative46.2%
associate-/r*46.9%
Simplified46.9%
if -8.0000000000000006e-239 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.2%
clear-num87.2%
sqrt-div87.4%
metadata-eval87.4%
Applied egg-rr87.4%
Taylor expanded in d around inf 45.4%
unpow-145.4%
metadata-eval45.4%
pow-sqr45.4%
rem-sqrt-square45.4%
rem-square-sqrt45.4%
fabs-sqr45.4%
rem-square-sqrt45.4%
Simplified45.4%
sqr-pow45.4%
metadata-eval45.4%
metadata-eval45.4%
Applied egg-rr45.4%
add-cbrt-cube45.4%
add-cbrt-cube45.4%
cbrt-unprod51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
pow-prod-up51.3%
pow-prod-up51.3%
metadata-eval51.3%
metadata-eval51.3%
Applied egg-rr51.3%
pow-sqr51.3%
metadata-eval51.3%
Simplified51.3%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified57.4%
Taylor expanded in h around 0 39.3%
*-rgt-identity39.3%
expm1-log1p-u38.2%
expm1-udef24.6%
sqrt-div29.8%
sqrt-div32.3%
frac-times32.3%
add-sqr-sqrt32.3%
sqrt-prod28.4%
Applied egg-rr28.4%
expm1-def41.8%
expm1-log1p43.4%
Simplified43.4%
pow1/243.4%
*-commutative43.4%
metadata-eval43.4%
unpow-prod-down50.4%
metadata-eval50.4%
pow1/250.4%
metadata-eval50.4%
pow1/250.4%
Applied egg-rr50.4%
Final simplification48.9%
(FPCore (d h l M D) :precision binary64 (if (<= l -3.2e-238) (* d (- (sqrt (/ (/ 1.0 l) h)))) (if (<= l -5e-310) (/ d (sqrt (* h l))) (/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-238) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d / sqrt((h * l));
} else {
tmp = d / (sqrt(h) * 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) :: tmp
if (l <= (-3.2d-238)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (l <= (-5d-310)) then
tmp = d / sqrt((h * l))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.2e-238) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (l <= -5e-310) {
tmp = d / Math.sqrt((h * l));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.2e-238: tmp = d * -math.sqrt(((1.0 / l) / h)) elif l <= -5e-310: tmp = d / math.sqrt((h * l)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.2e-238) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (l <= -5e-310) tmp = Float64(d / sqrt(Float64(h * l))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.2e-238) tmp = d * -sqrt(((1.0 / l) / h)); elseif (l <= -5e-310) tmp = d / sqrt((h * l)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.2e-238], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.2 \cdot 10^{-238}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.2000000000000002e-238Initial program 67.0%
metadata-eval67.0%
associate-*l*67.0%
frac-times66.1%
add-sqr-sqrt66.1%
pow266.1%
Applied egg-rr73.0%
metadata-eval73.0%
pow1/273.0%
clear-num72.1%
sqrt-div72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in d around -inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-in46.2%
*-commutative46.2%
associate-/r*46.9%
Simplified46.9%
if -3.2000000000000002e-238 < l < -4.999999999999985e-310Initial program 87.3%
Simplified87.3%
Taylor expanded in h around 0 13.1%
*-rgt-identity13.1%
expm1-log1p-u13.1%
expm1-udef13.3%
sqrt-div0.0%
sqrt-div0.0%
frac-times0.0%
add-sqr-sqrt0.0%
sqrt-prod0.4%
Applied egg-rr0.4%
expm1-def0.5%
expm1-log1p45.4%
Simplified45.4%
if -4.999999999999985e-310 < l Initial program 58.7%
Simplified57.4%
Taylor expanded in h around 0 39.3%
*-rgt-identity39.3%
expm1-log1p-u38.2%
expm1-udef24.6%
sqrt-div29.8%
sqrt-div32.3%
frac-times32.3%
add-sqr-sqrt32.3%
sqrt-prod28.4%
Applied egg-rr28.4%
expm1-def41.8%
expm1-log1p43.4%
Simplified43.4%
pow1/243.4%
*-commutative43.4%
metadata-eval43.4%
unpow-prod-down50.4%
metadata-eval50.4%
pow1/250.4%
metadata-eval50.4%
pow1/250.4%
Applied egg-rr50.4%
Final simplification48.6%
(FPCore (d h l M D) :precision binary64 (if (<= h -7.5e-280) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -7.5e-280) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * pow((h * l), -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 (h <= (-7.5d-280)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((h * l) ** (-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 (h <= -7.5e-280) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -7.5e-280: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.pow((h * l), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -7.5e-280) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -7.5e-280) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((h * l) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -7.5e-280], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -7.5 \cdot 10^{-280}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if h < -7.4999999999999999e-280Initial program 68.9%
metadata-eval68.9%
associate-*l*68.9%
frac-times68.0%
add-sqr-sqrt68.0%
pow268.0%
Applied egg-rr74.2%
metadata-eval74.2%
pow1/274.2%
clear-num73.4%
sqrt-div74.1%
metadata-eval74.1%
Applied egg-rr74.1%
Taylor expanded in d around -inf 42.1%
mul-1-neg42.1%
distribute-rgt-neg-in42.1%
*-commutative42.1%
associate-/r*42.8%
Simplified42.8%
if -7.4999999999999999e-280 < h Initial program 59.7%
Simplified59.6%
clear-num59.6%
sqrt-div59.5%
metadata-eval59.5%
Applied egg-rr59.5%
Taylor expanded in d around inf 43.9%
unpow-143.9%
metadata-eval43.9%
pow-sqr43.9%
rem-sqrt-square43.9%
rem-square-sqrt43.7%
fabs-sqr43.7%
rem-square-sqrt43.9%
Simplified43.9%
Final simplification43.4%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.42e-238) (sqrt (* (/ d h) (/ d l))) (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.42e-238) {
tmp = sqrt(((d / h) * (d / l)));
} else {
tmp = d * pow((h * l), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.42d-238)) then
tmp = sqrt(((d / h) * (d / l)))
else
tmp = d * ((h * l) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.42e-238) {
tmp = Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.42e-238: tmp = math.sqrt(((d / h) * (d / l))) else: tmp = d * math.pow((h * l), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.42e-238) tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.42e-238) tmp = sqrt(((d / h) * (d / l))); else tmp = d * ((h * l) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.42e-238], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.42 \cdot 10^{-238}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if l < -1.4199999999999999e-238Initial program 67.0%
Simplified67.1%
Taylor expanded in h around 0 45.2%
*-rgt-identity45.2%
*-commutative45.2%
sqrt-unprod36.4%
Applied egg-rr36.4%
if -1.4199999999999999e-238 < l Initial program 61.9%
Simplified61.8%
clear-num61.8%
sqrt-div61.7%
metadata-eval61.7%
Applied egg-rr61.7%
Taylor expanded in d around inf 43.6%
unpow-143.6%
metadata-eval43.6%
pow-sqr43.6%
rem-sqrt-square43.6%
rem-square-sqrt43.4%
fabs-sqr43.4%
rem-square-sqrt43.6%
Simplified43.6%
Final simplification40.5%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* h l) -0.5))) (if (<= h -7.5e-280) (* d (- t_0)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (h <= -7.5e-280) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if (h <= (-7.5d-280)) then
tmp = d * -t_0
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (h <= -7.5e-280) {
tmp = d * -t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((h * l), -0.5) tmp = 0 if h <= -7.5e-280: tmp = d * -t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (h <= -7.5e-280) tmp = Float64(d * Float64(-t_0)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h * l) ^ -0.5; tmp = 0.0; if (h <= -7.5e-280) tmp = d * -t_0; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[h, -7.5e-280], N[(d * (-t$95$0)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;h \leq -7.5 \cdot 10^{-280}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if h < -7.4999999999999999e-280Initial program 68.9%
Simplified68.0%
clear-num67.2%
sqrt-div67.9%
metadata-eval67.9%
Applied egg-rr67.9%
Taylor expanded in d around -inf 42.1%
mul-1-neg42.1%
unpow-142.1%
metadata-eval42.1%
pow-sqr42.1%
rem-sqrt-square42.1%
rem-square-sqrt41.9%
fabs-sqr41.9%
rem-square-sqrt42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
if -7.4999999999999999e-280 < h Initial program 59.7%
Simplified59.6%
clear-num59.6%
sqrt-div59.5%
metadata-eval59.5%
Applied egg-rr59.5%
Taylor expanded in d around inf 43.9%
unpow-143.9%
metadata-eval43.9%
pow-sqr43.9%
rem-sqrt-square43.9%
rem-square-sqrt43.7%
fabs-sqr43.7%
rem-square-sqrt43.9%
Simplified43.9%
Final simplification43.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 64.1%
Simplified63.7%
clear-num63.2%
sqrt-div63.6%
metadata-eval63.6%
Applied egg-rr63.6%
Taylor expanded in d around inf 27.2%
unpow-127.2%
metadata-eval27.2%
pow-sqr27.2%
rem-sqrt-square26.8%
rem-square-sqrt26.7%
fabs-sqr26.7%
rem-square-sqrt26.8%
Simplified26.8%
Final simplification26.8%
(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.1%
Simplified63.4%
Taylor expanded in h around 0 40.2%
*-rgt-identity40.2%
expm1-log1p-u39.0%
expm1-udef25.3%
sqrt-div15.1%
sqrt-div16.4%
frac-times16.4%
add-sqr-sqrt16.4%
sqrt-prod15.5%
Applied egg-rr15.5%
expm1-def22.3%
expm1-log1p26.8%
Simplified26.8%
Final simplification26.8%
herbie shell --seed 2024027
(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)))))