
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ D (/ d M))))
(if (<= h 4.2e-254)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (* t_0 (sqrt 0.125)) (* h (/ t_0 (/ l (sqrt 0.125)))))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(fma (/ h l) (* (pow (* D (/ M (* d 2.0))) 2.0) -0.5) 1.0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = D / (d / M);
double tmp;
if (h <= 4.2e-254) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 * sqrt(0.125)) * (h * (t_0 / (l / sqrt(0.125))))));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * fma((h / l), (pow((D * (M / (d * 2.0))), 2.0) * -0.5), 1.0));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(D / Float64(d / M)) tmp = 0.0 if (h <= 4.2e-254) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(t_0 * sqrt(0.125)) * Float64(h * Float64(t_0 / Float64(l / sqrt(0.125))))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * fma(Float64(h / l), Float64((Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0) * -0.5), 1.0))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, 4.2e-254], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$0 * N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision] * N[(h * N[(t$95$0 / N[(l / N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{M}}\\
\mathbf{if}\;h \leq 4.2 \cdot 10^{-254}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(t_0 \cdot \sqrt{0.125}\right) \cdot \left(h \cdot \frac{t_0}{\frac{\ell}{\sqrt{0.125}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot -0.5, 1\right)\right)\\
\end{array}
\end{array}
if h < 4.19999999999999993e-254Initial program 67.6%
metadata-eval67.6%
unpow1/267.6%
metadata-eval67.6%
unpow1/267.6%
*-commutative67.6%
associate-*l*67.6%
times-frac66.9%
metadata-eval66.9%
Simplified66.9%
associate-*r*66.9%
frac-times67.6%
*-commutative67.6%
metadata-eval67.6%
associate-*r/67.2%
metadata-eval67.2%
*-commutative67.2%
frac-times66.5%
associate-*l/66.5%
associate-*r/66.5%
div-inv66.5%
metadata-eval66.5%
Applied egg-rr66.5%
expm1-log1p-u66.2%
expm1-udef66.2%
associate-/l*66.4%
*-commutative66.4%
associate-*r*66.4%
unpow-prod-down66.4%
metadata-eval66.4%
Applied egg-rr66.4%
expm1-def66.4%
expm1-log1p66.9%
*-commutative66.9%
associate-*r*66.9%
metadata-eval66.9%
Simplified66.9%
add-sqr-sqrt66.8%
*-un-lft-identity66.8%
times-frac66.9%
*-commutative66.9%
sqrt-prod66.9%
unpow266.9%
sqrt-prod34.9%
add-sqr-sqrt46.5%
Applied egg-rr70.3%
/-rgt-identity70.3%
associate-/r/73.2%
*-commutative73.2%
associate-/r/73.2%
associate-/l*73.1%
*-commutative73.1%
associate-/r/74.0%
Simplified74.0%
if 4.19999999999999993e-254 < h Initial program 70.7%
associate-*l*70.7%
metadata-eval70.7%
unpow1/270.7%
metadata-eval70.7%
unpow1/270.7%
sub-neg70.7%
+-commutative70.7%
*-commutative70.7%
distribute-rgt-neg-in70.7%
fma-def70.7%
Simplified71.0%
sqrt-div76.3%
Applied egg-rr76.3%
sqrt-div90.4%
Applied egg-rr90.4%
Final simplification82.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (* M (/ D d)))
(t_2
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0))))))
(t_3 (sqrt (/ d h))))
(if (<= t_2 -1e+136)
(* t_3 (* t_0 (* (* (/ t_1 l) (/ t_1 (/ 1.0 h))) -0.125)))
(if (<= t_2 5e+204)
(*
t_3
(* t_0 (fma (pow (* M (/ (/ D d) 2.0)) 2.0) (/ -0.5 (/ l h)) 1.0)))
(fabs (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = M * (D / d);
double t_2 = (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 t_3 = sqrt((d / h));
double tmp;
if (t_2 <= -1e+136) {
tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0 / h))) * -0.125));
} else if (t_2 <= 5e+204) {
tmp = t_3 * (t_0 * fma(pow((M * ((D / d) / 2.0)), 2.0), (-0.5 / (l / h)), 1.0));
} else {
tmp = fabs((d / sqrt((h * l))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(D / d)) t_2 = 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))))) t_3 = sqrt(Float64(d / h)) tmp = 0.0 if (t_2 <= -1e+136) tmp = Float64(t_3 * Float64(t_0 * Float64(Float64(Float64(t_1 / l) * Float64(t_1 / Float64(1.0 / h))) * -0.125))); elseif (t_2 <= 5e+204) tmp = Float64(t_3 * Float64(t_0 * fma((Float64(M * Float64(Float64(D / d) / 2.0)) ^ 2.0), Float64(-0.5 / Float64(l / h)), 1.0))); else tmp = abs(Float64(d / sqrt(Float64(h * l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -1e+136], N[(t$95$3 * N[(t$95$0 * N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+204], N[(t$95$3 * N[(t$95$0 * N[(N[Power[N[(M * N[(N[(D / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / N[(l / h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M \cdot \frac{D}{d}\\
t_2 := \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)\\
t_3 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+136}:\\
\;\;\;\;t_3 \cdot \left(t_0 \cdot \left(\left(\frac{t_1}{\ell} \cdot \frac{t_1}{\frac{1}{h}}\right) \cdot -0.125\right)\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+204}:\\
\;\;\;\;t_3 \cdot \left(t_0 \cdot \mathsf{fma}\left({\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{-0.5}{\frac{\ell}{h}}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\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)))) < -1.00000000000000006e136Initial program 90.6%
associate-*l*90.6%
metadata-eval90.6%
unpow1/290.6%
metadata-eval90.6%
unpow1/290.6%
sub-neg90.6%
+-commutative90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
fma-def90.6%
Simplified90.7%
Taylor expanded in h around inf 69.7%
*-commutative69.7%
*-commutative69.7%
times-frac72.5%
*-commutative72.5%
unpow272.5%
unpow272.5%
unpow272.5%
Simplified72.5%
Taylor expanded in D around 0 69.7%
unpow269.7%
unpow269.7%
*-commutative69.7%
times-frac72.5%
unpow272.5%
associate-/l*72.5%
associate-*r/69.9%
associate-/l*72.8%
associate-/l*87.8%
associate-/r/89.2%
swap-sqr89.3%
*-commutative89.3%
*-commutative89.3%
unpow289.3%
Simplified89.3%
unpow289.3%
div-inv89.3%
times-frac97.3%
Applied egg-rr97.3%
if -1.00000000000000006e136 < (*.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)))) < 5.00000000000000008e204Initial program 88.0%
associate-*l*88.0%
metadata-eval88.0%
unpow1/288.0%
metadata-eval88.0%
unpow1/288.0%
sub-neg88.0%
+-commutative88.0%
*-commutative88.0%
associate-*l*88.0%
distribute-rgt-neg-in88.0%
*-commutative88.0%
Simplified87.2%
if 5.00000000000000008e204 < (*.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 26.2%
associate-*l*26.2%
metadata-eval26.2%
unpow1/226.2%
metadata-eval26.2%
unpow1/226.2%
sub-neg26.2%
+-commutative26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
fma-def26.2%
Simplified26.3%
Taylor expanded in h around 0 34.1%
*-rgt-identity34.1%
expm1-log1p-u33.3%
expm1-udef32.1%
sqrt-unprod28.0%
Applied egg-rr28.0%
expm1-def29.2%
expm1-log1p29.5%
*-commutative29.5%
Simplified29.5%
*-commutative29.5%
sqrt-prod34.1%
pow1/234.1%
metadata-eval34.1%
pow-pow30.1%
pow1/330.6%
*-rgt-identity30.6%
add-sqr-sqrt30.6%
sqrt-prod28.3%
rem-sqrt-square30.6%
*-rgt-identity30.6%
pow1/330.1%
pow-pow34.1%
metadata-eval34.1%
pow1/234.1%
sqrt-prod29.5%
*-commutative29.5%
frac-times30.7%
sqrt-div35.5%
sqrt-prod32.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
Final simplification79.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (* M (/ D d)))
(t_2
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0))))))
(t_3 (sqrt (/ d h))))
(if (<= t_2 -1e+136)
(* t_3 (* t_0 (* (* (/ t_1 l) (/ t_1 (/ 1.0 h))) -0.125)))
(if (<= t_2 5e+204)
(*
t_3
(* t_0 (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D d) (/ M 2.0)) 2.0))))))
(fabs (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = M * (D / d);
double t_2 = (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 t_3 = sqrt((d / h));
double tmp;
if (t_2 <= -1e+136) {
tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0 / h))) * -0.125));
} else if (t_2 <= 5e+204) {
tmp = t_3 * (t_0 * (1.0 - (0.5 * ((h / l) * pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = fabs((d / sqrt((h * l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = m * (d_1 / d)
t_2 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
t_3 = sqrt((d / h))
if (t_2 <= (-1d+136)) then
tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0d0 / h))) * (-0.125d0)))
else if (t_2 <= 5d+204) then
tmp = t_3 * (t_0 * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
else
tmp = abs((d / sqrt((h * l))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = M * (D / d);
double t_2 = (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 t_3 = Math.sqrt((d / h));
double tmp;
if (t_2 <= -1e+136) {
tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0 / h))) * -0.125));
} else if (t_2 <= 5e+204) {
tmp = t_3 * (t_0 * (1.0 - (0.5 * ((h / l) * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = Math.abs((d / Math.sqrt((h * l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = M * (D / d) t_2 = (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)))) t_3 = math.sqrt((d / h)) tmp = 0 if t_2 <= -1e+136: tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0 / h))) * -0.125)) elif t_2 <= 5e+204: tmp = t_3 * (t_0 * (1.0 - (0.5 * ((h / l) * math.pow(((D / d) * (M / 2.0)), 2.0))))) else: tmp = math.fabs((d / math.sqrt((h * l)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(M * Float64(D / d)) t_2 = 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))))) t_3 = sqrt(Float64(d / h)) tmp = 0.0 if (t_2 <= -1e+136) tmp = Float64(t_3 * Float64(t_0 * Float64(Float64(Float64(t_1 / l) * Float64(t_1 / Float64(1.0 / h))) * -0.125))); elseif (t_2 <= 5e+204) tmp = Float64(t_3 * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); else tmp = abs(Float64(d / sqrt(Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = M * (D / d); t_2 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); t_3 = sqrt((d / h)); tmp = 0.0; if (t_2 <= -1e+136) tmp = t_3 * (t_0 * (((t_1 / l) * (t_1 / (1.0 / h))) * -0.125)); elseif (t_2 <= 5e+204) tmp = t_3 * (t_0 * (1.0 - (0.5 * ((h / l) * (((D / d) * (M / 2.0)) ^ 2.0))))); else tmp = abs((d / sqrt((h * l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -1e+136], N[(t$95$3 * N[(t$95$0 * N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+204], N[(t$95$3 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M \cdot \frac{D}{d}\\
t_2 := \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)\\
t_3 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+136}:\\
\;\;\;\;t_3 \cdot \left(t_0 \cdot \left(\left(\frac{t_1}{\ell} \cdot \frac{t_1}{\frac{1}{h}}\right) \cdot -0.125\right)\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+204}:\\
\;\;\;\;t_3 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\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)))) < -1.00000000000000006e136Initial program 90.6%
associate-*l*90.6%
metadata-eval90.6%
unpow1/290.6%
metadata-eval90.6%
unpow1/290.6%
sub-neg90.6%
+-commutative90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
fma-def90.6%
Simplified90.7%
Taylor expanded in h around inf 69.7%
*-commutative69.7%
*-commutative69.7%
times-frac72.5%
*-commutative72.5%
unpow272.5%
unpow272.5%
unpow272.5%
Simplified72.5%
Taylor expanded in D around 0 69.7%
unpow269.7%
unpow269.7%
*-commutative69.7%
times-frac72.5%
unpow272.5%
associate-/l*72.5%
associate-*r/69.9%
associate-/l*72.8%
associate-/l*87.8%
associate-/r/89.2%
swap-sqr89.3%
*-commutative89.3%
*-commutative89.3%
unpow289.3%
Simplified89.3%
unpow289.3%
div-inv89.3%
times-frac97.3%
Applied egg-rr97.3%
if -1.00000000000000006e136 < (*.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)))) < 5.00000000000000008e204Initial program 88.0%
associate-*l*88.0%
metadata-eval88.0%
unpow1/288.0%
metadata-eval88.0%
unpow1/288.0%
associate-*l*88.0%
metadata-eval88.0%
times-frac87.2%
Simplified87.2%
if 5.00000000000000008e204 < (*.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 26.2%
associate-*l*26.2%
metadata-eval26.2%
unpow1/226.2%
metadata-eval26.2%
unpow1/226.2%
sub-neg26.2%
+-commutative26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
fma-def26.2%
Simplified26.3%
Taylor expanded in h around 0 34.1%
*-rgt-identity34.1%
expm1-log1p-u33.3%
expm1-udef32.1%
sqrt-unprod28.0%
Applied egg-rr28.0%
expm1-def29.2%
expm1-log1p29.5%
*-commutative29.5%
Simplified29.5%
*-commutative29.5%
sqrt-prod34.1%
pow1/234.1%
metadata-eval34.1%
pow-pow30.1%
pow1/330.6%
*-rgt-identity30.6%
add-sqr-sqrt30.6%
sqrt-prod28.3%
rem-sqrt-square30.6%
*-rgt-identity30.6%
pow1/330.1%
pow-pow34.1%
metadata-eval34.1%
pow1/234.1%
sqrt-prod29.5%
*-commutative29.5%
frac-times30.7%
sqrt-div35.5%
sqrt-prod32.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
Final simplification79.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ D (/ d M))))
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
5e+204)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (* t_0 (sqrt 0.125)) (* h (/ t_0 (/ l (sqrt 0.125)))))))
(fabs (/ d (sqrt (* h l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = D / (d / M);
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 5e+204) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 * sqrt(0.125)) * (h * (t_0 / (l / sqrt(0.125))))));
} else {
tmp = fabs((d / sqrt((h * l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = d_1 / (d / m)
if (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 5d+204) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - ((t_0 * sqrt(0.125d0)) * (h * (t_0 / (l / sqrt(0.125d0))))))
else
tmp = abs((d / sqrt((h * l))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = D / (d / M);
double tmp;
if (((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))))) <= 5e+204) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((t_0 * Math.sqrt(0.125)) * (h * (t_0 / (l / Math.sqrt(0.125))))));
} else {
tmp = Math.abs((d / Math.sqrt((h * l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = D / (d / M) tmp = 0 if ((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))))) <= 5e+204: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((t_0 * math.sqrt(0.125)) * (h * (t_0 / (l / math.sqrt(0.125)))))) else: tmp = math.fabs((d / math.sqrt((h * l)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(D / Float64(d / M)) tmp = 0.0 if (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))))) <= 5e+204) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(t_0 * sqrt(0.125)) * Float64(h * Float64(t_0 / Float64(l / sqrt(0.125))))))); else tmp = abs(Float64(d / sqrt(Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = D / (d / M); tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 5e+204) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((t_0 * sqrt(0.125)) * (h * (t_0 / (l / sqrt(0.125)))))); else tmp = abs((d / sqrt((h * l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], 5e+204], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$0 * N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision] * N[(h * N[(t$95$0 / N[(l / N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{M}}\\
\mathbf{if}\;\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) \leq 5 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(t_0 \cdot \sqrt{0.125}\right) \cdot \left(h \cdot \frac{t_0}{\frac{\ell}{\sqrt{0.125}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\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)))) < 5.00000000000000008e204Initial program 89.1%
metadata-eval89.1%
unpow1/289.1%
metadata-eval89.1%
unpow1/289.1%
*-commutative89.1%
associate-*l*89.1%
times-frac88.6%
metadata-eval88.6%
Simplified88.6%
associate-*r*88.6%
frac-times89.1%
*-commutative89.1%
metadata-eval89.1%
associate-*r/85.9%
metadata-eval85.9%
*-commutative85.9%
frac-times85.5%
associate-*l/85.5%
associate-*r/85.5%
div-inv85.5%
metadata-eval85.5%
Applied egg-rr85.5%
expm1-log1p-u85.1%
expm1-udef85.1%
associate-/l*87.4%
*-commutative87.4%
associate-*r*87.4%
unpow-prod-down87.4%
metadata-eval87.4%
Applied egg-rr87.4%
expm1-def87.4%
expm1-log1p88.0%
*-commutative88.0%
associate-*r*88.0%
metadata-eval88.0%
Simplified88.0%
add-sqr-sqrt88.0%
*-un-lft-identity88.0%
times-frac88.0%
*-commutative88.0%
sqrt-prod88.1%
unpow288.1%
sqrt-prod47.5%
add-sqr-sqrt61.4%
Applied egg-rr90.2%
/-rgt-identity90.2%
associate-/r/91.3%
*-commutative91.3%
associate-/r/91.3%
associate-/l*91.3%
*-commutative91.3%
associate-/r/91.9%
Simplified91.9%
if 5.00000000000000008e204 < (*.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 26.2%
associate-*l*26.2%
metadata-eval26.2%
unpow1/226.2%
metadata-eval26.2%
unpow1/226.2%
sub-neg26.2%
+-commutative26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
fma-def26.2%
Simplified26.3%
Taylor expanded in h around 0 34.1%
*-rgt-identity34.1%
expm1-log1p-u33.3%
expm1-udef32.1%
sqrt-unprod28.0%
Applied egg-rr28.0%
expm1-def29.2%
expm1-log1p29.5%
*-commutative29.5%
Simplified29.5%
*-commutative29.5%
sqrt-prod34.1%
pow1/234.1%
metadata-eval34.1%
pow-pow30.1%
pow1/330.6%
*-rgt-identity30.6%
add-sqr-sqrt30.6%
sqrt-prod28.3%
rem-sqrt-square30.6%
*-rgt-identity30.6%
pow1/330.1%
pow-pow34.1%
metadata-eval34.1%
pow1/234.1%
sqrt-prod29.5%
*-commutative29.5%
frac-times30.7%
sqrt-div35.5%
sqrt-prod32.7%
add-sqr-sqrt54.8%
Applied egg-rr54.8%
Final simplification80.1%
(FPCore (d h l M D) :precision binary64 (* (* (sqrt (/ d h)) (sqrt (/ d l))) (- 1.0 (/ (* 0.125 (pow (* M (/ D d)) 2.0)) (/ l h)))))
double code(double d, double h, double l, double M, double D) {
return (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((0.125 * pow((M * (D / d)), 2.0)) / (l / h)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - ((0.125d0 * ((m * (d_1 / d)) ** 2.0d0)) / (l / h)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - ((0.125 * Math.pow((M * (D / d)), 2.0)) / (l / h)));
}
def code(d, h, l, M, D): return (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - ((0.125 * math.pow((M * (D / d)), 2.0)) / (l / h)))
function code(d, h, l, M, D) return Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(0.125 * (Float64(M * Float64(D / d)) ^ 2.0)) / Float64(l / h)))) end
function tmp = code(d, h, l, M, D) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((0.125 * ((M * (D / d)) ^ 2.0)) / (l / h))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.125 * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{0.125 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}}{\frac{\ell}{h}}\right)
\end{array}
Initial program 69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
*-commutative69.2%
associate-*l*69.2%
times-frac68.9%
metadata-eval68.9%
Simplified68.9%
associate-*r*68.9%
frac-times69.2%
*-commutative69.2%
metadata-eval69.2%
associate-*r/68.7%
metadata-eval68.7%
*-commutative68.7%
frac-times68.4%
associate-*l/68.4%
associate-*r/68.4%
div-inv68.4%
metadata-eval68.4%
Applied egg-rr68.4%
expm1-log1p-u68.1%
expm1-udef68.1%
associate-/l*68.0%
*-commutative68.0%
associate-*r*68.0%
unpow-prod-down68.0%
metadata-eval68.0%
Applied egg-rr68.0%
expm1-def68.0%
expm1-log1p68.5%
*-commutative68.5%
associate-*r*68.5%
metadata-eval68.5%
Simplified68.5%
Final simplification68.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* (pow (* D (* 0.5 (/ M d))) 2.0) (* h (/ 0.5 l)))))))
(if (<= d -1.02e+135)
(* d (- (sqrt (/ (/ 1.0 h) l))))
(if (<= d -2.4e-293)
t_0
(if (<= d 2.4e-82)
(* -0.125 (/ (sqrt (/ h (pow l 3.0))) (/ (/ (/ d M) D) (* D M))))
(if (or (<= d 3.2e+99) (not (<= d 2.3e+216)))
(/ d (* (sqrt h) (sqrt l)))
t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / h) * (d / l))) * (1.0 - (pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l))));
double tmp;
if (d <= -1.02e+135) {
tmp = d * -sqrt(((1.0 / h) / l));
} else if (d <= -2.4e-293) {
tmp = t_0;
} else if (d <= 2.4e-82) {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if ((d <= 3.2e+99) || !(d <= 2.3e+216)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = 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 = sqrt(((d / h) * (d / l))) * (1.0d0 - (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) * (h * (0.5d0 / l))))
if (d <= (-1.02d+135)) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else if (d <= (-2.4d-293)) then
tmp = t_0
else if (d <= 2.4d-82) then
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) / (((d / m) / d_1) / (d_1 * m)))
else if ((d <= 3.2d+99) .or. (.not. (d <= 2.3d+216))) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = 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.sqrt(((d / h) * (d / l))) * (1.0 - (Math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l))));
double tmp;
if (d <= -1.02e+135) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else if (d <= -2.4e-293) {
tmp = t_0;
} else if (d <= 2.4e-82) {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if ((d <= 3.2e+99) || !(d <= 2.3e+216)) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / h) * (d / l))) * (1.0 - (math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l)))) tmp = 0 if d <= -1.02e+135: tmp = d * -math.sqrt(((1.0 / h) / l)) elif d <= -2.4e-293: tmp = t_0 elif d <= 2.4e-82: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) / (((d / M) / D) / (D * M))) elif (d <= 3.2e+99) or not (d <= 2.3e+216): tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) * Float64(h * Float64(0.5 / l))))) tmp = 0.0 if (d <= -1.02e+135) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); elseif (d <= -2.4e-293) tmp = t_0; elseif (d <= 2.4e-82) tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) / Float64(Float64(Float64(d / M) / D) / Float64(D * M)))); elseif ((d <= 3.2e+99) || !(d <= 2.3e+216)) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = t_0; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / h) * (d / l))) * (1.0 - (((D * (0.5 * (M / d))) ^ 2.0) * (h * (0.5 / l)))); tmp = 0.0; if (d <= -1.02e+135) tmp = d * -sqrt(((1.0 / h) / l)); elseif (d <= -2.4e-293) tmp = t_0; elseif (d <= 2.4e-82) tmp = -0.125 * (sqrt((h / (l ^ 3.0))) / (((d / M) / D) / (D * M))); elseif ((d <= 3.2e+99) || ~((d <= 2.3e+216))) tmp = d / (sqrt(h) * sqrt(l)); else tmp = t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.02e+135], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -2.4e-293], t$95$0, If[LessEqual[d, 2.4e-82], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 3.2e+99], N[Not[LessEqual[d, 2.3e+216]], $MachinePrecision]], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(h \cdot \frac{0.5}{\ell}\right)\right)\\
\mathbf{if}\;d \leq -1.02 \cdot 10^{+135}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{elif}\;d \leq -2.4 \cdot 10^{-293}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{-82}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{\frac{\frac{\frac{d}{M}}{D}}{D \cdot M}}\\
\mathbf{elif}\;d \leq 3.2 \cdot 10^{+99} \lor \neg \left(d \leq 2.3 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if d < -1.01999999999999993e135Initial program 69.2%
associate-*l*69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
sub-neg69.2%
+-commutative69.2%
*-commutative69.2%
distribute-rgt-neg-in69.2%
fma-def69.2%
Simplified69.3%
Taylor expanded in h around 0 56.6%
*-rgt-identity56.6%
expm1-log1p-u53.2%
expm1-udef53.2%
sqrt-unprod39.6%
Applied egg-rr39.6%
expm1-def39.6%
expm1-log1p41.4%
*-commutative41.4%
Simplified41.4%
associate-*l/32.2%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around -inf 68.0%
mul-1-neg68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
*-commutative68.0%
associate-/r*68.0%
Simplified68.0%
if -1.01999999999999993e135 < d < -2.3999999999999999e-293 or 3.19999999999999999e99 < d < 2.29999999999999996e216Initial program 72.0%
metadata-eval72.0%
unpow1/272.0%
metadata-eval72.0%
unpow1/272.0%
*-commutative72.0%
associate-*l*72.0%
times-frac71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in M around 0 72.0%
*-commutative72.0%
*-commutative72.0%
metadata-eval72.0%
times-frac72.0%
*-rgt-identity72.0%
associate-*l/72.1%
*-commutative72.1%
*-lft-identity72.1%
*-commutative72.1%
times-frac72.1%
metadata-eval72.1%
Simplified72.1%
expm1-log1p-u34.2%
expm1-udef18.6%
sqrt-unprod17.0%
associate-*r/17.0%
Applied egg-rr17.0%
expm1-def28.4%
expm1-log1p63.2%
*-commutative63.2%
associate-/l*62.3%
associate-/r/63.2%
Simplified63.2%
if -2.3999999999999999e-293 < d < 2.40000000000000008e-82Initial program 50.0%
metadata-eval50.0%
unpow1/250.0%
metadata-eval50.0%
unpow1/250.0%
*-commutative50.0%
associate-*l*50.0%
times-frac50.3%
metadata-eval50.3%
Simplified50.3%
Taylor expanded in M around 0 50.0%
*-commutative50.0%
*-commutative50.0%
metadata-eval50.0%
times-frac50.0%
*-rgt-identity50.0%
associate-*l/50.6%
*-commutative50.6%
*-lft-identity50.6%
*-commutative50.6%
times-frac50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in d around 0 57.0%
*-commutative57.0%
associate-*r/57.0%
associate-/l*57.0%
unpow257.0%
unpow257.0%
unswap-sqr61.5%
associate-/r*65.4%
*-commutative65.4%
associate-/r*65.3%
Simplified65.3%
if 2.40000000000000008e-82 < d < 3.19999999999999999e99 or 2.29999999999999996e216 < d Initial program 77.7%
associate-*l*77.7%
metadata-eval77.7%
unpow1/277.7%
metadata-eval77.7%
unpow1/277.7%
sub-neg77.7%
+-commutative77.7%
*-commutative77.7%
distribute-rgt-neg-in77.7%
fma-def77.7%
Simplified77.8%
Taylor expanded in h around 0 65.1%
*-rgt-identity65.1%
expm1-log1p-u62.4%
expm1-udef45.2%
sqrt-unprod37.0%
Applied egg-rr37.0%
expm1-def49.5%
expm1-log1p51.4%
*-commutative51.4%
Simplified51.4%
frac-times41.8%
sqrt-div48.7%
sqrt-prod62.8%
add-sqr-sqrt63.1%
Applied egg-rr63.1%
sqrt-prod78.4%
Applied egg-rr78.4%
Final simplification68.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* (/ d h) (/ d l)))) (t_1 (pow (* D (* 0.5 (/ M d))) 2.0)))
(if (<= d -2.35e+134)
(* d (- (sqrt (/ (/ 1.0 h) l))))
(if (<= d -1e-292)
(* t_0 (- 1.0 (* t_1 (/ 0.5 (/ l h)))))
(if (<= d 1.1e-78)
(* -0.125 (/ (sqrt (/ h (pow l 3.0))) (/ (/ (/ d M) D) (* D M))))
(if (or (<= d 1.65e+100) (not (<= d 3.1e+216)))
(/ d (* (sqrt h) (sqrt l)))
(* t_0 (- 1.0 (* t_1 (* h (/ 0.5 l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((d / h) * (d / l)));
double t_1 = pow((D * (0.5 * (M / d))), 2.0);
double tmp;
if (d <= -2.35e+134) {
tmp = d * -sqrt(((1.0 / h) / l));
} else if (d <= -1e-292) {
tmp = t_0 * (1.0 - (t_1 * (0.5 / (l / h))));
} else if (d <= 1.1e-78) {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if ((d <= 1.65e+100) || !(d <= 3.1e+216)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = t_0 * (1.0 - (t_1 * (h * (0.5 / 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(((d / h) * (d / l)))
t_1 = (d_1 * (0.5d0 * (m / d))) ** 2.0d0
if (d <= (-2.35d+134)) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else if (d <= (-1d-292)) then
tmp = t_0 * (1.0d0 - (t_1 * (0.5d0 / (l / h))))
else if (d <= 1.1d-78) then
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) / (((d / m) / d_1) / (d_1 * m)))
else if ((d <= 1.65d+100) .or. (.not. (d <= 3.1d+216))) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = t_0 * (1.0d0 - (t_1 * (h * (0.5d0 / 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) * (d / l)));
double t_1 = Math.pow((D * (0.5 * (M / d))), 2.0);
double tmp;
if (d <= -2.35e+134) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else if (d <= -1e-292) {
tmp = t_0 * (1.0 - (t_1 * (0.5 / (l / h))));
} else if (d <= 1.1e-78) {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if ((d <= 1.65e+100) || !(d <= 3.1e+216)) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = t_0 * (1.0 - (t_1 * (h * (0.5 / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((d / h) * (d / l))) t_1 = math.pow((D * (0.5 * (M / d))), 2.0) tmp = 0 if d <= -2.35e+134: tmp = d * -math.sqrt(((1.0 / h) / l)) elif d <= -1e-292: tmp = t_0 * (1.0 - (t_1 * (0.5 / (l / h)))) elif d <= 1.1e-78: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) / (((d / M) / D) / (D * M))) elif (d <= 1.65e+100) or not (d <= 3.1e+216): tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = t_0 * (1.0 - (t_1 * (h * (0.5 / l)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(d / h) * Float64(d / l))) t_1 = Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0 tmp = 0.0 if (d <= -2.35e+134) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); elseif (d <= -1e-292) tmp = Float64(t_0 * Float64(1.0 - Float64(t_1 * Float64(0.5 / Float64(l / h))))); elseif (d <= 1.1e-78) tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) / Float64(Float64(Float64(d / M) / D) / Float64(D * M)))); elseif ((d <= 1.65e+100) || !(d <= 3.1e+216)) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(t_0 * Float64(1.0 - Float64(t_1 * Float64(h * Float64(0.5 / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((d / h) * (d / l))); t_1 = (D * (0.5 * (M / d))) ^ 2.0; tmp = 0.0; if (d <= -2.35e+134) tmp = d * -sqrt(((1.0 / h) / l)); elseif (d <= -1e-292) tmp = t_0 * (1.0 - (t_1 * (0.5 / (l / h)))); elseif (d <= 1.1e-78) tmp = -0.125 * (sqrt((h / (l ^ 3.0))) / (((d / M) / D) / (D * M))); elseif ((d <= 1.65e+100) || ~((d <= 3.1e+216))) tmp = d / (sqrt(h) * sqrt(l)); else tmp = t_0 * (1.0 - (t_1 * (h * (0.5 / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[d, -2.35e+134], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1e-292], N[(t$95$0 * N[(1.0 - N[(t$95$1 * N[(0.5 / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e-78], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 1.65e+100], N[Not[LessEqual[d, 3.1e+216]], $MachinePrecision]], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 - N[(t$95$1 * N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
t_1 := {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\\
\mathbf{if}\;d \leq -2.35 \cdot 10^{+134}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-292}:\\
\;\;\;\;t_0 \cdot \left(1 - t_1 \cdot \frac{0.5}{\frac{\ell}{h}}\right)\\
\mathbf{elif}\;d \leq 1.1 \cdot 10^{-78}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{\frac{\frac{\frac{d}{M}}{D}}{D \cdot M}}\\
\mathbf{elif}\;d \leq 1.65 \cdot 10^{+100} \lor \neg \left(d \leq 3.1 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 - t_1 \cdot \left(h \cdot \frac{0.5}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < -2.35000000000000013e134Initial program 69.2%
associate-*l*69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
sub-neg69.2%
+-commutative69.2%
*-commutative69.2%
distribute-rgt-neg-in69.2%
fma-def69.2%
Simplified69.3%
Taylor expanded in h around 0 56.6%
*-rgt-identity56.6%
expm1-log1p-u53.2%
expm1-udef53.2%
sqrt-unprod39.6%
Applied egg-rr39.6%
expm1-def39.6%
expm1-log1p41.4%
*-commutative41.4%
Simplified41.4%
associate-*l/32.2%
sqrt-div0.0%
Applied egg-rr0.0%
Taylor expanded in d around -inf 68.0%
mul-1-neg68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
*-commutative68.0%
associate-/r*68.0%
Simplified68.0%
if -2.35000000000000013e134 < d < -1.0000000000000001e-292Initial program 68.2%
metadata-eval68.2%
unpow1/268.2%
metadata-eval68.2%
unpow1/268.2%
*-commutative68.2%
associate-*l*68.2%
times-frac67.1%
metadata-eval67.1%
Simplified67.1%
Taylor expanded in M around 0 68.2%
*-commutative68.2%
*-commutative68.2%
metadata-eval68.2%
times-frac68.2%
*-rgt-identity68.2%
associate-*l/68.3%
*-commutative68.3%
*-lft-identity68.3%
*-commutative68.3%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
expm1-log1p-u30.2%
expm1-udef11.5%
sqrt-unprod9.6%
associate-*r/9.6%
Applied egg-rr9.6%
expm1-def22.9%
expm1-log1p57.0%
*-commutative57.0%
associate-/l*57.0%
Simplified57.0%
if -1.0000000000000001e-292 < d < 1.0999999999999999e-78Initial program 50.0%
metadata-eval50.0%
unpow1/250.0%
metadata-eval50.0%
unpow1/250.0%
*-commutative50.0%
associate-*l*50.0%
times-frac50.3%
metadata-eval50.3%
Simplified50.3%
Taylor expanded in M around 0 50.0%
*-commutative50.0%
*-commutative50.0%
metadata-eval50.0%
times-frac50.0%
*-rgt-identity50.0%
associate-*l/50.6%
*-commutative50.6%
*-lft-identity50.6%
*-commutative50.6%
times-frac50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in d around 0 57.0%
*-commutative57.0%
associate-*r/57.0%
associate-/l*57.0%
unpow257.0%
unpow257.0%
unswap-sqr61.5%
associate-/r*65.4%
*-commutative65.4%
associate-/r*65.3%
Simplified65.3%
if 1.0999999999999999e-78 < d < 1.6500000000000001e100 or 3.10000000000000004e216 < d Initial program 77.7%
associate-*l*77.7%
metadata-eval77.7%
unpow1/277.7%
metadata-eval77.7%
unpow1/277.7%
sub-neg77.7%
+-commutative77.7%
*-commutative77.7%
distribute-rgt-neg-in77.7%
fma-def77.7%
Simplified77.8%
Taylor expanded in h around 0 65.1%
*-rgt-identity65.1%
expm1-log1p-u62.4%
expm1-udef45.2%
sqrt-unprod37.0%
Applied egg-rr37.0%
expm1-def49.5%
expm1-log1p51.4%
*-commutative51.4%
Simplified51.4%
frac-times41.8%
sqrt-div48.7%
sqrt-prod62.8%
add-sqr-sqrt63.1%
Applied egg-rr63.1%
sqrt-prod78.4%
Applied egg-rr78.4%
if 1.6500000000000001e100 < d < 3.10000000000000004e216Initial program 86.5%
metadata-eval86.5%
unpow1/286.5%
metadata-eval86.5%
unpow1/286.5%
*-commutative86.5%
associate-*l*86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in M around 0 86.5%
*-commutative86.5%
*-commutative86.5%
metadata-eval86.5%
times-frac86.5%
*-rgt-identity86.5%
associate-*l/86.5%
*-commutative86.5%
*-lft-identity86.5%
*-commutative86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
expm1-log1p-u49.4%
expm1-udef45.1%
sqrt-unprod45.1%
associate-*r/45.1%
Applied egg-rr45.1%
expm1-def49.5%
expm1-log1p86.7%
*-commutative86.7%
associate-/l*82.2%
associate-/r/86.7%
Simplified86.7%
Final simplification68.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (* (/ D d) (/ D d)) (* 0.125 (/ (* M M) (/ l h))))))))
(if (<= d -2.35e-293)
t_0
(if (<= d 8.4e-89)
(* -0.125 (/ (sqrt (/ h (pow l 3.0))) (/ (/ (/ d M) D) (* D M))))
(if (<= d 9.5e+44)
t_0
(if (or (<= d 3.3e+99) (not (<= d 7.6e+223)))
(/ d (* (sqrt h) (sqrt l)))
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* (pow (* D (* 0.5 (/ M d))) 2.0) (* h (/ 0.5 l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h)))));
double tmp;
if (d <= -2.35e-293) {
tmp = t_0;
} else if (d <= 8.4e-89) {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if (d <= 9.5e+44) {
tmp = t_0;
} else if ((d <= 3.3e+99) || !(d <= 7.6e+223)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / 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 - (((d_1 / d) * (d_1 / d)) * (0.125d0 * ((m * m) / (l / h)))))
if (d <= (-2.35d-293)) then
tmp = t_0
else if (d <= 8.4d-89) then
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) / (((d / m) / d_1) / (d_1 * m)))
else if (d <= 9.5d+44) then
tmp = t_0
else if ((d <= 3.3d+99) .or. (.not. (d <= 7.6d+223))) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 - (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) * (h * (0.5d0 / 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 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h)))));
double tmp;
if (d <= -2.35e-293) {
tmp = t_0;
} else if (d <= 8.4e-89) {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if (d <= 9.5e+44) {
tmp = t_0;
} else if ((d <= 3.3e+99) || !(d <= 7.6e+223)) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 - (Math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h))))) tmp = 0 if d <= -2.35e-293: tmp = t_0 elif d <= 8.4e-89: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) / (((d / M) / D) / (D * M))) elif d <= 9.5e+44: tmp = t_0 elif (d <= 3.3e+99) or not (d <= 7.6e+223): tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 - (math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / 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(Float64(Float64(D / d) * Float64(D / d)) * Float64(0.125 * Float64(Float64(M * M) / Float64(l / h)))))) tmp = 0.0 if (d <= -2.35e-293) tmp = t_0; elseif (d <= 8.4e-89) tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) / Float64(Float64(Float64(d / M) / D) / Float64(D * M)))); elseif (d <= 9.5e+44) tmp = t_0; elseif ((d <= 3.3e+99) || !(d <= 7.6e+223)) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) * Float64(h * Float64(0.5 / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h))))); tmp = 0.0; if (d <= -2.35e-293) tmp = t_0; elseif (d <= 8.4e-89) tmp = -0.125 * (sqrt((h / (l ^ 3.0))) / (((d / M) / D) / (D * M))); elseif (d <= 9.5e+44) tmp = t_0; elseif ((d <= 3.3e+99) || ~((d <= 7.6e+223))) tmp = d / (sqrt(h) * sqrt(l)); else tmp = sqrt(((d / h) * (d / l))) * (1.0 - (((D * (0.5 * (M / d))) ^ 2.0) * (h * (0.5 / 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[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.35e-293], t$95$0, If[LessEqual[d, 8.4e-89], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.5e+44], t$95$0, If[Or[LessEqual[d, 3.3e+99], N[Not[LessEqual[d, 7.6e+223]], $MachinePrecision]], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $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 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(0.125 \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
\mathbf{if}\;d \leq -2.35 \cdot 10^{-293}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 8.4 \cdot 10^{-89}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{\frac{\frac{\frac{d}{M}}{D}}{D \cdot M}}\\
\mathbf{elif}\;d \leq 9.5 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 3.3 \cdot 10^{+99} \lor \neg \left(d \leq 7.6 \cdot 10^{+223}\right):\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(h \cdot \frac{0.5}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < -2.35000000000000006e-293 or 8.4000000000000004e-89 < d < 9.5000000000000004e44Initial program 70.8%
metadata-eval70.8%
unpow1/270.8%
metadata-eval70.8%
unpow1/270.8%
*-commutative70.8%
associate-*l*70.8%
times-frac70.2%
metadata-eval70.2%
Simplified70.2%
Taylor expanded in M around 0 54.0%
associate-*r/54.0%
*-commutative54.0%
associate-*r/54.0%
*-commutative54.0%
times-frac55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
times-frac66.3%
associate-/l*64.8%
unpow264.8%
Simplified64.8%
if -2.35000000000000006e-293 < d < 8.4000000000000004e-89Initial program 50.0%
metadata-eval50.0%
unpow1/250.0%
metadata-eval50.0%
unpow1/250.0%
*-commutative50.0%
associate-*l*50.0%
times-frac50.3%
metadata-eval50.3%
Simplified50.3%
Taylor expanded in M around 0 50.0%
*-commutative50.0%
*-commutative50.0%
metadata-eval50.0%
times-frac50.0%
*-rgt-identity50.0%
associate-*l/50.6%
*-commutative50.6%
*-lft-identity50.6%
*-commutative50.6%
times-frac50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in d around 0 57.0%
*-commutative57.0%
associate-*r/57.0%
associate-/l*57.0%
unpow257.0%
unpow257.0%
unswap-sqr61.5%
associate-/r*65.4%
*-commutative65.4%
associate-/r*65.3%
Simplified65.3%
if 9.5000000000000004e44 < d < 3.2999999999999999e99 or 7.6000000000000001e223 < d Initial program 77.1%
associate-*l*77.1%
metadata-eval77.1%
unpow1/277.1%
metadata-eval77.1%
unpow1/277.1%
sub-neg77.1%
+-commutative77.1%
*-commutative77.1%
distribute-rgt-neg-in77.1%
fma-def77.1%
Simplified77.3%
Taylor expanded in h around 0 73.8%
*-rgt-identity73.8%
expm1-log1p-u70.3%
expm1-udef60.6%
sqrt-unprod47.2%
Applied egg-rr47.2%
expm1-def56.9%
expm1-log1p59.1%
*-commutative59.1%
Simplified59.1%
frac-times43.6%
sqrt-div53.6%
sqrt-prod80.7%
add-sqr-sqrt80.9%
Applied egg-rr80.9%
sqrt-prod93.3%
Applied egg-rr93.3%
if 3.2999999999999999e99 < d < 7.6000000000000001e223Initial program 86.5%
metadata-eval86.5%
unpow1/286.5%
metadata-eval86.5%
unpow1/286.5%
*-commutative86.5%
associate-*l*86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in M around 0 86.5%
*-commutative86.5%
*-commutative86.5%
metadata-eval86.5%
times-frac86.5%
*-rgt-identity86.5%
associate-*l/86.5%
*-commutative86.5%
*-lft-identity86.5%
*-commutative86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
expm1-log1p-u49.4%
expm1-udef45.1%
sqrt-unprod45.1%
associate-*r/45.1%
Applied egg-rr45.1%
expm1-def49.5%
expm1-log1p86.7%
*-commutative86.7%
associate-/l*82.2%
associate-/r/86.7%
Simplified86.7%
Final simplification71.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ d h)) (sqrt (/ d l)))))
(if (<= d -2.5e-293)
(* t_0 (- 1.0 (* (* (/ D d) (/ D d)) (* 0.125 (/ (* M M) (/ l h))))))
(if (<= d 8.4e-89)
(* -0.125 (/ (sqrt (/ h (pow l 3.0))) (/ (/ (/ d M) D) (* D M))))
(if (<= d 4.2e+44)
(* t_0 (- 1.0 (* 0.125 (* (/ (* D D) l) (/ (* h (* M M)) (* d d))))))
(if (or (<= d 6e+100) (not (<= d 2.45e+216)))
(/ d (* (sqrt h) (sqrt l)))
(*
(sqrt (* (/ d h) (/ d l)))
(- 1.0 (* (pow (* D (* 0.5 (/ M d))) 2.0) (* h (/ 0.5 l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * sqrt((d / l));
double tmp;
if (d <= -2.5e-293) {
tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h)))));
} else if (d <= 8.4e-89) {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if (d <= 4.2e+44) {
tmp = t_0 * (1.0 - (0.125 * (((D * D) / l) * ((h * (M * M)) / (d * d)))));
} else if ((d <= 6e+100) || !(d <= 2.45e+216)) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 - (pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / 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))
if (d <= (-2.5d-293)) then
tmp = t_0 * (1.0d0 - (((d_1 / d) * (d_1 / d)) * (0.125d0 * ((m * m) / (l / h)))))
else if (d <= 8.4d-89) then
tmp = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) / (((d / m) / d_1) / (d_1 * m)))
else if (d <= 4.2d+44) then
tmp = t_0 * (1.0d0 - (0.125d0 * (((d_1 * d_1) / l) * ((h * (m * m)) / (d * d)))))
else if ((d <= 6d+100) .or. (.not. (d <= 2.45d+216))) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 - (((d_1 * (0.5d0 * (m / d))) ** 2.0d0) * (h * (0.5d0 / 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));
double tmp;
if (d <= -2.5e-293) {
tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h)))));
} else if (d <= 8.4e-89) {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) / (((d / M) / D) / (D * M)));
} else if (d <= 4.2e+44) {
tmp = t_0 * (1.0 - (0.125 * (((D * D) / l) * ((h * (M * M)) / (d * d)))));
} else if ((d <= 6e+100) || !(d <= 2.45e+216)) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 - (Math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * math.sqrt((d / l)) tmp = 0 if d <= -2.5e-293: tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h))))) elif d <= 8.4e-89: tmp = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) / (((d / M) / D) / (D * M))) elif d <= 4.2e+44: tmp = t_0 * (1.0 - (0.125 * (((D * D) / l) * ((h * (M * M)) / (d * d))))) elif (d <= 6e+100) or not (d <= 2.45e+216): tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 - (math.pow((D * (0.5 * (M / d))), 2.0) * (h * (0.5 / l)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) tmp = 0.0 if (d <= -2.5e-293) tmp = Float64(t_0 * Float64(1.0 - Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(0.125 * Float64(Float64(M * M) / Float64(l / h)))))); elseif (d <= 8.4e-89) tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) / Float64(Float64(Float64(d / M) / D) / Float64(D * M)))); elseif (d <= 4.2e+44) tmp = Float64(t_0 * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(h * Float64(M * M)) / Float64(d * d)))))); elseif ((d <= 6e+100) || !(d <= 2.45e+216)) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 - Float64((Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0) * Float64(h * Float64(0.5 / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * sqrt((d / l)); tmp = 0.0; if (d <= -2.5e-293) tmp = t_0 * (1.0 - (((D / d) * (D / d)) * (0.125 * ((M * M) / (l / h))))); elseif (d <= 8.4e-89) tmp = -0.125 * (sqrt((h / (l ^ 3.0))) / (((d / M) / D) / (D * M))); elseif (d <= 4.2e+44) tmp = t_0 * (1.0 - (0.125 * (((D * D) / l) * ((h * (M * M)) / (d * d))))); elseif ((d <= 6e+100) || ~((d <= 2.45e+216))) tmp = d / (sqrt(h) * sqrt(l)); else tmp = sqrt(((d / h) * (d / l))) * (1.0 - (((D * (0.5 * (M / d))) ^ 2.0) * (h * (0.5 / 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.5e-293], N[(t$95$0 * N[(1.0 - N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.4e-89], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.2e+44], N[(t$95$0 * N[(1.0 - N[(0.125 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 6e+100], N[Not[LessEqual[d, 2.45e+216]], $MachinePrecision]], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -2.5 \cdot 10^{-293}:\\
\;\;\;\;t_0 \cdot \left(1 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(0.125 \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
\mathbf{elif}\;d \leq 8.4 \cdot 10^{-89}:\\
\;\;\;\;-0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{\frac{\frac{\frac{d}{M}}{D}}{D \cdot M}}\\
\mathbf{elif}\;d \leq 4.2 \cdot 10^{+44}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)\right)\\
\mathbf{elif}\;d \leq 6 \cdot 10^{+100} \lor \neg \left(d \leq 2.45 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(h \cdot \frac{0.5}{\ell}\right)\right)\\
\end{array}
\end{array}
if d < -2.5000000000000001e-293Initial program 68.5%
metadata-eval68.5%
unpow1/268.5%
metadata-eval68.5%
unpow1/268.5%
*-commutative68.5%
associate-*l*68.5%
times-frac67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in M around 0 46.7%
associate-*r/46.7%
*-commutative46.7%
associate-*r/46.7%
*-commutative46.7%
times-frac48.1%
associate-*l*48.1%
unpow248.1%
unpow248.1%
times-frac60.9%
associate-/l*60.8%
unpow260.8%
Simplified60.8%
if -2.5000000000000001e-293 < d < 8.4000000000000004e-89Initial program 50.0%
metadata-eval50.0%
unpow1/250.0%
metadata-eval50.0%
unpow1/250.0%
*-commutative50.0%
associate-*l*50.0%
times-frac50.3%
metadata-eval50.3%
Simplified50.3%
Taylor expanded in M around 0 50.0%
*-commutative50.0%
*-commutative50.0%
metadata-eval50.0%
times-frac50.0%
*-rgt-identity50.0%
associate-*l/50.6%
*-commutative50.6%
*-lft-identity50.6%
*-commutative50.6%
times-frac50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in d around 0 57.0%
*-commutative57.0%
associate-*r/57.0%
associate-/l*57.0%
unpow257.0%
unpow257.0%
unswap-sqr61.5%
associate-/r*65.4%
*-commutative65.4%
associate-/r*65.3%
Simplified65.3%
if 8.4000000000000004e-89 < d < 4.19999999999999974e44Initial program 78.4%
metadata-eval78.4%
unpow1/278.4%
metadata-eval78.4%
unpow1/278.4%
*-commutative78.4%
associate-*l*78.4%
times-frac78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in M around 0 78.4%
*-commutative78.4%
*-commutative78.4%
metadata-eval78.4%
times-frac78.4%
*-rgt-identity78.4%
associate-*l/78.4%
*-commutative78.4%
*-lft-identity78.4%
*-commutative78.4%
times-frac78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in D around 0 78.6%
*-commutative78.6%
*-commutative78.6%
times-frac81.5%
unpow281.5%
*-commutative81.5%
unpow281.5%
unpow281.5%
Simplified81.5%
if 4.19999999999999974e44 < d < 5.99999999999999971e100 or 2.45000000000000007e216 < d Initial program 77.1%
associate-*l*77.1%
metadata-eval77.1%
unpow1/277.1%
metadata-eval77.1%
unpow1/277.1%
sub-neg77.1%
+-commutative77.1%
*-commutative77.1%
distribute-rgt-neg-in77.1%
fma-def77.1%
Simplified77.3%
Taylor expanded in h around 0 73.8%
*-rgt-identity73.8%
expm1-log1p-u70.3%
expm1-udef60.6%
sqrt-unprod47.2%
Applied egg-rr47.2%
expm1-def56.9%
expm1-log1p59.1%
*-commutative59.1%
Simplified59.1%
frac-times43.6%
sqrt-div53.6%
sqrt-prod80.7%
add-sqr-sqrt80.9%
Applied egg-rr80.9%
sqrt-prod93.3%
Applied egg-rr93.3%
if 5.99999999999999971e100 < d < 2.45000000000000007e216Initial program 86.5%
metadata-eval86.5%
unpow1/286.5%
metadata-eval86.5%
unpow1/286.5%
*-commutative86.5%
associate-*l*86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in M around 0 86.5%
*-commutative86.5%
*-commutative86.5%
metadata-eval86.5%
times-frac86.5%
*-rgt-identity86.5%
associate-*l/86.5%
*-commutative86.5%
*-lft-identity86.5%
*-commutative86.5%
times-frac86.5%
metadata-eval86.5%
Simplified86.5%
expm1-log1p-u49.4%
expm1-udef45.1%
sqrt-unprod45.1%
associate-*r/45.1%
Applied egg-rr45.1%
expm1-def49.5%
expm1-log1p86.7%
*-commutative86.7%
associate-/l*82.2%
associate-/r/86.7%
Simplified86.7%
Final simplification71.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* -0.125 (/ (sqrt (/ h (pow l 3.0))) (/ (/ (/ d M) D) (* D M)))))
(t_1 (/ d (* (sqrt h) (sqrt l)))))
(if (<= d -2e-310)
(fabs (/ d (sqrt (* h l))))
(if (<= d 2.9e-82)
t_0
(if (<= d 7e-31)
t_1
(if (<= d 1.15e-7)
t_0
(if (<= d 3000.0)
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
t_1)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.125 * (sqrt((h / pow(l, 3.0))) / (((d / M) / D) / (D * M)));
double t_1 = d / (sqrt(h) * sqrt(l));
double tmp;
if (d <= -2e-310) {
tmp = fabs((d / sqrt((h * l))));
} else if (d <= 2.9e-82) {
tmp = t_0;
} else if (d <= 7e-31) {
tmp = t_1;
} else if (d <= 1.15e-7) {
tmp = t_0;
} else if (d <= 3000.0) {
tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-0.125d0) * (sqrt((h / (l ** 3.0d0))) / (((d / m) / d_1) / (d_1 * m)))
t_1 = d / (sqrt(h) * sqrt(l))
if (d <= (-2d-310)) then
tmp = abs((d / sqrt((h * l))))
else if (d <= 2.9d-82) then
tmp = t_0
else if (d <= 7d-31) then
tmp = t_1
else if (d <= 1.15d-7) then
tmp = t_0
else if (d <= 3000.0d0) then
tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) / (((d / M) / D) / (D * M)));
double t_1 = d / (Math.sqrt(h) * Math.sqrt(l));
double tmp;
if (d <= -2e-310) {
tmp = Math.abs((d / Math.sqrt((h * l))));
} else if (d <= 2.9e-82) {
tmp = t_0;
} else if (d <= 7e-31) {
tmp = t_1;
} else if (d <= 1.15e-7) {
tmp = t_0;
} else if (d <= 3000.0) {
tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = -0.125 * (math.sqrt((h / math.pow(l, 3.0))) / (((d / M) / D) / (D * M))) t_1 = d / (math.sqrt(h) * math.sqrt(l)) tmp = 0 if d <= -2e-310: tmp = math.fabs((d / math.sqrt((h * l)))) elif d <= 2.9e-82: tmp = t_0 elif d <= 7e-31: tmp = t_1 elif d <= 1.15e-7: tmp = t_0 elif d <= 3000.0: tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))) else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) / Float64(Float64(Float64(d / M) / D) / Float64(D * M)))) t_1 = Float64(d / Float64(sqrt(h) * sqrt(l))) tmp = 0.0 if (d <= -2e-310) tmp = abs(Float64(d / sqrt(Float64(h * l)))); elseif (d <= 2.9e-82) tmp = t_0; elseif (d <= 7e-31) tmp = t_1; elseif (d <= 1.15e-7) tmp = t_0; elseif (d <= 3000.0) tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = -0.125 * (sqrt((h / (l ^ 3.0))) / (((d / M) / D) / (D * M))); t_1 = d / (sqrt(h) * sqrt(l)); tmp = 0.0; if (d <= -2e-310) tmp = abs((d / sqrt((h * l)))); elseif (d <= 2.9e-82) tmp = t_0; elseif (d <= 7e-31) tmp = t_1; elseif (d <= 1.15e-7) tmp = t_0; elseif (d <= 3000.0) tmp = sqrt((d / l)) * (1.0 / sqrt((h / d))); else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision] / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2e-310], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, 2.9e-82], t$95$0, If[LessEqual[d, 7e-31], t$95$1, If[LessEqual[d, 1.15e-7], t$95$0, If[LessEqual[d, 3000.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.125 \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{\frac{\frac{\frac{d}{M}}{D}}{D \cdot M}}\\
t_1 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{if}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\mathbf{elif}\;d \leq 2.9 \cdot 10^{-82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 7 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 3000:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if d < -1.999999999999994e-310Initial program 67.9%
associate-*l*67.9%
metadata-eval67.9%
unpow1/267.9%
metadata-eval67.9%
unpow1/267.9%
sub-neg67.9%
+-commutative67.9%
*-commutative67.9%
distribute-rgt-neg-in67.9%
fma-def67.9%
Simplified68.0%
Taylor expanded in h around 0 36.2%
*-rgt-identity36.2%
expm1-log1p-u34.9%
expm1-udef23.9%
sqrt-unprod18.8%
Applied egg-rr18.8%
expm1-def27.4%
expm1-log1p28.0%
*-commutative28.0%
Simplified28.0%
*-commutative28.0%
sqrt-prod36.2%
pow1/236.2%
metadata-eval36.2%
pow-pow29.3%
pow1/330.8%
*-rgt-identity30.8%
add-sqr-sqrt30.7%
sqrt-prod26.7%
rem-sqrt-square30.8%
*-rgt-identity30.8%
pow1/329.3%
pow-pow36.2%
metadata-eval36.2%
pow1/236.2%
sqrt-prod28.0%
*-commutative28.0%
frac-times20.0%
sqrt-div25.9%
sqrt-prod0.0%
add-sqr-sqrt41.2%
Applied egg-rr41.2%
if -1.999999999999994e-310 < d < 2.89999999999999977e-82 or 6.99999999999999971e-31 < d < 1.14999999999999997e-7Initial program 57.4%
metadata-eval57.4%
unpow1/257.4%
metadata-eval57.4%
unpow1/257.4%
*-commutative57.4%
associate-*l*57.4%
times-frac57.6%
metadata-eval57.6%
Simplified57.6%
Taylor expanded in M around 0 57.4%
*-commutative57.4%
*-commutative57.4%
metadata-eval57.4%
times-frac57.4%
*-rgt-identity57.4%
associate-*l/57.9%
*-commutative57.9%
*-lft-identity57.9%
*-commutative57.9%
times-frac57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in d around 0 60.0%
*-commutative60.0%
associate-*r/60.0%
associate-/l*60.0%
unpow260.0%
unpow260.0%
unswap-sqr64.0%
associate-/r*67.5%
*-commutative67.5%
associate-/r*67.4%
Simplified67.4%
if 2.89999999999999977e-82 < d < 6.99999999999999971e-31 or 3e3 < d Initial program 77.4%
associate-*l*77.4%
metadata-eval77.4%
unpow1/277.4%
metadata-eval77.4%
unpow1/277.4%
sub-neg77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-in77.4%
fma-def77.4%
Simplified77.5%
Taylor expanded in h around 0 63.2%
*-rgt-identity63.2%
expm1-log1p-u60.8%
expm1-udef48.4%
sqrt-unprod41.4%
Applied egg-rr41.4%
expm1-def50.9%
expm1-log1p52.6%
*-commutative52.6%
Simplified52.6%
frac-times41.0%
sqrt-div46.9%
sqrt-prod64.6%
add-sqr-sqrt64.8%
Applied egg-rr64.8%
sqrt-prod77.9%
Applied egg-rr77.9%
if 1.14999999999999997e-7 < d < 3e3Initial program 99.5%
associate-*l*99.5%
metadata-eval99.5%
unpow1/299.5%
metadata-eval99.5%
unpow1/299.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in h around 0 99.5%
add-cube-cbrt97.2%
pow397.7%
Applied egg-rr97.7%
rem-cube-cbrt99.5%
clear-num99.5%
sqrt-div100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification59.4%
(FPCore (d h l M D) :precision binary64 (if (<= d 4.2e-244) (* d (- (sqrt (/ (/ 1.0 h) l)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 4.2e-244) {
tmp = d * -sqrt(((1.0 / 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 (d <= 4.2d-244) then
tmp = d * -sqrt(((1.0d0 / 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 (d <= 4.2e-244) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 4.2e-244: tmp = d * -math.sqrt(((1.0 / h) / l)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 4.2e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / 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 (d <= 4.2e-244) tmp = d * -sqrt(((1.0 / h) / l)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 4.2e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / 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}\;d \leq 4.2 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < 4.20000000000000003e-244Initial program 66.2%
associate-*l*66.2%
metadata-eval66.2%
unpow1/266.2%
metadata-eval66.2%
unpow1/266.2%
sub-neg66.2%
+-commutative66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
fma-def66.2%
Simplified66.3%
Taylor expanded in h around 0 33.7%
*-rgt-identity33.7%
expm1-log1p-u32.6%
expm1-udef22.6%
sqrt-unprod18.0%
Applied egg-rr18.0%
expm1-def25.8%
expm1-log1p26.3%
*-commutative26.3%
Simplified26.3%
associate-*l/24.1%
sqrt-div1.0%
Applied egg-rr1.0%
Taylor expanded in d around -inf 40.5%
mul-1-neg40.5%
*-commutative40.5%
distribute-rgt-neg-in40.5%
*-commutative40.5%
associate-/r*40.6%
Simplified40.6%
if 4.20000000000000003e-244 < d Initial program 72.1%
associate-*l*72.1%
metadata-eval72.1%
unpow1/272.1%
metadata-eval72.1%
unpow1/272.1%
sub-neg72.1%
+-commutative72.1%
*-commutative72.1%
distribute-rgt-neg-in72.1%
fma-def72.1%
Simplified72.3%
Taylor expanded in h around 0 48.6%
*-rgt-identity48.6%
expm1-log1p-u46.9%
expm1-udef35.5%
sqrt-unprod30.9%
Applied egg-rr30.9%
expm1-def39.0%
expm1-log1p40.3%
*-commutative40.3%
Simplified40.3%
frac-times31.9%
sqrt-div35.7%
sqrt-prod48.7%
add-sqr-sqrt48.8%
Applied egg-rr48.8%
sqrt-prod58.9%
Applied egg-rr58.9%
Final simplification49.8%
(FPCore (d h l M D) :precision binary64 (fabs (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
return fabs((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 = abs((d / sqrt((h * l))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.abs((d / Math.sqrt((h * l))));
}
def code(d, h, l, M, D): return math.fabs((d / math.sqrt((h * l))))
function code(d, h, l, M, D) return abs(Float64(d / sqrt(Float64(h * l)))) end
function tmp = code(d, h, l, M, D) tmp = abs((d / sqrt((h * l)))); end
code[d_, h_, l_, M_, D_] := N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{d}{\sqrt{h \cdot \ell}}\right|
\end{array}
Initial program 69.2%
associate-*l*69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
sub-neg69.2%
+-commutative69.2%
*-commutative69.2%
distribute-rgt-neg-in69.2%
fma-def69.2%
Simplified69.3%
Taylor expanded in h around 0 41.2%
*-rgt-identity41.2%
expm1-log1p-u39.8%
expm1-udef29.1%
sqrt-unprod24.5%
Applied egg-rr24.5%
expm1-def32.4%
expm1-log1p33.3%
*-commutative33.3%
Simplified33.3%
*-commutative33.3%
sqrt-prod41.2%
pow1/241.2%
metadata-eval41.2%
pow-pow32.2%
pow1/333.7%
*-rgt-identity33.7%
add-sqr-sqrt33.6%
sqrt-prod29.7%
rem-sqrt-square33.7%
*-rgt-identity33.7%
pow1/332.2%
pow-pow41.2%
metadata-eval41.2%
pow1/241.2%
sqrt-prod33.3%
*-commutative33.3%
frac-times25.5%
sqrt-div30.1%
sqrt-prod25.0%
add-sqr-sqrt43.6%
Applied egg-rr43.6%
Final simplification43.6%
(FPCore (d h l M D) :precision binary64 (if (<= d 5.7e-244) (* d (- (sqrt (/ 1.0 (* h l))))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5.7e-244) {
tmp = d * -sqrt((1.0 / (h * l)));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 5.7d-244) then
tmp = d * -sqrt((1.0d0 / (h * l)))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5.7e-244) {
tmp = d * -Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 5.7e-244: tmp = d * -math.sqrt((1.0 / (h * l))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 5.7e-244) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(h * l))))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 5.7e-244) tmp = d * -sqrt((1.0 / (h * l))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5.7e-244], N[(d * (-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.7 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{h \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 5.70000000000000009e-244Initial program 66.2%
associate-*l*66.2%
metadata-eval66.2%
unpow1/266.2%
metadata-eval66.2%
unpow1/266.2%
sub-neg66.2%
+-commutative66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
fma-def66.2%
Simplified66.3%
Taylor expanded in h around 0 33.7%
*-rgt-identity33.7%
expm1-log1p-u32.6%
expm1-udef22.6%
sqrt-unprod18.0%
Applied egg-rr18.0%
expm1-def25.8%
expm1-log1p26.3%
*-commutative26.3%
Simplified26.3%
Taylor expanded in d around -inf 40.5%
associate-*r*40.5%
neg-mul-140.5%
*-commutative40.5%
Simplified40.5%
if 5.70000000000000009e-244 < d Initial program 72.1%
associate-*l*72.1%
metadata-eval72.1%
unpow1/272.1%
metadata-eval72.1%
unpow1/272.1%
sub-neg72.1%
+-commutative72.1%
*-commutative72.1%
distribute-rgt-neg-in72.1%
fma-def72.1%
Simplified72.3%
Taylor expanded in h around 0 48.6%
*-rgt-identity48.6%
expm1-log1p-u46.9%
expm1-udef35.5%
sqrt-unprod30.9%
Applied egg-rr30.9%
expm1-def39.0%
expm1-log1p40.3%
*-commutative40.3%
Simplified40.3%
frac-times31.9%
sqrt-div35.7%
sqrt-prod48.7%
add-sqr-sqrt48.8%
Applied egg-rr48.8%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (if (<= d 7.5e-244) (* d (- (sqrt (/ (/ 1.0 h) l)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 7.5e-244) {
tmp = d * -sqrt(((1.0 / h) / l));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 7.5d-244) then
tmp = d * -sqrt(((1.0d0 / h) / l))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 7.5e-244) {
tmp = d * -Math.sqrt(((1.0 / h) / l));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 7.5e-244: tmp = d * -math.sqrt(((1.0 / h) / l)) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 7.5e-244) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 7.5e-244) tmp = d * -sqrt(((1.0 / h) / l)); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 7.5e-244], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 7.5 \cdot 10^{-244}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < 7.5000000000000003e-244Initial program 66.2%
associate-*l*66.2%
metadata-eval66.2%
unpow1/266.2%
metadata-eval66.2%
unpow1/266.2%
sub-neg66.2%
+-commutative66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
fma-def66.2%
Simplified66.3%
Taylor expanded in h around 0 33.7%
*-rgt-identity33.7%
expm1-log1p-u32.6%
expm1-udef22.6%
sqrt-unprod18.0%
Applied egg-rr18.0%
expm1-def25.8%
expm1-log1p26.3%
*-commutative26.3%
Simplified26.3%
associate-*l/24.1%
sqrt-div1.0%
Applied egg-rr1.0%
Taylor expanded in d around -inf 40.5%
mul-1-neg40.5%
*-commutative40.5%
distribute-rgt-neg-in40.5%
*-commutative40.5%
associate-/r*40.6%
Simplified40.6%
if 7.5000000000000003e-244 < d Initial program 72.1%
associate-*l*72.1%
metadata-eval72.1%
unpow1/272.1%
metadata-eval72.1%
unpow1/272.1%
sub-neg72.1%
+-commutative72.1%
*-commutative72.1%
distribute-rgt-neg-in72.1%
fma-def72.1%
Simplified72.3%
Taylor expanded in h around 0 48.6%
*-rgt-identity48.6%
expm1-log1p-u46.9%
expm1-udef35.5%
sqrt-unprod30.9%
Applied egg-rr30.9%
expm1-def39.0%
expm1-log1p40.3%
*-commutative40.3%
Simplified40.3%
frac-times31.9%
sqrt-div35.7%
sqrt-prod48.7%
add-sqr-sqrt48.8%
Applied egg-rr48.8%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (if (<= l -2.3e-236) (sqrt (* (/ d h) (/ d l))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.3e-236) {
tmp = sqrt(((d / h) * (d / l)));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.3d-236)) then
tmp = sqrt(((d / h) * (d / l)))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.3e-236) {
tmp = Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.3e-236: tmp = math.sqrt(((d / h) * (d / l))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.3e-236) tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.3e-236) tmp = sqrt(((d / h) * (d / l))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.3e-236], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{-236}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if l < -2.30000000000000006e-236Initial program 66.1%
associate-*l*66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
sub-neg66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
fma-def66.1%
Simplified66.2%
Taylor expanded in h around 0 39.2%
*-rgt-identity39.2%
expm1-log1p-u37.8%
expm1-udef25.8%
sqrt-unprod20.3%
Applied egg-rr20.3%
expm1-def29.7%
expm1-log1p30.3%
*-commutative30.3%
Simplified30.3%
if -2.30000000000000006e-236 < l Initial program 71.3%
associate-*l*71.4%
metadata-eval71.4%
unpow1/271.4%
metadata-eval71.4%
unpow1/271.4%
sub-neg71.4%
+-commutative71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
fma-def71.4%
Simplified71.6%
Taylor expanded in h around 0 42.6%
*-rgt-identity42.6%
expm1-log1p-u41.2%
expm1-udef31.4%
sqrt-unprod27.4%
Applied egg-rr27.4%
expm1-def34.4%
expm1-log1p35.5%
*-commutative35.5%
Simplified35.5%
frac-times28.3%
sqrt-div31.6%
sqrt-prod42.6%
add-sqr-sqrt44.3%
Applied egg-rr44.3%
Final simplification38.5%
(FPCore (d h l M D) :precision binary64 (if (<= l -3.8e-236) (sqrt (/ d (* l (/ h d)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.8e-236) {
tmp = sqrt((d / (l * (h / d))));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.8d-236)) then
tmp = sqrt((d / (l * (h / d))))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.8e-236) {
tmp = Math.sqrt((d / (l * (h / d))));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.8e-236: tmp = math.sqrt((d / (l * (h / d)))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.8e-236) tmp = sqrt(Float64(d / Float64(l * Float64(h / d)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.8e-236) tmp = sqrt((d / (l * (h / d)))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.8e-236], N[Sqrt[N[(d / N[(l * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-236}:\\
\;\;\;\;\sqrt{\frac{d}{\ell \cdot \frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if l < -3.7999999999999999e-236Initial program 66.1%
associate-*l*66.1%
metadata-eval66.1%
unpow1/266.1%
metadata-eval66.1%
unpow1/266.1%
sub-neg66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
fma-def66.1%
Simplified66.2%
Taylor expanded in h around 0 39.2%
*-rgt-identity39.2%
expm1-log1p-u37.8%
expm1-udef25.8%
sqrt-unprod20.3%
Applied egg-rr20.3%
expm1-def29.7%
expm1-log1p30.3%
*-commutative30.3%
Simplified30.3%
*-commutative30.3%
clear-num30.4%
frac-times31.7%
*-un-lft-identity31.7%
Applied egg-rr31.7%
if -3.7999999999999999e-236 < l Initial program 71.3%
associate-*l*71.4%
metadata-eval71.4%
unpow1/271.4%
metadata-eval71.4%
unpow1/271.4%
sub-neg71.4%
+-commutative71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
fma-def71.4%
Simplified71.6%
Taylor expanded in h around 0 42.6%
*-rgt-identity42.6%
expm1-log1p-u41.2%
expm1-udef31.4%
sqrt-unprod27.4%
Applied egg-rr27.4%
expm1-def34.4%
expm1-log1p35.5%
*-commutative35.5%
Simplified35.5%
frac-times28.3%
sqrt-div31.6%
sqrt-prod42.6%
add-sqr-sqrt44.3%
Applied egg-rr44.3%
Final simplification39.1%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((h * l));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 69.2%
associate-*l*69.2%
metadata-eval69.2%
unpow1/269.2%
metadata-eval69.2%
unpow1/269.2%
sub-neg69.2%
+-commutative69.2%
*-commutative69.2%
distribute-rgt-neg-in69.2%
fma-def69.2%
Simplified69.3%
Taylor expanded in h around 0 41.2%
*-rgt-identity41.2%
expm1-log1p-u39.8%
expm1-udef29.1%
sqrt-unprod24.5%
Applied egg-rr24.5%
expm1-def32.4%
expm1-log1p33.3%
*-commutative33.3%
Simplified33.3%
frac-times25.5%
sqrt-div30.1%
sqrt-prod25.0%
add-sqr-sqrt29.3%
Applied egg-rr29.3%
Final simplification29.3%
herbie shell --seed 2023195
(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)))))