
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l)))))
(t_1 (* (/ h l) -0.5))
(t_2
(*
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_1 1.0)
(/ (- d) (sqrt (* l h))))))
(if (<= d -2.7e+131)
t_2
(if (<= d -1.3e-116)
t_0
(if (<= d -1.55e-276)
t_2
(if (<= d 1.9e-51)
(/
(* d (/ (fma (pow (* D (/ (* M 0.5) d)) 2.0) t_1 1.0) (sqrt h)))
(sqrt l))
(if (<= d 5e+64)
t_0
(*
(fma (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)));
double t_1 = (h / l) * -0.5;
double t_2 = fma(pow(((M * 0.5) / (d / D)), 2.0), t_1, 1.0) * (-d / sqrt((l * h)));
double tmp;
if (d <= -2.7e+131) {
tmp = t_2;
} else if (d <= -1.3e-116) {
tmp = t_0;
} else if (d <= -1.55e-276) {
tmp = t_2;
} else if (d <= 1.9e-51) {
tmp = (d * (fma(pow((D * ((M * 0.5) / d)), 2.0), t_1, 1.0) / sqrt(h))) / sqrt(l);
} else if (d <= 5e+64) {
tmp = t_0;
} else {
tmp = fma((h / l), (-0.5 * pow((D * (M / (d * 2.0))), 2.0)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)))) t_1 = Float64(Float64(h / l) * -0.5) t_2 = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_1, 1.0) * Float64(Float64(-d) / sqrt(Float64(l * h)))) tmp = 0.0 if (d <= -2.7e+131) tmp = t_2; elseif (d <= -1.3e-116) tmp = t_0; elseif (d <= -1.55e-276) tmp = t_2; elseif (d <= 1.9e-51) tmp = Float64(Float64(d * Float64(fma((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0), t_1, 1.0) / sqrt(h))) / sqrt(l)); elseif (d <= 5e+64) tmp = t_0; else tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.7e+131], t$95$2, If[LessEqual[d, -1.3e-116], t$95$0, If[LessEqual[d, -1.55e-276], t$95$2, If[LessEqual[d, 1.9e-51], N[(N[(d * N[(N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e+64], t$95$0, N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right)\right)\\
t_1 := \frac{h}{\ell} \cdot -0.5\\
t_2 := \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_1, 1\right) \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.7 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq -1.3 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-276}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 1.9 \cdot 10^{-51}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}, t_1, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\mathbf{elif}\;d \leq 5 \cdot 10^{+64}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.70000000000000004e131 or -1.3e-116 < d < -1.54999999999999995e-276Initial program 53.7%
Simplified53.7%
frac-times53.7%
associate-/r*53.7%
Applied egg-rr53.7%
expm1-log1p-u27.7%
expm1-udef17.6%
Applied egg-rr13.4%
expm1-def18.5%
expm1-log1p40.6%
associate-*r*40.6%
*-commutative40.6%
*-commutative40.6%
+-commutative40.6%
fma-def40.6%
*-commutative40.6%
associate-/r/42.1%
*-commutative42.1%
Simplified42.1%
Taylor expanded in d around -inf 72.9%
mul-1-neg72.9%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified72.9%
if -2.70000000000000004e131 < d < -1.3e-116 or 1.90000000000000001e-51 < d < 5e64Initial program 82.1%
Simplified82.1%
associate-*l/92.3%
Applied egg-rr92.3%
if -1.54999999999999995e-276 < d < 1.90000000000000001e-51Initial program 48.0%
Simplified46.0%
Applied egg-rr10.8%
Simplified63.5%
associate-*l/73.9%
associate-/r*73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
if 5e64 < d Initial program 77.0%
Simplified79.0%
Applied egg-rr60.4%
expm1-def66.2%
expm1-log1p91.7%
*-commutative91.7%
Simplified91.7%
Final simplification82.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l)))))
(t_1 (* (/ h l) -0.5))
(t_2
(*
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_1 1.0)
(/ (- d) (sqrt (* l h))))))
(if (<= d -2.7e+132)
t_2
(if (<= d -1.22e-119)
t_0
(if (<= d -1.55e-276)
t_2
(if (<= d 7e-66)
(/
(* d (fma (pow (* D (/ (* M 0.5) d)) 2.0) t_1 1.0))
(pow (* l h) 0.5))
(if (<= d 3e+65)
t_0
(*
(fma (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) 1.0)
(/ d (* (sqrt h) (sqrt l)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)));
double t_1 = (h / l) * -0.5;
double t_2 = fma(pow(((M * 0.5) / (d / D)), 2.0), t_1, 1.0) * (-d / sqrt((l * h)));
double tmp;
if (d <= -2.7e+132) {
tmp = t_2;
} else if (d <= -1.22e-119) {
tmp = t_0;
} else if (d <= -1.55e-276) {
tmp = t_2;
} else if (d <= 7e-66) {
tmp = (d * fma(pow((D * ((M * 0.5) / d)), 2.0), t_1, 1.0)) / pow((l * h), 0.5);
} else if (d <= 3e+65) {
tmp = t_0;
} else {
tmp = fma((h / l), (-0.5 * pow((D * (M / (d * 2.0))), 2.0)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)))) t_1 = Float64(Float64(h / l) * -0.5) t_2 = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_1, 1.0) * Float64(Float64(-d) / sqrt(Float64(l * h)))) tmp = 0.0 if (d <= -2.7e+132) tmp = t_2; elseif (d <= -1.22e-119) tmp = t_0; elseif (d <= -1.55e-276) tmp = t_2; elseif (d <= 7e-66) tmp = Float64(Float64(d * fma((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0), t_1, 1.0)) / (Float64(l * h) ^ 0.5)); elseif (d <= 3e+65) tmp = t_0; else tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.7e+132], t$95$2, If[LessEqual[d, -1.22e-119], t$95$0, If[LessEqual[d, -1.55e-276], t$95$2, If[LessEqual[d, 7e-66], N[(N[(d * N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(l * h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3e+65], t$95$0, N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right)\right)\\
t_1 := \frac{h}{\ell} \cdot -0.5\\
t_2 := \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_1, 1\right) \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.7 \cdot 10^{+132}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq -1.22 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-276}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 7 \cdot 10^{-66}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left({\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}, t_1, 1\right)}{{\left(\ell \cdot h\right)}^{0.5}}\\
\mathbf{elif}\;d \leq 3 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.7e132 or -1.22e-119 < d < -1.54999999999999995e-276Initial program 53.7%
Simplified53.7%
frac-times53.7%
associate-/r*53.7%
Applied egg-rr53.7%
expm1-log1p-u27.7%
expm1-udef17.6%
Applied egg-rr13.4%
expm1-def18.5%
expm1-log1p40.6%
associate-*r*40.6%
*-commutative40.6%
*-commutative40.6%
+-commutative40.6%
fma-def40.6%
*-commutative40.6%
associate-/r/42.1%
*-commutative42.1%
Simplified42.1%
Taylor expanded in d around -inf 72.9%
mul-1-neg72.9%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified72.9%
if -2.7e132 < d < -1.22e-119 or 7.0000000000000001e-66 < d < 3.0000000000000002e65Initial program 82.3%
Simplified82.3%
associate-*l/92.4%
Applied egg-rr92.4%
if -1.54999999999999995e-276 < d < 7.0000000000000001e-66Initial program 46.9%
Simplified44.8%
Applied egg-rr10.8%
Simplified62.7%
frac-times73.2%
associate-/r*73.2%
div-inv73.2%
metadata-eval73.2%
pow1/273.2%
pow1/273.2%
pow-prod-down68.2%
Applied egg-rr68.2%
if 3.0000000000000002e65 < d Initial program 77.0%
Simplified79.0%
Applied egg-rr60.4%
expm1-def66.2%
expm1-log1p91.7%
*-commutative91.7%
Simplified91.7%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (* (/ h l) -0.5)))
(if (<= d -1.32e-79)
(*
(* t_0 (/ (sqrt (- d)) (sqrt (- l))))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))
(if (<= d -1.55e-276)
(*
(* d (- (sqrt (/ (/ 1.0 l) h))))
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_1 1.0))
(if (<= d 9.2e-58)
(/
(* d (/ (fma (pow (* D (/ (* M 0.5) d)) 2.0) t_1 1.0) (sqrt h)))
(sqrt l))
(if (<= d 9.5e+62)
(*
t_0
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l))))
(*
(fma (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0)) 1.0)
(/ d (* (sqrt h) (sqrt l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = (h / l) * -0.5;
double tmp;
if (d <= -1.32e-79) {
tmp = (t_0 * (sqrt(-d) / sqrt(-l))) * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0))));
} else if (d <= -1.55e-276) {
tmp = (d * -sqrt(((1.0 / l) / h))) * fma(pow(((M * 0.5) / (d / D)), 2.0), t_1, 1.0);
} else if (d <= 9.2e-58) {
tmp = (d * (fma(pow((D * ((M * 0.5) / d)), 2.0), t_1, 1.0) / sqrt(h))) / sqrt(l);
} else if (d <= 9.5e+62) {
tmp = t_0 * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)));
} else {
tmp = fma((h / l), (-0.5 * pow((D * (M / (d * 2.0))), 2.0)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (d <= -1.32e-79) tmp = Float64(Float64(t_0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0))))); elseif (d <= -1.55e-276) tmp = Float64(Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))) * fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_1, 1.0)); elseif (d <= 9.2e-58) tmp = Float64(Float64(d * Float64(fma((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0), t_1, 1.0) / sqrt(h))) / sqrt(l)); elseif (d <= 9.5e+62) tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)))); else tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[d, -1.32e-79], N[(N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-276], N[(N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.2e-58], N[(N[(d * N[(N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.5e+62], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;d \leq -1.32 \cdot 10^{-79}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-276}:\\
\;\;\;\;\left(d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right) \cdot \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_1, 1\right)\\
\mathbf{elif}\;d \leq 9.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}, t_1, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\mathbf{elif}\;d \leq 9.5 \cdot 10^{+62}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.32e-79Initial program 77.7%
Simplified77.7%
frac-2neg77.7%
sqrt-div83.2%
Applied egg-rr83.2%
if -1.32e-79 < d < -1.54999999999999995e-276Initial program 49.8%
Simplified49.8%
frac-times49.8%
associate-/r*49.8%
Applied egg-rr49.8%
expm1-log1p-u17.9%
expm1-udef4.7%
Applied egg-rr4.5%
expm1-def10.3%
expm1-log1p37.3%
associate-*r*37.3%
*-commutative37.3%
*-commutative37.3%
+-commutative37.3%
fma-def37.3%
*-commutative37.3%
associate-/r/39.2%
*-commutative39.2%
Simplified39.2%
Taylor expanded in d around -inf 68.6%
mul-1-neg68.6%
distribute-rgt-neg-in68.6%
*-commutative68.6%
associate-/r*68.6%
Simplified68.6%
if -1.54999999999999995e-276 < d < 9.1999999999999995e-58Initial program 48.0%
Simplified46.0%
Applied egg-rr10.8%
Simplified63.5%
associate-*l/73.9%
associate-/r*73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
if 9.1999999999999995e-58 < d < 9.5000000000000003e62Initial program 73.8%
Simplified73.6%
associate-*l/99.1%
Applied egg-rr99.1%
if 9.5000000000000003e62 < d Initial program 77.0%
Simplified79.0%
Applied egg-rr60.4%
expm1-def66.2%
expm1-log1p91.7%
*-commutative91.7%
Simplified91.7%
Final simplification81.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.85e-302)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5)))))
(/
(*
d
(/ (fma (pow (* D (/ (* M 0.5) d)) 2.0) (* (/ h l) -0.5) 1.0) (sqrt h)))
(sqrt l))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.85e-302) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else {
tmp = (d * (fma(pow((D * ((M * 0.5) / d)), 2.0), ((h / l) * -0.5), 1.0) / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.85e-302) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(d * Float64(fma((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0) / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.85e-302], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.85 \cdot 10^{-302}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.85e-302Initial program 66.4%
Simplified66.4%
frac-2neg66.4%
sqrt-div79.8%
Applied egg-rr79.8%
if -1.85e-302 < l Initial program 65.3%
Simplified65.3%
Applied egg-rr32.5%
Simplified77.4%
associate-*l/80.6%
associate-/r*80.6%
div-inv80.6%
metadata-eval80.6%
Applied egg-rr80.6%
Final simplification80.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (/ (* h (* -0.5 (pow (* (/ D d) (* M 0.5)) 2.0))) l)))))
(t_1 (* (/ h l) -0.5))
(t_2 (pow (* D (/ (* M 0.5) d)) 2.0))
(t_3
(*
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_1 1.0)
(/ (- d) (sqrt (* l h))))))
(if (<= d -2.3e+130)
t_3
(if (<= d -2.9e-118)
t_0
(if (<= d -1.55e-276)
t_3
(if (<= d 1.75e-66)
(/ (* d (fma t_2 t_1 1.0)) (pow (* l h) 0.5))
(if (<= d 7.2e+62)
t_0
(* (/ d (sqrt l)) (/ (+ 1.0 (* t_2 t_1)) (sqrt h))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow(((D / d) * (M * 0.5)), 2.0))) / l)));
double t_1 = (h / l) * -0.5;
double t_2 = pow((D * ((M * 0.5) / d)), 2.0);
double t_3 = fma(pow(((M * 0.5) / (d / D)), 2.0), t_1, 1.0) * (-d / sqrt((l * h)));
double tmp;
if (d <= -2.3e+130) {
tmp = t_3;
} else if (d <= -2.9e-118) {
tmp = t_0;
} else if (d <= -1.55e-276) {
tmp = t_3;
} else if (d <= 1.75e-66) {
tmp = (d * fma(t_2, t_1, 1.0)) / pow((l * h), 0.5);
} else if (d <= 7.2e+62) {
tmp = t_0;
} else {
tmp = (d / sqrt(l)) * ((1.0 + (t_2 * t_1)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0))) / l)))) t_1 = Float64(Float64(h / l) * -0.5) t_2 = Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0 t_3 = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_1, 1.0) * Float64(Float64(-d) / sqrt(Float64(l * h)))) tmp = 0.0 if (d <= -2.3e+130) tmp = t_3; elseif (d <= -2.9e-118) tmp = t_0; elseif (d <= -1.55e-276) tmp = t_3; elseif (d <= 1.75e-66) tmp = Float64(Float64(d * fma(t_2, t_1, 1.0)) / (Float64(l * h) ^ 0.5)); elseif (d <= 7.2e+62) tmp = t_0; else tmp = Float64(Float64(d / sqrt(l)) * Float64(Float64(1.0 + Float64(t_2 * t_1)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.3e+130], t$95$3, If[LessEqual[d, -2.9e-118], t$95$0, If[LessEqual[d, -1.55e-276], t$95$3, If[LessEqual[d, 1.75e-66], N[(N[(d * N[(t$95$2 * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(l * h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.2e+62], t$95$0, N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}\right)}{\ell}\right)\right)\\
t_1 := \frac{h}{\ell} \cdot -0.5\\
t_2 := {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}\\
t_3 := \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_1, 1\right) \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{+130}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;d \leq -2.9 \cdot 10^{-118}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-276}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;d \leq 1.75 \cdot 10^{-66}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(t_2, t_1, 1\right)}{{\left(\ell \cdot h\right)}^{0.5}}\\
\mathbf{elif}\;d \leq 7.2 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \frac{1 + t_2 \cdot t_1}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -2.30000000000000021e130 or -2.8999999999999998e-118 < d < -1.54999999999999995e-276Initial program 53.7%
Simplified53.7%
frac-times53.7%
associate-/r*53.7%
Applied egg-rr53.7%
expm1-log1p-u27.7%
expm1-udef17.6%
Applied egg-rr13.4%
expm1-def18.5%
expm1-log1p40.6%
associate-*r*40.6%
*-commutative40.6%
*-commutative40.6%
+-commutative40.6%
fma-def40.6%
*-commutative40.6%
associate-/r/42.1%
*-commutative42.1%
Simplified42.1%
Taylor expanded in d around -inf 72.9%
mul-1-neg72.9%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified72.9%
if -2.30000000000000021e130 < d < -2.8999999999999998e-118 or 1.75e-66 < d < 7.2e62Initial program 82.3%
Simplified82.3%
associate-*l/92.4%
Applied egg-rr92.4%
if -1.54999999999999995e-276 < d < 1.75e-66Initial program 46.9%
Simplified44.8%
Applied egg-rr10.8%
Simplified62.7%
frac-times73.2%
associate-/r*73.2%
div-inv73.2%
metadata-eval73.2%
pow1/273.2%
pow1/273.2%
pow-prod-down68.2%
Applied egg-rr68.2%
if 7.2e62 < d Initial program 77.0%
Simplified79.0%
Applied egg-rr60.4%
Simplified91.7%
fma-udef91.7%
associate-/r*91.7%
div-inv91.7%
metadata-eval91.7%
Applied egg-rr91.7%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= d -4.4e+188)
(fabs (/ d t_0))
(if (<= d -7.6e-221)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) (* (/ h l) -0.5))))
(if (<= d 2.4e-293)
(* d (log (exp (pow (* l h) -0.5))))
(if (<= d 1.7e+127)
(/
d
(/ t_0 (fma (pow (/ 0.5 (/ (/ d D) M)) 2.0) (/ (* h -0.5) l) 1.0)))
(* d (/ (pow l -0.5) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (d <= -4.4e+188) {
tmp = fabs((d / t_0));
} else if (d <= -7.6e-221) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5)));
} else if (d <= 2.4e-293) {
tmp = d * log(exp(pow((l * h), -0.5)));
} else if (d <= 1.7e+127) {
tmp = d / (t_0 / fma(pow((0.5 / ((d / D) / M)), 2.0), ((h * -0.5) / l), 1.0));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (d <= -4.4e+188) tmp = abs(Float64(d / t_0)); elseif (d <= -7.6e-221) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * Float64(Float64(h / l) * -0.5)))); elseif (d <= 2.4e-293) tmp = Float64(d * log(exp((Float64(l * h) ^ -0.5)))); elseif (d <= 1.7e+127) tmp = Float64(d / Float64(t_0 / fma((Float64(0.5 / Float64(Float64(d / D) / M)) ^ 2.0), Float64(Float64(h * -0.5) / l), 1.0))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -4.4e+188], N[Abs[N[(d / t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -7.6e-221], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.4e-293], N[(d * N[Log[N[Exp[N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e+127], N[(d / N[(t$95$0 / N[(N[Power[N[(0.5 / N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;d \leq -4.4 \cdot 10^{+188}:\\
\;\;\;\;\left|\frac{d}{t_0}\right|\\
\mathbf{elif}\;d \leq -7.6 \cdot 10^{-221}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right)\\
\mathbf{elif}\;d \leq 2.4 \cdot 10^{-293}:\\
\;\;\;\;d \cdot \log \left(e^{{\left(\ell \cdot h\right)}^{-0.5}}\right)\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{+127}:\\
\;\;\;\;\frac{d}{\frac{t_0}{\mathsf{fma}\left({\left(\frac{0.5}{\frac{\frac{d}{D}}{M}}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -4.39999999999999998e188Initial program 61.9%
Simplified61.9%
Taylor expanded in d around inf 9.5%
*-commutative9.5%
associate-/r*9.5%
Simplified9.5%
Taylor expanded in d around 0 9.5%
unpow1/29.5%
rem-exp-log9.5%
exp-neg9.5%
exp-prod9.5%
distribute-lft-neg-out9.5%
distribute-rgt-neg-in9.5%
metadata-eval9.5%
exp-to-pow9.5%
Simplified9.5%
add-sqr-sqrt0.4%
sqrt-unprod19.4%
pow219.4%
Applied egg-rr19.4%
unpow219.4%
rem-sqrt-square64.2%
rem-exp-log0.4%
log-prod0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
log-div0.4%
rem-exp-log64.2%
Simplified64.2%
if -4.39999999999999998e188 < d < -7.6000000000000002e-221Initial program 74.7%
Simplified74.7%
frac-times74.7%
associate-/r*74.7%
Applied egg-rr74.7%
expm1-log1p-u35.9%
expm1-udef20.4%
Applied egg-rr17.8%
expm1-def26.9%
expm1-log1p62.5%
associate-*r*62.5%
*-commutative62.5%
*-commutative62.5%
+-commutative62.5%
fma-def62.5%
*-commutative62.5%
associate-/r/63.7%
*-commutative63.7%
Simplified63.7%
fma-udef63.7%
associate-/r/62.5%
*-commutative62.5%
Applied egg-rr62.5%
if -7.6000000000000002e-221 < d < 2.3999999999999999e-293Initial program 29.5%
Simplified29.6%
Taylor expanded in d around inf 12.3%
*-commutative12.3%
associate-/r*12.3%
Simplified12.3%
Taylor expanded in d around 0 12.3%
unpow1/212.3%
rem-exp-log12.3%
exp-neg12.3%
exp-prod12.3%
distribute-lft-neg-out12.3%
distribute-rgt-neg-in12.3%
metadata-eval12.3%
exp-to-pow12.3%
Simplified12.3%
add-log-exp40.7%
Applied egg-rr40.7%
if 2.3999999999999999e-293 < d < 1.69999999999999989e127Initial program 62.0%
Simplified60.7%
Applied egg-rr16.4%
Simplified73.3%
expm1-log1p-u36.9%
expm1-udef16.3%
Applied egg-rr14.4%
expm1-def32.0%
expm1-log1p70.6%
associate-/l*69.5%
unpow1/269.5%
*-commutative69.5%
*-commutative69.5%
associate-/r/69.1%
*-commutative69.1%
associate-/l*69.2%
associate-*l/69.2%
Simplified69.2%
if 1.69999999999999989e127 < d Initial program 74.7%
Simplified77.3%
Taylor expanded in d around inf 61.4%
*-commutative61.4%
associate-/r*62.6%
Simplified62.6%
expm1-log1p-u61.5%
expm1-udef42.5%
sqrt-div44.6%
pow1/244.6%
inv-pow44.6%
pow-pow44.6%
metadata-eval44.6%
Applied egg-rr44.6%
expm1-def82.6%
expm1-log1p83.9%
Simplified83.9%
Final simplification66.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5))
(t_1 (fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_0 1.0)))
(if (<= d -3.8e+133)
(* t_1 (/ (- d) (sqrt (* l h))))
(if (<= d -1.75e-79)
(*
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5))))
(sqrt (/ d h)))
(if (<= d -1.55e-276)
(* (* d (- (sqrt (/ (/ 1.0 l) h)))) t_1)
(*
(/ d (sqrt l))
(/ (+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) t_0)) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double t_1 = fma(pow(((M * 0.5) / (d / D)), 2.0), t_0, 1.0);
double tmp;
if (d <= -3.8e+133) {
tmp = t_1 * (-d / sqrt((l * h)));
} else if (d <= -1.75e-79) {
tmp = (sqrt((d / l)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5)))) * sqrt((d / h));
} else if (d <= -1.55e-276) {
tmp = (d * -sqrt(((1.0 / l) / h))) * t_1;
} else {
tmp = (d / sqrt(l)) * ((1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * t_0)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) t_1 = fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_0, 1.0) tmp = 0.0 if (d <= -3.8e+133) tmp = Float64(t_1 * Float64(Float64(-d) / sqrt(Float64(l * h)))); elseif (d <= -1.75e-79) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5)))) * sqrt(Float64(d / h))); elseif (d <= -1.55e-276) tmp = Float64(Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))) * t_1); else tmp = Float64(Float64(d / sqrt(l)) * Float64(Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * t_0)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[d, -3.8e+133], N[(t$95$1 * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.75e-79], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-276], N[(N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
t_1 := \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_0, 1\right)\\
\mathbf{if}\;d \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;t_1 \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;d \leq -1.75 \cdot 10^{-79}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -1.55 \cdot 10^{-276}:\\
\;\;\;\;\left(d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right) \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \frac{1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot t_0}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -3.8000000000000002e133Initial program 64.7%
Simplified64.7%
frac-times64.7%
associate-/r*64.7%
Applied egg-rr64.7%
expm1-log1p-u39.8%
expm1-udef34.3%
Applied egg-rr24.6%
expm1-def30.1%
expm1-log1p53.7%
associate-*r*53.7%
*-commutative53.7%
*-commutative53.7%
+-commutative53.7%
fma-def53.7%
*-commutative53.7%
associate-/r/54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in d around -inf 80.1%
mul-1-neg80.1%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified80.1%
if -3.8000000000000002e133 < d < -1.75000000000000015e-79Initial program 87.5%
Simplified87.5%
if -1.75000000000000015e-79 < d < -1.54999999999999995e-276Initial program 49.8%
Simplified49.8%
frac-times49.8%
associate-/r*49.8%
Applied egg-rr49.8%
expm1-log1p-u17.9%
expm1-udef4.7%
Applied egg-rr4.5%
expm1-def10.3%
expm1-log1p37.3%
associate-*r*37.3%
*-commutative37.3%
*-commutative37.3%
+-commutative37.3%
fma-def37.3%
*-commutative37.3%
associate-/r/39.2%
*-commutative39.2%
Simplified39.2%
Taylor expanded in d around -inf 68.6%
mul-1-neg68.6%
distribute-rgt-neg-in68.6%
*-commutative68.6%
associate-/r*68.6%
Simplified68.6%
if -1.54999999999999995e-276 < d Initial program 65.3%
Simplified65.3%
Applied egg-rr32.5%
Simplified77.4%
fma-udef77.4%
associate-/r*77.4%
div-inv77.4%
metadata-eval77.4%
Applied egg-rr77.4%
Final simplification77.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= h -1e-309)
(* (fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_0 1.0) (/ (- d) (sqrt (* l h))))
(if (<= h 2.05e+229)
(/
(* d (fma (pow (* D (/ (* M 0.5) d)) 2.0) t_0 1.0))
(pow (* l h) 0.5))
(* d (/ (pow l -0.5) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (h <= -1e-309) {
tmp = fma(pow(((M * 0.5) / (d / D)), 2.0), t_0, 1.0) * (-d / sqrt((l * h)));
} else if (h <= 2.05e+229) {
tmp = (d * fma(pow((D * ((M * 0.5) / d)), 2.0), t_0, 1.0)) / pow((l * h), 0.5);
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (h <= -1e-309) tmp = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_0, 1.0) * Float64(Float64(-d) / sqrt(Float64(l * h)))); elseif (h <= 2.05e+229) tmp = Float64(Float64(d * fma((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0), t_0, 1.0)) / (Float64(l * h) ^ 0.5)); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.05e+229], N[(N[(d * N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(l * h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_0, 1\right) \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;h \leq 2.05 \cdot 10^{+229}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left({\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}, t_0, 1\right)}{{\left(\ell \cdot h\right)}^{0.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 65.9%
Simplified65.9%
frac-times65.9%
associate-/r*65.9%
Applied egg-rr65.9%
expm1-log1p-u33.2%
expm1-udef21.3%
Applied egg-rr17.0%
expm1-def23.9%
expm1-log1p52.7%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
+-commutative52.7%
fma-def52.7%
*-commutative52.7%
associate-/r/53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in d around -inf 70.5%
mul-1-neg70.5%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified70.5%
if -1.000000000000002e-309 < h < 2.0500000000000001e229Initial program 69.2%
Simplified69.2%
Applied egg-rr36.3%
Simplified81.7%
frac-times85.5%
associate-/r*85.5%
div-inv85.5%
metadata-eval85.5%
pow1/285.5%
pow1/285.5%
pow-prod-down78.7%
Applied egg-rr78.7%
if 2.0500000000000001e229 < h Initial program 50.0%
Simplified50.0%
Taylor expanded in d around inf 22.4%
*-commutative22.4%
associate-/r*22.4%
Simplified22.4%
expm1-log1p-u22.4%
expm1-udef3.2%
sqrt-div3.2%
pow1/23.2%
inv-pow3.2%
pow-pow3.2%
metadata-eval3.2%
Applied egg-rr3.2%
expm1-def55.5%
expm1-log1p55.5%
Simplified55.5%
Final simplification72.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= h -1e-309)
(*
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) (* (/ h l) -0.5) 1.0)
(/ (- d) t_0))
(if (<= h 6.5e+222)
(/ d (/ t_0 (fma (pow (/ 0.5 (/ (/ d D) M)) 2.0) (/ (* h -0.5) l) 1.0)))
(* d (/ (pow l -0.5) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (h <= -1e-309) {
tmp = fma(pow(((M * 0.5) / (d / D)), 2.0), ((h / l) * -0.5), 1.0) * (-d / t_0);
} else if (h <= 6.5e+222) {
tmp = d / (t_0 / fma(pow((0.5 / ((d / D) / M)), 2.0), ((h * -0.5) / l), 1.0));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (h <= -1e-309) tmp = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0) * Float64(Float64(-d) / t_0)); elseif (h <= 6.5e+222) tmp = Float64(d / Float64(t_0 / fma((Float64(0.5 / Float64(Float64(d / D) / M)) ^ 2.0), Float64(Float64(h * -0.5) / l), 1.0))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[((-d) / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 6.5e+222], N[(d / N[(t$95$0 / N[(N[Power[N[(0.5 / N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \frac{-d}{t_0}\\
\mathbf{elif}\;h \leq 6.5 \cdot 10^{+222}:\\
\;\;\;\;\frac{d}{\frac{t_0}{\mathsf{fma}\left({\left(\frac{0.5}{\frac{\frac{d}{D}}{M}}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 65.9%
Simplified65.9%
frac-times65.9%
associate-/r*65.9%
Applied egg-rr65.9%
expm1-log1p-u33.2%
expm1-udef21.3%
Applied egg-rr17.0%
expm1-def23.9%
expm1-log1p52.7%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
+-commutative52.7%
fma-def52.7%
*-commutative52.7%
associate-/r/53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in d around -inf 70.5%
mul-1-neg70.5%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified70.5%
if -1.000000000000002e-309 < h < 6.5000000000000006e222Initial program 69.2%
Simplified69.2%
Applied egg-rr36.3%
Simplified81.7%
expm1-log1p-u50.8%
expm1-udef36.3%
Applied egg-rr32.1%
expm1-def46.1%
expm1-log1p78.7%
associate-/l*77.8%
unpow1/277.8%
*-commutative77.8%
*-commutative77.8%
associate-/r/77.4%
*-commutative77.4%
associate-/l*77.5%
associate-*l/77.5%
Simplified77.5%
if 6.5000000000000006e222 < h Initial program 50.0%
Simplified50.0%
Taylor expanded in d around inf 22.4%
*-commutative22.4%
associate-/r*22.4%
Simplified22.4%
expm1-log1p-u22.4%
expm1-udef3.2%
sqrt-div3.2%
pow1/23.2%
inv-pow3.2%
pow-pow3.2%
metadata-eval3.2%
Applied egg-rr3.2%
expm1-def55.5%
expm1-log1p55.5%
Simplified55.5%
Final simplification72.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= h -1e-309)
(*
(* d (- (sqrt (/ (/ 1.0 l) h))))
(fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_0 1.0))
(*
(/ d (sqrt l))
(/ (+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) t_0)) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (h <= -1e-309) {
tmp = (d * -sqrt(((1.0 / l) / h))) * fma(pow(((M * 0.5) / (d / D)), 2.0), t_0, 1.0);
} else {
tmp = (d / sqrt(l)) * ((1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * t_0)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (h <= -1e-309) tmp = Float64(Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))) * fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_0, 1.0)); else tmp = Float64(Float64(d / sqrt(l)) * Float64(Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * t_0)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right) \cdot \mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_0, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \frac{1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot t_0}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 65.9%
Simplified65.9%
frac-times65.9%
associate-/r*65.9%
Applied egg-rr65.9%
expm1-log1p-u33.2%
expm1-udef21.3%
Applied egg-rr17.0%
expm1-def23.9%
expm1-log1p52.7%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
+-commutative52.7%
fma-def52.7%
*-commutative52.7%
associate-/r/53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in d around -inf 70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
*-commutative70.5%
associate-/r*71.2%
Simplified71.2%
if -1.000000000000002e-309 < h Initial program 65.9%
Simplified65.9%
Applied egg-rr32.8%
Simplified78.1%
fma-udef78.1%
associate-/r*78.1%
div-inv78.1%
metadata-eval78.1%
Applied egg-rr78.1%
Final simplification74.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= h -1e-309)
(* (fma (pow (/ (* M 0.5) (/ d D)) 2.0) t_0 1.0) (/ (- d) (sqrt (* l h))))
(*
(/ d (sqrt l))
(/ (+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) t_0)) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (h <= -1e-309) {
tmp = fma(pow(((M * 0.5) / (d / D)), 2.0), t_0, 1.0) * (-d / sqrt((l * h)));
} else {
tmp = (d / sqrt(l)) * ((1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * t_0)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (h <= -1e-309) tmp = Float64(fma((Float64(Float64(M * 0.5) / Float64(d / D)) ^ 2.0), t_0, 1.0) * Float64(Float64(-d) / sqrt(Float64(l * h)))); else tmp = Float64(Float64(d / sqrt(l)) * Float64(Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * t_0)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{M \cdot 0.5}{\frac{d}{D}}\right)}^{2}, t_0, 1\right) \cdot \frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \frac{1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot t_0}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 65.9%
Simplified65.9%
frac-times65.9%
associate-/r*65.9%
Applied egg-rr65.9%
expm1-log1p-u33.2%
expm1-udef21.3%
Applied egg-rr17.0%
expm1-def23.9%
expm1-log1p52.7%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
+-commutative52.7%
fma-def52.7%
*-commutative52.7%
associate-/r/53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in d around -inf 70.5%
mul-1-neg70.5%
rem-exp-log0.0%
unpow1/20.0%
rem-exp-log0.0%
rec-exp0.0%
exp-prod0.0%
distribute-lft-neg-in0.0%
*-commutative0.0%
distribute-lft-neg-in0.0%
metadata-eval0.0%
log-pow0.0%
exp-sum0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
Simplified70.5%
if -1.000000000000002e-309 < h Initial program 65.9%
Simplified65.9%
Applied egg-rr32.8%
Simplified78.1%
fma-udef78.1%
associate-/r*78.1%
div-inv78.1%
metadata-eval78.1%
Applied egg-rr78.1%
Final simplification73.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= d -2.4e+182)
(fabs t_0)
(if (<= d -4e-220)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) (* (/ h l) -0.5))))
(if (<= d 1.05e-281)
(* d (log (exp (pow (* l h) -0.5))))
(if (<= d 1.1e+127)
(* t_0 (+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (/ D 2.0) d)) 2.0)))))
(* d (/ (pow l -0.5) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (d <= -2.4e+182) {
tmp = fabs(t_0);
} else if (d <= -4e-220) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5)));
} else if (d <= 1.05e-281) {
tmp = d * log(exp(pow((l * h), -0.5)));
} else if (d <= 1.1e+127) {
tmp = t_0 * (1.0 + (-0.5 * ((h / l) * pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = d / sqrt((l * h))
if (d <= (-2.4d+182)) then
tmp = abs(t_0)
else if (d <= (-4d-220)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + (((d_1 * ((m * 0.5d0) / d)) ** 2.0d0) * ((h / l) * (-0.5d0))))
else if (d <= 1.05d-281) then
tmp = d * log(exp(((l * h) ** (-0.5d0))))
else if (d <= 1.1d+127) then
tmp = t_0 * (1.0d0 + ((-0.5d0) * ((h / l) * ((m * ((d_1 / 2.0d0) / d)) ** 2.0d0))))
else
tmp = d * ((l ** (-0.5d0)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d / Math.sqrt((l * h));
double tmp;
if (d <= -2.4e+182) {
tmp = Math.abs(t_0);
} else if (d <= -4e-220) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (Math.pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5)));
} else if (d <= 1.05e-281) {
tmp = d * Math.log(Math.exp(Math.pow((l * h), -0.5)));
} else if (d <= 1.1e+127) {
tmp = t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d / math.sqrt((l * h)) tmp = 0 if d <= -2.4e+182: tmp = math.fabs(t_0) elif d <= -4e-220: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (math.pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5))) elif d <= 1.05e-281: tmp = d * math.log(math.exp(math.pow((l * h), -0.5))) elif d <= 1.1e+127: tmp = t_0 * (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D / 2.0) / d)), 2.0)))) else: tmp = d * (math.pow(l, -0.5) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (d <= -2.4e+182) tmp = abs(t_0); elseif (d <= -4e-220) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * Float64(Float64(h / l) * -0.5)))); elseif (d <= 1.05e-281) tmp = Float64(d * log(exp((Float64(l * h) ^ -0.5)))); elseif (d <= 1.1e+127) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D / 2.0) / d)) ^ 2.0))))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d / sqrt((l * h)); tmp = 0.0; if (d <= -2.4e+182) tmp = abs(t_0); elseif (d <= -4e-220) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (((D * ((M * 0.5) / d)) ^ 2.0) * ((h / l) * -0.5))); elseif (d <= 1.05e-281) tmp = d * log(exp(((l * h) ^ -0.5))); elseif (d <= 1.1e+127) tmp = t_0 * (1.0 + (-0.5 * ((h / l) * ((M * ((D / 2.0) / d)) ^ 2.0)))); else tmp = d * ((l ^ -0.5) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.4e+182], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[d, -4e-220], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.05e-281], N[(d * N[Log[N[Exp[N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e+127], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.4 \cdot 10^{+182}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-220}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right)\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{-281}:\\
\;\;\;\;d \cdot \log \left(e^{{\left(\ell \cdot h\right)}^{-0.5}}\right)\\
\mathbf{elif}\;d \leq 1.1 \cdot 10^{+127}:\\
\;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{\frac{D}{2}}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -2.4000000000000001e182Initial program 61.9%
Simplified61.9%
Taylor expanded in d around inf 9.5%
*-commutative9.5%
associate-/r*9.5%
Simplified9.5%
Taylor expanded in d around 0 9.5%
unpow1/29.5%
rem-exp-log9.5%
exp-neg9.5%
exp-prod9.5%
distribute-lft-neg-out9.5%
distribute-rgt-neg-in9.5%
metadata-eval9.5%
exp-to-pow9.5%
Simplified9.5%
add-sqr-sqrt0.4%
sqrt-unprod19.4%
pow219.4%
Applied egg-rr19.4%
unpow219.4%
rem-sqrt-square64.2%
rem-exp-log0.4%
log-prod0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
log-div0.4%
rem-exp-log64.2%
Simplified64.2%
if -2.4000000000000001e182 < d < -3.99999999999999997e-220Initial program 74.7%
Simplified74.7%
frac-times74.7%
associate-/r*74.7%
Applied egg-rr74.7%
expm1-log1p-u35.9%
expm1-udef20.4%
Applied egg-rr17.8%
expm1-def26.9%
expm1-log1p62.5%
associate-*r*62.5%
*-commutative62.5%
*-commutative62.5%
+-commutative62.5%
fma-def62.5%
*-commutative62.5%
associate-/r/63.7%
*-commutative63.7%
Simplified63.7%
fma-udef63.7%
associate-/r/62.5%
*-commutative62.5%
Applied egg-rr62.5%
if -3.99999999999999997e-220 < d < 1.0499999999999999e-281Initial program 26.9%
Simplified27.1%
Taylor expanded in d around inf 11.4%
*-commutative11.4%
associate-/r*11.4%
Simplified11.4%
Taylor expanded in d around 0 11.4%
unpow1/211.4%
rem-exp-log11.4%
exp-neg11.4%
exp-prod11.4%
distribute-lft-neg-out11.4%
distribute-rgt-neg-in11.4%
metadata-eval11.4%
exp-to-pow11.4%
Simplified11.4%
add-log-exp37.4%
Applied egg-rr37.4%
if 1.0499999999999999e-281 < d < 1.1000000000000001e127Initial program 63.6%
Simplified62.3%
clear-num62.3%
frac-times63.5%
*-un-lft-identity63.5%
associate-*l/63.5%
*-un-lft-identity63.5%
times-frac63.5%
metadata-eval63.5%
Applied egg-rr63.5%
expm1-log1p-u32.0%
expm1-udef14.6%
Applied egg-rr14.7%
expm1-def31.6%
expm1-log1p68.6%
associate-/r/67.4%
Simplified67.4%
if 1.1000000000000001e127 < d Initial program 74.7%
Simplified77.3%
Taylor expanded in d around inf 61.4%
*-commutative61.4%
associate-/r*62.6%
Simplified62.6%
expm1-log1p-u61.5%
expm1-udef42.5%
sqrt-div44.6%
pow1/244.6%
inv-pow44.6%
pow-pow44.6%
metadata-eval44.6%
Applied egg-rr44.6%
expm1-def82.6%
expm1-log1p83.9%
Simplified83.9%
Final simplification65.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= d -2.95e+181)
(fabs t_0)
(if (<= d -1.46e-215)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* (pow (* D (/ (* M 0.5) d)) 2.0) (* (/ h l) -0.5))))
(if (<= d 1.05e-281)
(* d (exp (* 0.5 (- (log1p (+ (* l h) -1.0))))))
(if (<= d 2e+127)
(* t_0 (+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (/ D 2.0) d)) 2.0)))))
(* d (/ (pow l -0.5) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (d <= -2.95e+181) {
tmp = fabs(t_0);
} else if (d <= -1.46e-215) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5)));
} else if (d <= 1.05e-281) {
tmp = d * exp((0.5 * -log1p(((l * h) + -1.0))));
} else if (d <= 2e+127) {
tmp = t_0 * (1.0 + (-0.5 * ((h / l) * pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d / Math.sqrt((l * h));
double tmp;
if (d <= -2.95e+181) {
tmp = Math.abs(t_0);
} else if (d <= -1.46e-215) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (Math.pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5)));
} else if (d <= 1.05e-281) {
tmp = d * Math.exp((0.5 * -Math.log1p(((l * h) + -1.0))));
} else if (d <= 2e+127) {
tmp = t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d / math.sqrt((l * h)) tmp = 0 if d <= -2.95e+181: tmp = math.fabs(t_0) elif d <= -1.46e-215: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (math.pow((D * ((M * 0.5) / d)), 2.0) * ((h / l) * -0.5))) elif d <= 1.05e-281: tmp = d * math.exp((0.5 * -math.log1p(((l * h) + -1.0)))) elif d <= 2e+127: tmp = t_0 * (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D / 2.0) / d)), 2.0)))) else: tmp = d * (math.pow(l, -0.5) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (d <= -2.95e+181) tmp = abs(t_0); elseif (d <= -1.46e-215) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64((Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0) * Float64(Float64(h / l) * -0.5)))); elseif (d <= 1.05e-281) tmp = Float64(d * exp(Float64(0.5 * Float64(-log1p(Float64(Float64(l * h) + -1.0)))))); elseif (d <= 2e+127) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D / 2.0) / d)) ^ 2.0))))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.95e+181], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[d, -1.46e-215], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.05e-281], N[(d * N[Exp[N[(0.5 * (-N[Log[1 + N[(N[(l * h), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2e+127], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.95 \cdot 10^{+181}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{elif}\;d \leq -1.46 \cdot 10^{-215}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right)\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{-281}:\\
\;\;\;\;d \cdot e^{0.5 \cdot \left(-\mathsf{log1p}\left(\ell \cdot h + -1\right)\right)}\\
\mathbf{elif}\;d \leq 2 \cdot 10^{+127}:\\
\;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{\frac{D}{2}}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -2.9499999999999999e181Initial program 61.9%
Simplified61.9%
Taylor expanded in d around inf 9.5%
*-commutative9.5%
associate-/r*9.5%
Simplified9.5%
Taylor expanded in d around 0 9.5%
unpow1/29.5%
rem-exp-log9.5%
exp-neg9.5%
exp-prod9.5%
distribute-lft-neg-out9.5%
distribute-rgt-neg-in9.5%
metadata-eval9.5%
exp-to-pow9.5%
Simplified9.5%
add-sqr-sqrt0.4%
sqrt-unprod19.4%
pow219.4%
Applied egg-rr19.4%
unpow219.4%
rem-sqrt-square64.2%
rem-exp-log0.4%
log-prod0.0%
log-pow0.0%
metadata-eval0.0%
distribute-lft-neg-in0.0%
log-pow0.0%
unpow1/20.0%
sub-neg0.0%
log-div0.4%
rem-exp-log64.2%
Simplified64.2%
if -2.9499999999999999e181 < d < -1.4600000000000001e-215Initial program 74.7%
Simplified74.7%
frac-times74.7%
associate-/r*74.7%
Applied egg-rr74.7%
expm1-log1p-u35.9%
expm1-udef20.4%
Applied egg-rr17.8%
expm1-def26.9%
expm1-log1p62.5%
associate-*r*62.5%
*-commutative62.5%
*-commutative62.5%
+-commutative62.5%
fma-def62.5%
*-commutative62.5%
associate-/r/63.7%
*-commutative63.7%
Simplified63.7%
fma-udef63.7%
associate-/r/62.5%
*-commutative62.5%
Applied egg-rr62.5%
if -1.4600000000000001e-215 < d < 1.0499999999999999e-281Initial program 26.9%
Simplified27.1%
Taylor expanded in d around inf 11.4%
*-commutative11.4%
associate-/r*11.4%
Simplified11.4%
pow1/211.4%
pow-to-exp11.4%
associate-/l/11.4%
log-rec11.4%
Applied egg-rr11.4%
log1p-expm1-u33.2%
expm1-udef33.2%
add-exp-log33.2%
Applied egg-rr33.2%
if 1.0499999999999999e-281 < d < 1.99999999999999991e127Initial program 63.6%
Simplified62.3%
clear-num62.3%
frac-times63.5%
*-un-lft-identity63.5%
associate-*l/63.5%
*-un-lft-identity63.5%
times-frac63.5%
metadata-eval63.5%
Applied egg-rr63.5%
expm1-log1p-u32.0%
expm1-udef14.6%
Applied egg-rr14.7%
expm1-def31.6%
expm1-log1p68.6%
associate-/r/67.4%
Simplified67.4%
if 1.99999999999999991e127 < d Initial program 74.7%
Simplified77.3%
Taylor expanded in d around inf 61.4%
*-commutative61.4%
associate-/r*62.6%
Simplified62.6%
expm1-log1p-u61.5%
expm1-udef42.5%
sqrt-div44.6%
pow1/244.6%
inv-pow44.6%
pow-pow44.6%
metadata-eval44.6%
Applied egg-rr44.6%
expm1-def82.6%
expm1-log1p83.9%
Simplified83.9%
Final simplification64.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.42e-71)
(fabs (* d (pow (* l h) -0.5)))
(if (<= l -5e-310)
(* d (exp (* 0.5 (- (log1p (+ (* l h) -1.0))))))
(if (<= l 7.1e+245)
(*
(/ d (sqrt (* l h)))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* M (/ (/ D 2.0) d)) 2.0)))))
(* (/ d (sqrt l)) (sqrt (/ 1.0 h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.42e-71) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * exp((0.5 * -log1p(((l * h) + -1.0))));
} else if (l <= 7.1e+245) {
tmp = (d / sqrt((l * h))) * (1.0 + (-0.5 * ((h / l) * pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = (d / sqrt(l)) * sqrt((1.0 / h));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.42e-71) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * Math.exp((0.5 * -Math.log1p(((l * h) + -1.0))));
} else if (l <= 7.1e+245) {
tmp = (d / Math.sqrt((l * h))) * (1.0 + (-0.5 * ((h / l) * Math.pow((M * ((D / 2.0) / d)), 2.0))));
} else {
tmp = (d / Math.sqrt(l)) * Math.sqrt((1.0 / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.42e-71: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif l <= -5e-310: tmp = d * math.exp((0.5 * -math.log1p(((l * h) + -1.0)))) elif l <= 7.1e+245: tmp = (d / math.sqrt((l * h))) * (1.0 + (-0.5 * ((h / l) * math.pow((M * ((D / 2.0) / d)), 2.0)))) else: tmp = (d / math.sqrt(l)) * math.sqrt((1.0 / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.42e-71) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (l <= -5e-310) tmp = Float64(d * exp(Float64(0.5 * Float64(-log1p(Float64(Float64(l * h) + -1.0)))))); elseif (l <= 7.1e+245) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(M * Float64(Float64(D / 2.0) / d)) ^ 2.0))))); else tmp = Float64(Float64(d / sqrt(l)) * sqrt(Float64(1.0 / h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.42e-71], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Exp[N[(0.5 * (-N[Log[1 + N[(N[(l * h), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.1e+245], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(N[(D / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.42 \cdot 10^{-71}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{0.5 \cdot \left(-\mathsf{log1p}\left(\ell \cdot h + -1\right)\right)}\\
\mathbf{elif}\;\ell \leq 7.1 \cdot 10^{+245}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \frac{\frac{D}{2}}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \sqrt{\frac{1}{h}}\\
\end{array}
\end{array}
if l < -1.4199999999999999e-71Initial program 64.0%
Simplified64.0%
Taylor expanded in d around inf 3.8%
*-commutative3.8%
associate-/r*3.8%
Simplified3.8%
Taylor expanded in d around 0 3.8%
unpow1/23.8%
rem-exp-log3.8%
exp-neg3.8%
exp-prod3.8%
distribute-lft-neg-out3.8%
distribute-rgt-neg-in3.8%
metadata-eval3.8%
exp-to-pow3.8%
Simplified3.8%
add-sqr-sqrt1.9%
sqrt-unprod28.5%
pow228.5%
Applied egg-rr28.5%
unpow228.5%
rem-sqrt-square46.6%
Simplified46.6%
if -1.4199999999999999e-71 < l < -4.999999999999985e-310Initial program 68.8%
Simplified68.7%
Taylor expanded in d around inf 16.5%
*-commutative16.5%
associate-/r*16.5%
Simplified16.5%
pow1/216.5%
pow-to-exp16.5%
associate-/l/16.5%
log-rec16.5%
Applied egg-rr16.5%
log1p-expm1-u44.1%
expm1-udef44.1%
add-exp-log44.1%
Applied egg-rr44.1%
if -4.999999999999985e-310 < l < 7.09999999999999957e245Initial program 66.7%
Simplified65.7%
clear-num65.7%
frac-times66.6%
*-un-lft-identity66.6%
associate-*l/66.6%
*-un-lft-identity66.6%
times-frac66.6%
metadata-eval66.6%
Applied egg-rr66.6%
expm1-log1p-u38.8%
expm1-udef26.9%
Applied egg-rr26.0%
expm1-def36.5%
expm1-log1p69.3%
associate-/r/68.4%
Simplified68.4%
if 7.09999999999999957e245 < l Initial program 60.3%
Simplified66.9%
Applied egg-rr45.3%
Simplified79.5%
Taylor expanded in D around 0 79.9%
Final simplification56.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.7e-71)
(fabs (* d (pow (* l h) -0.5)))
(if (<= l -5e-310)
(* d (exp (* 0.5 (- (log1p (+ (* l h) -1.0))))))
(* d (/ (pow l -0.5) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-71) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * exp((0.5 * -log1p(((l * h) + -1.0))));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.7e-71) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * Math.exp((0.5 * -Math.log1p(((l * h) + -1.0))));
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.7e-71: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif l <= -5e-310: tmp = d * math.exp((0.5 * -math.log1p(((l * h) + -1.0)))) else: tmp = d * (math.pow(l, -0.5) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.7e-71) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (l <= -5e-310) tmp = Float64(d * exp(Float64(0.5 * Float64(-log1p(Float64(Float64(l * h) + -1.0)))))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.7e-71], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Exp[N[(0.5 * (-N[Log[1 + N[(N[(l * h), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-71}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{0.5 \cdot \left(-\mathsf{log1p}\left(\ell \cdot h + -1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -1.70000000000000002e-71Initial program 64.0%
Simplified64.0%
Taylor expanded in d around inf 3.8%
*-commutative3.8%
associate-/r*3.8%
Simplified3.8%
Taylor expanded in d around 0 3.8%
unpow1/23.8%
rem-exp-log3.8%
exp-neg3.8%
exp-prod3.8%
distribute-lft-neg-out3.8%
distribute-rgt-neg-in3.8%
metadata-eval3.8%
exp-to-pow3.8%
Simplified3.8%
add-sqr-sqrt1.9%
sqrt-unprod28.5%
pow228.5%
Applied egg-rr28.5%
unpow228.5%
rem-sqrt-square46.6%
Simplified46.6%
if -1.70000000000000002e-71 < l < -4.999999999999985e-310Initial program 68.8%
Simplified68.7%
Taylor expanded in d around inf 16.5%
*-commutative16.5%
associate-/r*16.5%
Simplified16.5%
pow1/216.5%
pow-to-exp16.5%
associate-/l/16.5%
log-rec16.5%
Applied egg-rr16.5%
log1p-expm1-u44.1%
expm1-udef44.1%
add-exp-log44.1%
Applied egg-rr44.1%
if -4.999999999999985e-310 < l Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 40.4%
*-commutative40.4%
associate-/r*40.8%
Simplified40.8%
expm1-log1p-u39.9%
expm1-udef25.6%
sqrt-div28.4%
pow1/228.4%
inv-pow28.4%
pow-pow28.4%
metadata-eval28.4%
Applied egg-rr28.4%
expm1-def50.3%
expm1-log1p51.5%
Simplified51.5%
Final simplification48.3%
(FPCore (d h l M D) :precision binary64 (if (<= h -1e-309) (fabs (* d (pow (* l h) -0.5))) (* d (/ (pow l -0.5) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = d * (pow(l, -0.5) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-309)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = d * ((l ** (-0.5d0)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1e-309: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = d * (math.pow(l, -0.5) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1e-309) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1e-309) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = d * ((l ^ -0.5) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1e-309], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 8.9%
*-commutative8.9%
associate-/r*8.9%
Simplified8.9%
Taylor expanded in d around 0 8.9%
unpow1/28.9%
rem-exp-log8.9%
exp-neg8.9%
exp-prod8.9%
distribute-lft-neg-out8.9%
distribute-rgt-neg-in8.9%
metadata-eval8.9%
exp-to-pow8.9%
Simplified8.9%
add-sqr-sqrt1.2%
sqrt-unprod24.3%
pow224.3%
Applied egg-rr24.3%
unpow224.3%
rem-sqrt-square37.6%
Simplified37.6%
if -1.000000000000002e-309 < h Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 40.4%
*-commutative40.4%
associate-/r*40.8%
Simplified40.8%
expm1-log1p-u39.9%
expm1-udef25.6%
sqrt-div28.4%
pow1/228.4%
inv-pow28.4%
pow-pow28.4%
metadata-eval28.4%
Applied egg-rr28.4%
expm1-def50.3%
expm1-log1p51.5%
Simplified51.5%
Final simplification44.0%
(FPCore (d h l M D) :precision binary64 (fabs (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
return fabs((d * pow((l * h), -0.5)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = abs((d * ((l * h) ** (-0.5d0))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.abs((d * Math.pow((l * h), -0.5)));
}
def code(d, h, l, M, D): return math.fabs((d * math.pow((l * h), -0.5)))
function code(d, h, l, M, D) return abs(Float64(d * (Float64(l * h) ^ -0.5))) end
function tmp = code(d, h, l, M, D) tmp = abs((d * ((l * h) ^ -0.5))); end
code[d_, h_, l_, M_, D_] := N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|
\end{array}
Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 23.3%
*-commutative23.3%
associate-/r*23.5%
Simplified23.5%
Taylor expanded in d around 0 23.3%
unpow1/223.3%
rem-exp-log22.4%
exp-neg22.4%
exp-prod22.7%
distribute-lft-neg-out22.7%
distribute-rgt-neg-in22.7%
metadata-eval22.7%
exp-to-pow23.6%
Simplified23.6%
add-sqr-sqrt19.4%
sqrt-unprod27.1%
pow227.1%
Applied egg-rr27.1%
unpow227.1%
rem-sqrt-square39.2%
Simplified39.2%
Final simplification39.2%
(FPCore (d h l M D) :precision binary64 (fabs (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
return fabs((d / sqrt((l * h))));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = abs((d / sqrt((l * h))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.abs((d / Math.sqrt((l * h))));
}
def code(d, h, l, M, D): return math.fabs((d / math.sqrt((l * h))))
function code(d, h, l, M, D) return abs(Float64(d / sqrt(Float64(l * h)))) end
function tmp = code(d, h, l, M, D) tmp = abs((d / sqrt((l * h)))); end
code[d_, h_, l_, M_, D_] := N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{d}{\sqrt{\ell \cdot h}}\right|
\end{array}
Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 23.3%
*-commutative23.3%
associate-/r*23.5%
Simplified23.5%
Taylor expanded in d around 0 23.3%
unpow1/223.3%
rem-exp-log22.4%
exp-neg22.4%
exp-prod22.7%
distribute-lft-neg-out22.7%
distribute-rgt-neg-in22.7%
metadata-eval22.7%
exp-to-pow23.6%
Simplified23.6%
add-sqr-sqrt19.4%
sqrt-unprod27.1%
pow227.1%
Applied egg-rr27.1%
unpow227.1%
rem-sqrt-square39.2%
rem-exp-log18.5%
log-prod17.6%
log-pow17.6%
metadata-eval17.6%
distribute-lft-neg-in17.6%
log-pow17.6%
unpow1/217.6%
sub-neg17.6%
log-div18.5%
rem-exp-log39.2%
Simplified39.2%
Final simplification39.2%
(FPCore (d h l M D) :precision binary64 (if (<= d -2.25e-172) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.25e-172) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * pow((l * h), -0.5);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-2.25d-172)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * ((l * h) ** (-0.5d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.25e-172) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.25e-172: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.25e-172) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -2.25e-172) tmp = sqrt(((d / l) * (d / h))); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.25e-172], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.25 \cdot 10^{-172}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if d < -2.25000000000000002e-172Initial program 74.6%
Simplified74.6%
frac-times74.6%
associate-/r*74.6%
Applied egg-rr74.6%
expm1-log1p-u39.7%
expm1-udef27.3%
Applied egg-rr21.7%
expm1-def29.8%
expm1-log1p61.6%
associate-*r*61.6%
*-commutative61.6%
*-commutative61.6%
+-commutative61.6%
fma-def61.6%
*-commutative61.6%
associate-/r/62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in M around 0 32.9%
if -2.25000000000000002e-172 < d Initial program 59.7%
Simplified59.7%
Taylor expanded in d around inf 34.3%
*-commutative34.3%
associate-/r*34.7%
Simplified34.7%
Taylor expanded in d around 0 34.3%
unpow1/234.3%
rem-exp-log32.9%
exp-neg32.9%
exp-prod33.4%
distribute-lft-neg-out33.4%
distribute-rgt-neg-in33.4%
metadata-eval33.4%
exp-to-pow34.9%
Simplified34.9%
Final simplification34.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 23.3%
*-commutative23.3%
associate-/r*23.5%
Simplified23.5%
Taylor expanded in d around 0 23.3%
unpow1/223.3%
rem-exp-log22.4%
exp-neg22.4%
exp-prod22.7%
distribute-lft-neg-out22.7%
distribute-rgt-neg-in22.7%
metadata-eval22.7%
exp-to-pow23.6%
Simplified23.6%
Final simplification23.6%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 65.9%
Simplified65.9%
clear-num65.9%
frac-times65.4%
*-un-lft-identity65.4%
associate-*l/65.5%
*-un-lft-identity65.5%
times-frac65.5%
metadata-eval65.5%
Applied egg-rr65.5%
Taylor expanded in d around inf 23.3%
rem-exp-log17.5%
unpow1/217.5%
rem-exp-log17.4%
rec-exp17.4%
exp-prod17.7%
distribute-lft-neg-in17.7%
*-commutative17.7%
distribute-lft-neg-in17.7%
metadata-eval17.7%
log-pow17.7%
exp-sum17.6%
log-pow17.6%
metadata-eval17.6%
distribute-lft-neg-in17.6%
log-pow17.6%
unpow1/217.6%
sub-neg17.6%
log-div18.5%
Simplified23.6%
Final simplification23.6%
herbie shell --seed 2024018
(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)))))