
(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 25 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 (pow (* (* M 0.5) (/ D d)) 2.0))
(t_1 (+ 1.0 (/ (* h (* -0.5 t_0)) l)))
(t_2 (sqrt (- d))))
(if (<= h -1.3e-68)
(* (sqrt (/ d h)) (* (/ t_2 (sqrt (- l))) t_1))
(if (<= h -5e-310)
(* (/ t_2 (sqrt (- h))) (* t_1 (sqrt (/ d l))))
(/ (* d (/ (fma t_0 (* -0.5 (/ h l)) 1.0) (sqrt h))) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * 0.5) * (D / d)), 2.0);
double t_1 = 1.0 + ((h * (-0.5 * t_0)) / l);
double t_2 = sqrt(-d);
double tmp;
if (h <= -1.3e-68) {
tmp = sqrt((d / h)) * ((t_2 / sqrt(-l)) * t_1);
} else if (h <= -5e-310) {
tmp = (t_2 / sqrt(-h)) * (t_1 * sqrt((d / l)));
} else {
tmp = (d * (fma(t_0, (-0.5 * (h / l)), 1.0) / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 t_1 = Float64(1.0 + Float64(Float64(h * Float64(-0.5 * t_0)) / l)) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -1.3e-68) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_2 / sqrt(Float64(-l))) * t_1)); elseif (h <= -5e-310) tmp = Float64(Float64(t_2 / sqrt(Float64(-h))) * Float64(t_1 * sqrt(Float64(d / l)))); else tmp = Float64(Float64(d * Float64(fma(t_0, Float64(-0.5 * Float64(h / l)), 1.0) / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(h * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -1.3e-68], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
t_1 := 1 + \frac{h \cdot \left(-0.5 \cdot t_0\right)}{\ell}\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;h \leq -1.3 \cdot 10^{-68}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_2}{\sqrt{-\ell}} \cdot t_1\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(t_1 \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left(t_0, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.2999999999999999e-68Initial program 61.4%
Simplified60.2%
associate-*l/63.8%
*-commutative63.8%
clear-num63.8%
frac-times63.8%
*-un-lft-identity63.8%
*-un-lft-identity63.8%
frac-times63.8%
clear-num63.8%
div-inv63.8%
metadata-eval63.8%
Applied egg-rr63.8%
frac-2neg63.8%
sqrt-div78.5%
Applied egg-rr78.5%
if -1.2999999999999999e-68 < h < -4.999999999999985e-310Initial program 73.1%
Simplified75.0%
associate-*l/79.0%
*-commutative79.0%
clear-num78.9%
frac-times77.1%
*-un-lft-identity77.1%
*-un-lft-identity77.1%
frac-times78.9%
clear-num79.0%
div-inv79.0%
metadata-eval79.0%
Applied egg-rr79.0%
frac-2neg79.0%
sqrt-div90.0%
Applied egg-rr90.0%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
*-commutative87.1%
associate-/r*85.0%
Simplified85.8%
associate-*r/86.7%
associate-*r*86.7%
metadata-eval86.7%
div-inv86.7%
*-commutative86.7%
clear-num86.6%
frac-times86.7%
*-un-lft-identity86.7%
Applied egg-rr86.7%
associate-/l*85.3%
associate-/r/86.6%
fma-def86.6%
associate-*r*86.6%
*-commutative86.6%
fma-def86.6%
associate-/r*86.6%
associate-/l*85.9%
associate-/r*85.9%
times-frac86.6%
*-commutative86.6%
Simplified86.6%
associate-*r/88.0%
div-inv88.0%
metadata-eval88.0%
Applied egg-rr88.0%
Final simplification85.4%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d h))
(*
(/ (sqrt (- d)) (sqrt (- l)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))
(/
(*
d
(/ (fma (pow (* (* M 0.5) (/ D d)) 2.0) (* -0.5 (/ h l)) 1.0) (sqrt h)))
(sqrt l))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = (d * (fma(pow(((M * 0.5) * (D / d)), 2.0), (-0.5 * (h / l)), 1.0) / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); else tmp = Float64(Float64(d * Float64(fma((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0) / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 65.8%
Simplified65.9%
frac-2neg69.6%
sqrt-div79.5%
Applied egg-rr72.8%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
*-commutative87.1%
associate-/r*85.0%
Simplified85.8%
associate-*r/86.7%
associate-*r*86.7%
metadata-eval86.7%
div-inv86.7%
*-commutative86.7%
clear-num86.6%
frac-times86.7%
*-un-lft-identity86.7%
Applied egg-rr86.7%
associate-/l*85.3%
associate-/r/86.6%
fma-def86.6%
associate-*r*86.6%
*-commutative86.6%
fma-def86.6%
associate-/r*86.6%
associate-/l*85.9%
associate-/r*85.9%
times-frac86.6%
*-commutative86.6%
Simplified86.6%
associate-*r/88.0%
div-inv88.0%
metadata-eval88.0%
Applied egg-rr88.0%
Final simplification80.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= h -5e-310)
(*
(sqrt (/ d h))
(* (/ (sqrt (- d)) (sqrt (- l))) (+ 1.0 (/ (* h (* -0.5 t_0)) l))))
(/ (* d (/ (fma t_0 (* -0.5 (/ h l)) 1.0) (sqrt h))) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h * (-0.5 * t_0)) / l)));
} else {
tmp = (d * (fma(t_0, (-0.5 * (h / l)), 1.0) / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * t_0)) / l)))); else tmp = Float64(Float64(d * Float64(fma(t_0, Float64(-0.5 * Float64(h / l)), 1.0) / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot t_0\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left(t_0, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 65.8%
Simplified65.9%
associate-*l/69.6%
*-commutative69.6%
clear-num69.6%
frac-times68.9%
*-un-lft-identity68.9%
*-un-lft-identity68.9%
frac-times69.6%
clear-num69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
frac-2neg69.6%
sqrt-div79.5%
Applied egg-rr79.5%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
*-commutative87.1%
associate-/r*85.0%
Simplified85.8%
associate-*r/86.7%
associate-*r*86.7%
metadata-eval86.7%
div-inv86.7%
*-commutative86.7%
clear-num86.6%
frac-times86.7%
*-un-lft-identity86.7%
Applied egg-rr86.7%
associate-/l*85.3%
associate-/r/86.6%
fma-def86.6%
associate-*r*86.6%
*-commutative86.6%
fma-def86.6%
associate-/r*86.6%
associate-/l*85.9%
associate-/r*85.9%
times-frac86.6%
*-commutative86.6%
Simplified86.6%
associate-*r/88.0%
div-inv88.0%
metadata-eval88.0%
Applied egg-rr88.0%
Final simplification83.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 5.5e-148)
(*
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l))))
(*
(fma (/ h l) (* -0.5 (pow (* D (* 0.5 (/ M d))) 2.0)) 1.0)
(/ (/ d (sqrt l)) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.5e-148) {
tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = fma((h / l), (-0.5 * pow((D * (0.5 * (M / d))), 2.0)), 1.0) * ((d / sqrt(l)) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5.5e-148) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l)))); else tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)), 1.0) * Float64(Float64(d / sqrt(l)) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5.5e-148], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.5 \cdot 10^{-148}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}, 1\right) \cdot \frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < 5.5000000000000003e-148Initial program 66.8%
Simplified66.8%
clear-num66.8%
sqrt-div67.4%
metadata-eval67.4%
Applied egg-rr67.4%
associate-*r/71.1%
frac-times71.1%
*-commutative71.1%
frac-times71.1%
add-sqr-sqrt44.7%
add-sqr-sqrt71.1%
div-inv71.1%
metadata-eval71.1%
Applied egg-rr72.7%
if 5.5000000000000003e-148 < l Initial program 73.6%
Simplified74.5%
Applied egg-rr42.2%
expm1-def63.3%
expm1-log1p88.5%
*-commutative88.5%
associate-/r*87.6%
Simplified87.7%
Final simplification78.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= l 1.05e-209)
(*
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (/ (* h t_0) l))))
(/ (* d (/ (fma t_0 (* -0.5 (/ h l)) 1.0) (sqrt h))) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= 1.05e-209) {
tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * t_0) / l)));
} else {
tmp = (d * (fma(t_0, (-0.5 * (h / l)), 1.0) / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (l <= 1.05e-209) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_0) / l)))); else tmp = Float64(Float64(d * Float64(fma(t_0, Float64(-0.5 * Float64(h / l)), 1.0) / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, 1.05e-209], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq 1.05 \cdot 10^{-209}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\mathsf{fma}\left(t_0, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.04999999999999998e-209Initial program 67.4%
Simplified67.4%
clear-num67.4%
sqrt-div68.0%
metadata-eval68.0%
Applied egg-rr68.0%
associate-*r/70.8%
frac-times70.8%
*-commutative70.8%
frac-times70.8%
add-sqr-sqrt43.8%
add-sqr-sqrt70.8%
div-inv70.8%
metadata-eval70.8%
Applied egg-rr72.5%
if 1.04999999999999998e-209 < l Initial program 72.1%
Simplified72.9%
Applied egg-rr43.9%
expm1-def62.9%
expm1-log1p88.0%
*-commutative88.0%
associate-/r*85.6%
Simplified85.7%
associate-*r/86.6%
associate-*r*86.6%
metadata-eval86.6%
div-inv86.6%
*-commutative86.6%
clear-num86.6%
frac-times86.6%
*-un-lft-identity86.6%
Applied egg-rr86.6%
associate-/l*85.1%
associate-/r/87.5%
fma-def87.4%
associate-*r*87.4%
*-commutative87.4%
fma-def87.5%
associate-/r*87.5%
associate-/l*86.6%
associate-/r*86.6%
times-frac87.4%
*-commutative87.4%
Simplified87.4%
associate-*r/89.0%
div-inv89.0%
metadata-eval89.0%
Applied egg-rr89.0%
Final simplification79.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 3.1e-148)
(*
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (* 2.0 (/ d M))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.1e-148) {
tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((h / l) * (-0.5 * pow((D / (2.0 * (d / M))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.1d-148) then
tmp = (sqrt((d / h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (0.5d0 * ((h * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)) / l)))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / (2.0d0 * (d / m))) ** 2.0d0))))
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.1e-148) {
tmp = (Math.sqrt((d / h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / (2.0 * (d / M))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.1e-148: tmp = (math.sqrt((d / h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / (2.0 * (d / M))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.1e-148) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(2.0 * Float64(d / M))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.1e-148) tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((h / l) * (-0.5 * ((D / (2.0 * (d / M))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.1e-148], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(2.0 * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.1 \cdot 10^{-148}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{2 \cdot \frac{d}{M}}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < 3.1000000000000001e-148Initial program 66.8%
Simplified66.8%
clear-num66.8%
sqrt-div67.4%
metadata-eval67.4%
Applied egg-rr67.4%
associate-*r/71.1%
frac-times71.1%
*-commutative71.1%
frac-times71.1%
add-sqr-sqrt44.7%
add-sqr-sqrt71.1%
div-inv71.1%
metadata-eval71.1%
Applied egg-rr72.7%
if 3.1000000000000001e-148 < l Initial program 73.6%
Simplified74.5%
Applied egg-rr42.2%
expm1-def63.3%
expm1-log1p88.5%
*-commutative88.5%
associate-/r*87.6%
Simplified87.7%
fma-udef87.7%
associate-*r*87.7%
metadata-eval87.7%
div-inv87.7%
*-commutative87.7%
clear-num87.7%
frac-times87.7%
*-un-lft-identity87.7%
Applied egg-rr87.7%
Final simplification78.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.4e-211)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(if (<= l 7.6e+104)
(*
(fma (/ h l) (* -0.5 (pow (* (/ M d) (/ D 2.0)) 2.0)) 1.0)
(/ d (sqrt (* h l))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.4e-211) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else if (l <= 7.6e+104) {
tmp = fma((h / l), (-0.5 * pow(((M / d) * (D / 2.0)), 2.0)), 1.0) * (d / sqrt((h * l)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.4e-211) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); elseif (l <= 7.6e+104) tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0)), 1.0) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.4e-211], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.6e+104], N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.4 \cdot 10^{-211}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{elif}\;\ell \leq 7.6 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.3999999999999998e-211Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -5.3999999999999998e-211 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
Taylor expanded in d around 0 34.1%
unpow1/234.1%
rem-exp-log34.1%
exp-neg34.1%
exp-prod33.9%
distribute-lft-neg-out33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
exp-to-pow33.9%
Simplified33.9%
log1p-expm1-u54.3%
*-commutative54.3%
Applied egg-rr54.3%
if -9.999999999999969e-311 < l < 7.59999999999999938e104Initial program 76.8%
Simplified76.8%
Applied egg-rr42.1%
expm1-def53.4%
expm1-log1p88.6%
*-commutative88.6%
associate-/r*86.6%
Simplified87.8%
expm1-log1p-u51.7%
expm1-udef40.3%
Applied egg-rr40.0%
Simplified84.3%
if 7.59999999999999938e104 < l Initial program 64.8%
Simplified67.2%
Taylor expanded in d around inf 56.3%
*-commutative56.3%
associate-/r*57.6%
Simplified57.6%
Taylor expanded in d around 0 56.3%
unpow1/256.3%
rem-exp-log53.0%
exp-neg53.0%
exp-prod53.0%
distribute-lft-neg-out53.0%
distribute-rgt-neg-in53.0%
metadata-eval53.0%
exp-to-pow56.3%
Simplified56.3%
*-commutative56.3%
unpow-prod-down74.9%
metadata-eval74.9%
sqrt-pow174.9%
inv-pow74.9%
associate-*r*72.5%
sqrt-div72.3%
metadata-eval72.3%
un-div-inv72.4%
metadata-eval72.4%
pow-flip72.4%
pow1/272.4%
div-inv72.5%
Applied egg-rr72.5%
associate-/l/74.9%
Simplified74.9%
Final simplification65.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.2e-210)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(if (<= l 9.5e+104)
(/
d
(/
(sqrt (* h l))
(fma (pow (* 0.5 (* M (/ D d))) 2.0) (* -0.5 (/ h l)) 1.0)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.2e-210) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else if (l <= 9.5e+104) {
tmp = d / (sqrt((h * l)) / fma(pow((0.5 * (M * (D / d))), 2.0), (-0.5 * (h / l)), 1.0));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4.2e-210) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); elseif (l <= 9.5e+104) tmp = Float64(d / Float64(sqrt(Float64(h * l)) / fma((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.2e-210], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.5e+104], N[(d / N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{-210}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+104}:\\
\;\;\;\;\frac{d}{\frac{\sqrt{h \cdot \ell}}{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.20000000000000032e-210Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -4.20000000000000032e-210 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
Taylor expanded in d around 0 34.1%
unpow1/234.1%
rem-exp-log34.1%
exp-neg34.1%
exp-prod33.9%
distribute-lft-neg-out33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
exp-to-pow33.9%
Simplified33.9%
log1p-expm1-u54.3%
*-commutative54.3%
Applied egg-rr54.3%
if -9.999999999999969e-311 < l < 9.5e104Initial program 76.8%
Simplified76.8%
Applied egg-rr42.1%
expm1-def53.4%
expm1-log1p88.6%
*-commutative88.6%
associate-/r*86.6%
Simplified87.8%
associate-*r/88.9%
associate-*r*88.9%
metadata-eval88.9%
div-inv88.9%
*-commutative88.9%
clear-num88.9%
frac-times88.9%
*-un-lft-identity88.9%
Applied egg-rr88.9%
associate-/l*87.7%
associate-/r/87.8%
fma-def87.8%
associate-*r*87.8%
*-commutative87.8%
fma-def87.8%
associate-/r*87.8%
associate-/l*87.7%
associate-/r*87.7%
times-frac87.7%
*-commutative87.7%
Simplified87.7%
expm1-log1p-u51.6%
expm1-udef40.3%
*-commutative40.3%
frac-times42.1%
div-inv42.1%
metadata-eval42.1%
sqrt-prod40.0%
Applied egg-rr40.0%
expm1-def50.3%
expm1-log1p85.4%
associate-/l*85.4%
*-commutative85.4%
associate-*r*85.4%
*-commutative85.4%
*-commutative85.4%
Simplified85.4%
if 9.5e104 < l Initial program 64.8%
Simplified67.2%
Taylor expanded in d around inf 56.3%
*-commutative56.3%
associate-/r*57.6%
Simplified57.6%
Taylor expanded in d around 0 56.3%
unpow1/256.3%
rem-exp-log53.0%
exp-neg53.0%
exp-prod53.0%
distribute-lft-neg-out53.0%
distribute-rgt-neg-in53.0%
metadata-eval53.0%
exp-to-pow56.3%
Simplified56.3%
*-commutative56.3%
unpow-prod-down74.9%
metadata-eval74.9%
sqrt-pow174.9%
inv-pow74.9%
associate-*r*72.5%
sqrt-div72.3%
metadata-eval72.3%
un-div-inv72.4%
metadata-eval72.4%
pow-flip72.4%
pow1/272.4%
div-inv72.5%
Applied egg-rr72.5%
associate-/l/74.9%
Simplified74.9%
Final simplification66.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.5e-210)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (* 2.0 (/ d M))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.5e-210) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((h / l) * (-0.5 * pow((D / (2.0 * (d / M))), 2.0))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.5e-210) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * Math.log1p(Math.expm1(Math.pow((h * l), -0.5)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / (2.0 * (d / M))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.5e-210: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -1e-310: tmp = d * math.log1p(math.expm1(math.pow((h * l), -0.5))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / (2.0 * (d / M))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.5e-210) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(2.0 * Float64(d / M))) ^ 2.0))))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.5e-210], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(2.0 * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.5 \cdot 10^{-210}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{2 \cdot \frac{d}{M}}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -2.5000000000000001e-210Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -2.5000000000000001e-210 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
Taylor expanded in d around 0 34.1%
unpow1/234.1%
rem-exp-log34.1%
exp-neg34.1%
exp-prod33.9%
distribute-lft-neg-out33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
exp-to-pow33.9%
Simplified33.9%
log1p-expm1-u54.3%
*-commutative54.3%
Applied egg-rr54.3%
if -9.999999999999969e-311 < l Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
*-commutative87.1%
associate-/r*85.0%
Simplified85.8%
fma-udef85.8%
associate-*r*85.8%
metadata-eval85.8%
div-inv85.8%
*-commutative85.8%
clear-num85.8%
frac-times85.8%
*-un-lft-identity85.8%
Applied egg-rr85.8%
Final simplification68.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.9e-210)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.9e-210) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.9e-210) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * Math.log1p(Math.expm1(Math.pow((h * l), -0.5)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.9e-210: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -1e-310: tmp = d * math.log1p(math.expm1(math.pow((h * l), -0.5))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.9e-210) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.9e-210], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{-210}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if l < -2.90000000000000006e-210Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -2.90000000000000006e-210 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
Taylor expanded in d around 0 34.1%
unpow1/234.1%
rem-exp-log34.1%
exp-neg34.1%
exp-prod33.9%
distribute-lft-neg-out33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
exp-to-pow33.9%
Simplified33.9%
log1p-expm1-u54.3%
*-commutative54.3%
Applied egg-rr54.3%
if -9.999999999999969e-311 < l Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
associate-/r*85.0%
associate-*r*85.0%
associate-*r/85.0%
associate-*l*85.0%
*-commutative85.0%
associate-*l/85.8%
*-commutative85.8%
associate-*l*85.8%
Simplified85.8%
Final simplification68.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (* 0.5 (/ M d))) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-5d-310)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0))))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -5e-310) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0))))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * ((D * (0.5 * (M / d))) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 65.8%
Simplified65.9%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
associate-/r*85.0%
associate-*r*85.0%
associate-*r/85.0%
associate-*l*85.0%
*-commutative85.0%
associate-*l/85.8%
*-commutative85.8%
associate-*l*85.8%
Simplified85.8%
Final simplification75.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (/ (* d 2.0) M)) 2.0))))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (* 0.5 (/ M d))) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-5d-310)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / ((d * 2.0d0) / m)) ** 2.0d0)))))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / ((d * 2.0) / M)), 2.0))))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(Float64(d * 2.0) / M)) ^ 2.0)))))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -5e-310) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * ((D / ((d * 2.0) / M)) ^ 2.0))))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * ((D * (0.5 * (M / d))) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(N[(d * 2.0), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{\frac{d \cdot 2}{M}}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 65.8%
Simplified65.9%
clear-num65.8%
frac-times65.1%
*-un-lft-identity65.1%
associate-*l/65.1%
*-commutative65.1%
Applied egg-rr65.1%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
associate-/r*85.0%
associate-*r*85.0%
associate-*r/85.0%
associate-*l*85.0%
*-commutative85.0%
associate-*l/85.8%
*-commutative85.8%
associate-*l*85.8%
Simplified85.8%
Final simplification75.2%
(FPCore (d h l M D)
:precision binary64
(if (<= h -5e-310)
(*
(sqrt (/ d h))
(*
(+ 1.0 (/ (* h (* -0.5 (pow (* (* M 0.5) (/ D d)) 2.0))) l))
(sqrt (/ d l))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (* 0.5 (/ M d))) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = sqrt((d / h)) * ((1.0 + ((h * (-0.5 * pow(((M * 0.5) * (D / d)), 2.0))) / l)) * sqrt((d / l)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-5d-310)) then
tmp = sqrt((d / h)) * ((1.0d0 + ((h * ((-0.5d0) * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))) / l)) * sqrt((d / l)))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -5e-310) {
tmp = Math.sqrt((d / h)) * ((1.0 + ((h * (-0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) * Math.sqrt((d / l)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -5e-310: tmp = math.sqrt((d / h)) * ((1.0 + ((h * (-0.5 * math.pow(((M * 0.5) * (D / d)), 2.0))) / l)) * math.sqrt((d / l))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))) / l)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -5e-310) tmp = sqrt((d / h)) * ((1.0 + ((h * (-0.5 * (((M * 0.5) * (D / d)) ^ 2.0))) / l)) * sqrt((d / l))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * ((D * (0.5 * (M / d))) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 65.8%
Simplified65.9%
associate-*l/69.6%
*-commutative69.6%
clear-num69.6%
frac-times68.9%
*-un-lft-identity68.9%
*-un-lft-identity68.9%
frac-times69.6%
clear-num69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
if -4.999999999999985e-310 < h Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
associate-/r*85.0%
associate-*r*85.0%
associate-*r/85.0%
associate-*l*85.0%
*-commutative85.0%
associate-*l/85.8%
*-commutative85.8%
associate-*l*85.8%
Simplified85.8%
Final simplification77.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l 1.16e-307)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l)))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(+ 1.0 (* (* -0.5 (/ h l)) (pow (* D (* 0.5 (/ M d))) 2.0))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.16e-307) {
tmp = (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.16d-307) then
tmp = (1.0d0 - (0.5d0 * ((h * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)) / l))) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 + (((-0.5d0) * (h / l)) * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.16e-307) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * Math.pow((D * (0.5 * (M / d))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.16e-307: tmp = (1.0 - (0.5 * ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * math.pow((D * (0.5 * (M / d))), 2.0))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.16e-307) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h / l)) * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.16e-307) tmp = (1.0 - (0.5 * ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l))) * (sqrt((d / h)) * sqrt((d / l))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 + ((-0.5 * (h / l)) * ((D * (0.5 * (M / d))) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.16e-307], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.16 \cdot 10^{-307}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if l < 1.16e-307Initial program 65.8%
Simplified65.9%
associate-*r/69.6%
frac-times69.6%
*-commutative69.6%
frac-times70.3%
add-sqr-sqrt41.9%
add-sqr-sqrt70.3%
div-inv70.3%
metadata-eval70.3%
Applied egg-rr70.3%
if 1.16e-307 < l Initial program 73.1%
Simplified73.9%
Applied egg-rr42.7%
expm1-def59.4%
expm1-log1p87.1%
associate-/r*85.0%
associate-*r*85.0%
associate-*r/85.0%
associate-*l*85.0%
*-commutative85.0%
associate-*l/85.8%
*-commutative85.8%
associate-*l*85.8%
Simplified85.8%
Final simplification77.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-211)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (log1p (expm1 (pow (* h l) -0.5))))
(* d (/ (pow l -0.5) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-211) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * log1p(expm1(pow((h * l), -0.5)));
} 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 <= -6e-211) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * Math.log1p(Math.expm1(Math.pow((h * l), -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 l <= -6e-211: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -1e-310: tmp = d * math.log1p(math.expm1(math.pow((h * l), -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 (l <= -6e-211) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * log1p(expm1((Float64(h * l) ^ -0.5)))); else tmp = Float64(d * Float64((l ^ -0.5) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-211], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Log[1 + N[(Exp[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]] - 1), $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 -6 \cdot 10^{-211}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6.00000000000000009e-211Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -6.00000000000000009e-211 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
Taylor expanded in d around 0 34.1%
unpow1/234.1%
rem-exp-log34.1%
exp-neg34.1%
exp-prod33.9%
distribute-lft-neg-out33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
exp-to-pow33.9%
Simplified33.9%
log1p-expm1-u54.3%
*-commutative54.3%
Applied egg-rr54.3%
if -9.999999999999969e-311 < l Initial program 73.1%
Simplified73.9%
Taylor expanded in d around inf 54.2%
*-commutative54.2%
associate-/r*55.0%
Simplified55.0%
expm1-log1p-u53.5%
expm1-udef30.9%
sqrt-div32.3%
inv-pow32.3%
sqrt-pow132.3%
metadata-eval32.3%
Applied egg-rr32.3%
expm1-def60.5%
expm1-log1p62.1%
Simplified62.1%
Final simplification56.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4.6e-210)
(sqrt (/ (pow d 2.0) (* h l)))
(if (<= l -1e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(* d (/ (pow l -0.5) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4.6e-210) {
tmp = sqrt((pow(d, 2.0) / (h * l)));
} else if (l <= -1e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} 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 (l <= (-4.6d-210)) then
tmp = sqrt(((d ** 2.0d0) / (h * l)))
else if (l <= (-1d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
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 (l <= -4.6e-210) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (h * l)));
} else if (l <= -1e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4.6e-210: tmp = math.sqrt((math.pow(d, 2.0) / (h * l))) elif l <= -1e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) 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 <= -4.6e-210) tmp = sqrt(Float64((d ^ 2.0) / Float64(h * l))); elseif (l <= -1e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); 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 (l <= -4.6e-210) tmp = sqrt(((d ^ 2.0) / (h * l))); elseif (l <= -1e-310) tmp = d * (((h * l) ^ 2.0) ^ -0.25); else tmp = d * ((l ^ -0.5) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.6e-210], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $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 -4.6 \cdot 10^{-210}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -4.6e-210Initial program 66.0%
Simplified66.1%
Taylor expanded in d around inf 7.9%
*-commutative7.9%
associate-/r*7.9%
Simplified7.9%
Taylor expanded in d around 0 7.9%
unpow1/27.9%
rem-exp-log7.9%
exp-neg7.9%
exp-prod7.9%
distribute-lft-neg-out7.9%
distribute-rgt-neg-in7.9%
metadata-eval7.9%
exp-to-pow7.9%
Simplified7.9%
*-commutative7.9%
unpow-prod-down0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
*-commutative0.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
unpow-prod-down0.0%
*-commutative0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
*-commutative0.0%
Applied egg-rr32.4%
associate-*l/32.4%
*-lft-identity32.4%
*-commutative32.4%
Simplified32.4%
if -4.6e-210 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
pow1/234.1%
div-inv34.1%
unpow-prod-down0.0%
pow1/20.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
Applied egg-rr0.0%
unpow1/20.0%
Simplified0.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
unpow-prod-down33.9%
*-commutative33.9%
sqr-pow33.9%
pow-prod-down40.9%
pow240.9%
*-commutative40.9%
metadata-eval40.9%
Applied egg-rr40.9%
if -9.999999999999969e-311 < l Initial program 73.1%
Simplified73.9%
Taylor expanded in d around inf 54.2%
*-commutative54.2%
associate-/r*55.0%
Simplified55.0%
expm1-log1p-u53.5%
expm1-udef30.9%
sqrt-div32.3%
inv-pow32.3%
sqrt-pow132.3%
metadata-eval32.3%
Applied egg-rr32.3%
expm1-def60.5%
expm1-log1p62.1%
Simplified62.1%
Final simplification47.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-210)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l -1e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(* d (/ (pow l -0.5) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-210) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} 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 (l <= (-2d-210)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= (-1d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
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 (l <= -2e-210) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= -1e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else {
tmp = d * (Math.pow(l, -0.5) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-210: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= -1e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) 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 <= -2e-210) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= -1e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); 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 (l <= -2e-210) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= -1e-310) tmp = d * (((h * l) ^ 2.0) ^ -0.25); else tmp = d * ((l ^ -0.5) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-210], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $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 -2 \cdot 10^{-210}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2.0000000000000001e-210Initial program 66.0%
Simplified65.1%
Taylor expanded in h around 0 50.3%
if -2.0000000000000001e-210 < l < -9.999999999999969e-311Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 34.1%
*-commutative34.1%
associate-/r*34.1%
Simplified34.1%
pow1/234.1%
div-inv34.1%
unpow-prod-down0.0%
pow1/20.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
Applied egg-rr0.0%
unpow1/20.0%
Simplified0.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
unpow-prod-down33.9%
*-commutative33.9%
sqr-pow33.9%
pow-prod-down40.9%
pow240.9%
*-commutative40.9%
metadata-eval40.9%
Applied egg-rr40.9%
if -9.999999999999969e-311 < l Initial program 73.1%
Simplified73.9%
Taylor expanded in d around inf 54.2%
*-commutative54.2%
associate-/r*55.0%
Simplified55.0%
expm1-log1p-u53.5%
expm1-udef30.9%
sqrt-div32.3%
inv-pow32.3%
sqrt-pow132.3%
metadata-eval32.3%
Applied egg-rr32.3%
expm1-def60.5%
expm1-log1p62.1%
Simplified62.1%
Final simplification55.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -9e-246)
(sqrt (/ (pow d 2.0) (* h l)))
(if (<= l 2.6e-148)
(* d (sqrt (+ (+ 1.0 (/ (/ 1.0 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 <= -9e-246) {
tmp = sqrt((pow(d, 2.0) / (h * l)));
} else if (l <= 2.6e-148) {
tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.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) :: tmp
if (l <= (-9d-246)) then
tmp = sqrt(((d ** 2.0d0) / (h * l)))
else if (l <= 2.6d-148) then
tmp = d * sqrt(((1.0d0 + ((1.0d0 / l) / h)) + (-1.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 tmp;
if (l <= -9e-246) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (h * l)));
} else if (l <= 2.6e-148) {
tmp = d * Math.sqrt(((1.0 + ((1.0 / 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 <= -9e-246: tmp = math.sqrt((math.pow(d, 2.0) / (h * l))) elif l <= 2.6e-148: tmp = d * math.sqrt(((1.0 + ((1.0 / 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 <= -9e-246) tmp = sqrt(Float64((d ^ 2.0) / Float64(h * l))); elseif (l <= 2.6e-148) tmp = Float64(d * sqrt(Float64(Float64(1.0 + Float64(Float64(1.0 / l) / h)) + -1.0))); 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 (l <= -9e-246) tmp = sqrt(((d ^ 2.0) / (h * l))); elseif (l <= 2.6e-148) tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.0)); else tmp = d * ((l ^ -0.5) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-246], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.6e-148], N[(d * N[Sqrt[N[(N[(1.0 + N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]), $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}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-148}:\\
\;\;\;\;d \cdot \sqrt{\left(1 + \frac{\frac{1}{\ell}}{h}\right) + -1}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -8.99999999999999998e-246Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 8.3%
*-commutative8.3%
associate-/r*8.3%
Simplified8.3%
Taylor expanded in d around 0 8.3%
unpow1/28.3%
rem-exp-log8.3%
exp-neg8.3%
exp-prod8.3%
distribute-lft-neg-out8.3%
distribute-rgt-neg-in8.3%
metadata-eval8.3%
exp-to-pow8.3%
Simplified8.3%
*-commutative8.3%
unpow-prod-down0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
*-commutative0.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
unpow-prod-down0.0%
*-commutative0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
*-commutative0.0%
Applied egg-rr32.0%
associate-*l/32.0%
*-lft-identity32.0%
*-commutative32.0%
Simplified32.0%
if -8.99999999999999998e-246 < l < 2.60000000000000008e-148Initial program 69.1%
Simplified69.1%
Taylor expanded in d around inf 49.6%
*-commutative49.6%
associate-/r*49.6%
Simplified49.6%
expm1-log1p-u48.9%
expm1-udef49.0%
associate-/l/49.0%
Applied egg-rr49.0%
Taylor expanded in h around inf 49.6%
*-commutative49.6%
associate-/r*49.6%
Simplified49.6%
if 2.60000000000000008e-148 < l Initial program 73.6%
Simplified74.5%
Taylor expanded in d around inf 55.2%
*-commutative55.2%
associate-/r*56.2%
Simplified56.2%
expm1-log1p-u54.7%
expm1-udef26.1%
sqrt-div27.9%
inv-pow27.9%
sqrt-pow127.9%
metadata-eval27.9%
Applied egg-rr27.9%
expm1-def63.6%
expm1-log1p65.2%
Simplified65.2%
Final simplification47.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.75e-246)
(sqrt (/ (pow d 2.0) (* h l)))
(if (<= l 2.2e-134)
(* d (sqrt (+ (+ 1.0 (/ (/ 1.0 l) h)) -1.0)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.75e-246) {
tmp = sqrt((pow(d, 2.0) / (h * l)));
} else if (l <= 2.2e-134) {
tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.0));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.75d-246)) then
tmp = sqrt(((d ** 2.0d0) / (h * l)))
else if (l <= 2.2d-134) then
tmp = d * sqrt(((1.0d0 + ((1.0d0 / l) / h)) + (-1.0d0)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.75e-246) {
tmp = Math.sqrt((Math.pow(d, 2.0) / (h * l)));
} else if (l <= 2.2e-134) {
tmp = d * Math.sqrt(((1.0 + ((1.0 / l) / h)) + -1.0));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.75e-246: tmp = math.sqrt((math.pow(d, 2.0) / (h * l))) elif l <= 2.2e-134: tmp = d * math.sqrt(((1.0 + ((1.0 / l) / h)) + -1.0)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.75e-246) tmp = sqrt(Float64((d ^ 2.0) / Float64(h * l))); elseif (l <= 2.2e-134) tmp = Float64(d * sqrt(Float64(Float64(1.0 + Float64(Float64(1.0 / l) / h)) + -1.0))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.75e-246) tmp = sqrt(((d ^ 2.0) / (h * l))); elseif (l <= 2.2e-134) tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.0)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.75e-246], N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.2e-134], N[(d * N[Sqrt[N[(N[(1.0 + N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.75 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{\frac{{d}^{2}}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-134}:\\
\;\;\;\;d \cdot \sqrt{\left(1 + \frac{\frac{1}{\ell}}{h}\right) + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.75000000000000025e-246Initial program 65.9%
Simplified65.9%
Taylor expanded in d around inf 8.3%
*-commutative8.3%
associate-/r*8.3%
Simplified8.3%
Taylor expanded in d around 0 8.3%
unpow1/28.3%
rem-exp-log8.3%
exp-neg8.3%
exp-prod8.3%
distribute-lft-neg-out8.3%
distribute-rgt-neg-in8.3%
metadata-eval8.3%
exp-to-pow8.3%
Simplified8.3%
*-commutative8.3%
unpow-prod-down0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
*-commutative0.0%
inv-pow0.0%
sqrt-pow10.0%
metadata-eval0.0%
unpow-prod-down0.0%
*-commutative0.0%
metadata-eval0.0%
sqrt-pow10.0%
inv-pow0.0%
*-commutative0.0%
Applied egg-rr32.0%
associate-*l/32.0%
*-lft-identity32.0%
*-commutative32.0%
Simplified32.0%
if -3.75000000000000025e-246 < l < 2.2e-134Initial program 69.7%
Simplified69.7%
Taylor expanded in d around inf 51.7%
*-commutative51.7%
associate-/r*51.7%
Simplified51.7%
expm1-log1p-u50.7%
expm1-udef50.7%
associate-/l/50.7%
Applied egg-rr50.7%
Taylor expanded in h around inf 51.8%
*-commutative51.8%
associate-/r*51.8%
Simplified51.8%
if 2.2e-134 < l Initial program 73.4%
Simplified74.4%
Taylor expanded in d around inf 54.4%
*-commutative54.4%
associate-/r*55.5%
Simplified55.5%
Taylor expanded in d around 0 54.4%
unpow1/254.4%
rem-exp-log50.9%
exp-neg50.9%
exp-prod50.9%
distribute-lft-neg-out50.9%
distribute-rgt-neg-in50.9%
metadata-eval50.9%
exp-to-pow54.4%
Simplified54.4%
*-commutative54.4%
unpow-prod-down64.7%
metadata-eval64.7%
sqrt-pow164.7%
inv-pow64.7%
associate-*r*63.8%
sqrt-div63.8%
metadata-eval63.8%
un-div-inv63.8%
metadata-eval63.8%
pow-flip63.8%
pow1/263.8%
div-inv63.8%
Applied egg-rr63.8%
associate-/l/64.8%
Simplified64.8%
Final simplification47.8%
(FPCore (d h l M D) :precision binary64 (if (<= h 1.25e-264) (* d (sqrt (+ (+ 1.0 (/ (/ 1.0 l) h)) -1.0))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.25e-264) {
tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.0));
} 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 (h <= 1.25d-264) then
tmp = d * sqrt(((1.0d0 + ((1.0d0 / l) / h)) + (-1.0d0)))
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 (h <= 1.25e-264) {
tmp = d * Math.sqrt(((1.0 + ((1.0 / l) / h)) + -1.0));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 1.25e-264: tmp = d * math.sqrt(((1.0 + ((1.0 / l) / h)) + -1.0)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 1.25e-264) tmp = Float64(d * sqrt(Float64(Float64(1.0 + Float64(Float64(1.0 / l) / h)) + -1.0))); 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 (h <= 1.25e-264) tmp = d * sqrt(((1.0 + ((1.0 / l) / h)) + -1.0)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.25e-264], N[(d * N[Sqrt[N[(N[(1.0 + N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.25 \cdot 10^{-264}:\\
\;\;\;\;d \cdot \sqrt{\left(1 + \frac{\frac{1}{\ell}}{h}\right) + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if h < 1.25e-264Initial program 65.5%
Simplified65.6%
Taylor expanded in d around inf 16.5%
*-commutative16.5%
associate-/r*16.5%
Simplified16.5%
expm1-log1p-u16.3%
expm1-udef16.4%
associate-/l/16.4%
Applied egg-rr16.4%
Taylor expanded in h around inf 16.6%
*-commutative16.6%
associate-/r*16.6%
Simplified16.6%
if 1.25e-264 < h Initial program 73.9%
Simplified74.7%
Taylor expanded in d around inf 53.1%
*-commutative53.1%
associate-/r*54.0%
Simplified54.0%
Taylor expanded in d around 0 53.1%
unpow1/253.1%
rem-exp-log50.2%
exp-neg50.2%
exp-prod50.2%
distribute-lft-neg-out50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
exp-to-pow53.1%
Simplified53.1%
*-commutative53.1%
unpow-prod-down61.5%
metadata-eval61.5%
sqrt-pow161.4%
inv-pow61.4%
associate-*r*58.4%
sqrt-div58.4%
metadata-eval58.4%
un-div-inv58.4%
metadata-eval58.4%
pow-flip58.4%
pow1/258.4%
div-inv58.5%
Applied egg-rr58.5%
associate-/l/61.6%
Simplified61.6%
Final simplification37.3%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* h l)))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.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 * sqrt((1.0d0 / (h * l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (h * l)));
}
def code(d, h, l, M, D): return d * math.sqrt((1.0 / (h * l)))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt((1.0 / (h * l))); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{1}{h \cdot \ell}}
\end{array}
Initial program 69.4%
Simplified69.8%
Taylor expanded in d around inf 33.4%
Final simplification33.4%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.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 * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / h) / l)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 69.4%
Simplified69.8%
Taylor expanded in d around inf 33.4%
*-commutative33.4%
associate-/r*33.8%
Simplified33.8%
Taylor expanded in d around 0 33.4%
associate-/r*33.7%
Simplified33.7%
Final simplification33.7%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 l) h))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.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 = d * sqrt(((1.0d0 / l) / h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / l) / h));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / l) / h))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / l) / h)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\end{array}
Initial program 69.4%
Simplified69.8%
Taylor expanded in d around inf 33.4%
*-commutative33.4%
associate-/r*33.8%
Simplified33.8%
Final simplification33.8%
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((h * l), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((h * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(h * l) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((h * l) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 69.4%
Simplified69.8%
Taylor expanded in d around inf 33.4%
*-commutative33.4%
associate-/r*33.8%
Simplified33.8%
Taylor expanded in d around 0 33.4%
unpow1/233.4%
rem-exp-log31.9%
exp-neg31.9%
exp-prod31.9%
distribute-lft-neg-out31.9%
distribute-rgt-neg-in31.9%
metadata-eval31.9%
exp-to-pow33.3%
Simplified33.3%
Final simplification33.3%
(FPCore (d h l M D) :precision binary64 (* d (sqrt 0.0)))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(0.0);
}
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(0.0d0)
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(0.0);
}
def code(d, h, l, M, D): return d * math.sqrt(0.0)
function code(d, h, l, M, D) return Float64(d * sqrt(0.0)) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(0.0); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[0.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{0}
\end{array}
Initial program 69.4%
Simplified69.8%
Taylor expanded in d around inf 33.4%
*-commutative33.4%
associate-/r*33.8%
Simplified33.8%
expm1-log1p-u33.1%
expm1-udef22.1%
associate-/l/22.1%
Applied egg-rr22.1%
Taylor expanded in h around inf 4.5%
Final simplification4.5%
herbie shell --seed 2023318
(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)))))