
(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 16 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 l))))
(if (<= l -1.75e-211)
(*
t_0
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))))
(if (<= l 1e-310)
(*
t_0
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* -0.5 (* 0.25 (pow (/ (* D M) d) 2.0)))) l))))
(*
d
(/
(fma h (* (/ -0.125 l) (pow (* D (/ M d)) 2.0)) 1.0)
(* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -1.75e-211) {
tmp = t_0 * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else if (l <= 1e-310) {
tmp = t_0 * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * pow(((D * M) / d), 2.0)))) / l)));
} else {
tmp = d * (fma(h, ((-0.125 / l) * pow((D * (M / d)), 2.0)), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1.75e-211) tmp = Float64(t_0 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); elseif (l <= 1e-310) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * Float64(0.25 * (Float64(Float64(D * M) / d) ^ 2.0)))) / l)))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.125 / l) * (Float64(D * Float64(M / d)) ^ 2.0)), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.75e-211], N[(t$95$0 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e-310], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[(0.25 * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-211}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(0.25 \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.125}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.75e-211Initial program 64.3%
Simplified64.3%
frac-2neg64.3%
sqrt-div77.1%
Applied egg-rr77.1%
if -1.75e-211 < l < 9.999999999999969e-311Initial program 62.3%
Simplified48.0%
associate-*l/67.1%
Applied egg-rr81.4%
if 9.999999999999969e-311 < l Initial program 70.9%
Applied egg-rr85.8%
Simplified90.1%
Final simplification83.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (/ M d))) (t_1 (sqrt (/ d l))) (t_2 (sqrt (/ d h))))
(if (<= l -5e-33)
(* (- 1.0 (* 0.5 (pow (* 0.5 (* t_0 (sqrt (/ h l)))) 2.0))) (* t_1 t_2))
(if (<= l -5e-310)
(*
t_1
(* t_2 (+ 1.0 (/ (* h (* -0.5 (* 0.25 (pow (/ (* D M) d) 2.0)))) l))))
(*
d
(/
(fma h (* (/ -0.125 l) (pow t_0 2.0)) 1.0)
(* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / d);
double t_1 = sqrt((d / l));
double t_2 = sqrt((d / h));
double tmp;
if (l <= -5e-33) {
tmp = (1.0 - (0.5 * pow((0.5 * (t_0 * sqrt((h / l)))), 2.0))) * (t_1 * t_2);
} else if (l <= -5e-310) {
tmp = t_1 * (t_2 * (1.0 + ((h * (-0.5 * (0.25 * pow(((D * M) / d), 2.0)))) / l)));
} else {
tmp = d * (fma(h, ((-0.125 / l) * pow(t_0, 2.0)), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / d)) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -5e-33) tmp = Float64(Float64(1.0 - Float64(0.5 * (Float64(0.5 * Float64(t_0 * sqrt(Float64(h / l)))) ^ 2.0))) * Float64(t_1 * t_2)); elseif (l <= -5e-310) tmp = Float64(t_1 * Float64(t_2 * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * Float64(0.25 * (Float64(Float64(D * M) / d) ^ 2.0)))) / l)))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.125 / l) * (t_0 ^ 2.0)), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5e-33], N[(N[(1.0 - N[(0.5 * N[Power[N[(0.5 * N[(t$95$0 * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(t$95$1 * N[(t$95$2 * N[(1.0 + N[(N[(h * N[(-0.5 * N[(0.25 * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := D \cdot \frac{M}{d}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-33}:\\
\;\;\;\;\left(1 - 0.5 \cdot {\left(0.5 \cdot \left(t\_0 \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \cdot \left(t\_1 \cdot t\_2\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(0.25 \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.125}{\ell} \cdot {t\_0}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.00000000000000028e-33Initial program 59.9%
Simplified58.7%
add-sqr-sqrt58.7%
pow258.7%
sqrt-prod58.7%
sqrt-pow160.0%
metadata-eval60.0%
pow160.0%
frac-times63.5%
*-un-lft-identity63.5%
times-frac63.5%
metadata-eval63.5%
Applied egg-rr63.5%
associate-*l*63.5%
*-commutative63.5%
associate-/l*63.4%
Simplified63.4%
if -5.00000000000000028e-33 < l < -4.999999999999985e-310Initial program 69.9%
Simplified64.6%
associate-*l/73.8%
Applied egg-rr79.1%
if -4.999999999999985e-310 < l Initial program 70.9%
Applied egg-rr85.8%
Simplified90.1%
Final simplification79.2%
(FPCore (d h l M D)
:precision binary64
(if (<= h 3.6e-272)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* -0.5 (* 0.25 (pow (/ (* D M) d) 2.0)))) l))))
(*
d
(/
(fma h (* (/ -0.125 l) (pow (* D (/ M d)) 2.0)) 1.0)
(* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.6e-272) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * pow(((D * M) / d), 2.0)))) / l)));
} else {
tmp = d * (fma(h, ((-0.125 / l) * pow((D * (M / d)), 2.0)), 1.0) / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (h <= 3.6e-272) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * Float64(0.25 * (Float64(Float64(D * M) / d) ^ 2.0)))) / l)))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.125 / l) * (Float64(D * Float64(M / d)) ^ 2.0)), 1.0) / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 3.6e-272], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[(0.25 * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 3.6 \cdot 10^{-272}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(0.25 \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.125}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if h < 3.59999999999999968e-272Initial program 65.3%
Simplified62.5%
associate-*l/64.1%
Applied egg-rr67.0%
if 3.59999999999999968e-272 < h Initial program 69.7%
Applied egg-rr85.2%
Simplified90.5%
Final simplification77.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= l -4.5e-73)
(* (- d) (pow (* l h) -0.5))
(if (<= l -5e-310)
(log1p (expm1 (* d (/ 1.0 t_0))))
(if (<= l 4.7e+204)
(* (/ d t_0) (fma h (* (/ -0.125 l) (pow (* D (/ M d)) 2.0)) 1.0))
(* (sqrt (/ d l)) (sqrt (/ d h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (l <= -4.5e-73) {
tmp = -d * pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = log1p(expm1((d * (1.0 / t_0))));
} else if (l <= 4.7e+204) {
tmp = (d / t_0) * fma(h, ((-0.125 / l) * pow((D * (M / d)), 2.0)), 1.0);
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (l <= -4.5e-73) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); elseif (l <= -5e-310) tmp = log1p(expm1(Float64(d * Float64(1.0 / t_0)))); elseif (l <= 4.7e+204) tmp = Float64(Float64(d / t_0) * fma(h, Float64(Float64(-0.125 / l) * (Float64(D * Float64(M / d)) ^ 2.0)), 1.0)); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4.5e-73], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[Log[1 + N[(Exp[N[(d * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4.7e+204], N[(N[(d / t$95$0), $MachinePrecision] * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{-73}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(d \cdot \frac{1}{t\_0}\right)\right)\\
\mathbf{elif}\;\ell \leq 4.7 \cdot 10^{+204}:\\
\;\;\;\;\frac{d}{t\_0} \cdot \mathsf{fma}\left(h, \frac{-0.125}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if l < -4.5e-73Initial program 62.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.2%
neg-mul-145.2%
Simplified45.2%
Taylor expanded in h around 0 45.2%
*-commutative45.2%
rem-exp-log42.8%
exp-neg42.8%
unpow1/242.8%
exp-prod42.8%
distribute-lft-neg-out42.8%
distribute-rgt-neg-in42.8%
metadata-eval42.8%
exp-to-pow45.2%
*-commutative45.2%
Simplified45.2%
if -4.5e-73 < l < -4.999999999999985e-310Initial program 67.1%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt22.6%
neg-mul-122.6%
Simplified22.6%
add-sqr-sqrt22.6%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod0.0%
add-sqr-sqrt18.6%
log1p-expm1-u41.5%
add-sqr-sqrt0.0%
sqrt-unprod14.0%
sqr-neg14.0%
sqrt-unprod14.1%
add-sqr-sqrt14.1%
*-commutative14.1%
add-sqr-sqrt14.1%
sqrt-unprod14.0%
sqr-neg14.0%
sqrt-unprod0.0%
add-sqr-sqrt41.5%
associate-/l/41.5%
sqrt-div41.5%
metadata-eval41.5%
Applied egg-rr41.5%
if -4.999999999999985e-310 < l < 4.7000000000000002e204Initial program 72.2%
Applied egg-rr36.9%
Simplified78.2%
expm1-log1p-u37.9%
expm1-undefine37.9%
Applied egg-rr34.5%
sub-neg34.5%
log1p-undefine34.5%
rem-exp-log73.7%
associate-+r+73.7%
metadata-eval73.7%
+-lft-identity73.7%
fma-undefine73.7%
metadata-eval73.7%
associate-+l+83.2%
metadata-eval83.2%
Simplified82.2%
if 4.7000000000000002e204 < l Initial program 63.0%
Simplified63.0%
Taylor expanded in M around 0 57.6%
Final simplification60.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2 (* (/ -0.125 l) (pow (* D (/ M d)) 2.0))))
(if (<= l -2.5e-37)
(* (- d) (pow (* l h) -0.5))
(if (<= l -5e-310)
(* t_0 (* t_1 (* h t_2)))
(if (<= l 1.48e+206)
(* (/ d (sqrt (* l h))) (fma h t_2 1.0))
(* t_1 t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (-0.125 / l) * pow((D * (M / d)), 2.0);
double tmp;
if (l <= -2.5e-37) {
tmp = -d * pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = t_0 * (t_1 * (h * t_2));
} else if (l <= 1.48e+206) {
tmp = (d / sqrt((l * h))) * fma(h, t_2, 1.0);
} else {
tmp = t_1 * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64(-0.125 / l) * (Float64(D * Float64(M / d)) ^ 2.0)) tmp = 0.0 if (l <= -2.5e-37) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); elseif (l <= -5e-310) tmp = Float64(t_0 * Float64(t_1 * Float64(h * t_2))); elseif (l <= 1.48e+206) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(h, t_2, 1.0)); else tmp = Float64(t_1 * t_0); 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.5e-37], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(t$95$0 * N[(t$95$1 * N[(h * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.48e+206], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(h * t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \frac{-0.125}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -2.5 \cdot 10^{-37}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(h \cdot t\_2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.48 \cdot 10^{+206}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(h, t\_2, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if l < -2.4999999999999999e-37Initial program 60.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.8%
neg-mul-145.8%
Simplified45.8%
Taylor expanded in h around 0 45.8%
*-commutative45.8%
rem-exp-log43.4%
exp-neg43.4%
unpow1/243.4%
exp-prod43.4%
distribute-lft-neg-out43.4%
distribute-rgt-neg-in43.4%
metadata-eval43.4%
exp-to-pow45.8%
*-commutative45.8%
Simplified45.8%
if -2.4999999999999999e-37 < l < -4.999999999999985e-310Initial program 69.4%
Simplified67.6%
Taylor expanded in M around inf 31.3%
associate-*r/31.3%
associate-*r*31.3%
associate-*r*31.3%
associate-*l/31.3%
associate-*r/31.3%
*-commutative31.3%
associate-*r/31.3%
*-commutative31.3%
times-frac31.2%
*-commutative31.2%
associate-/l*23.9%
unpow223.9%
unpow223.9%
unpow223.9%
times-frac40.5%
swap-sqr53.4%
associate-/l*53.4%
Simplified51.0%
if -4.999999999999985e-310 < l < 1.47999999999999992e206Initial program 72.2%
Applied egg-rr36.9%
Simplified78.2%
expm1-log1p-u37.9%
expm1-undefine37.9%
Applied egg-rr34.5%
sub-neg34.5%
log1p-undefine34.5%
rem-exp-log73.7%
associate-+r+73.7%
metadata-eval73.7%
+-lft-identity73.7%
fma-undefine73.7%
metadata-eval73.7%
associate-+l+83.2%
metadata-eval83.2%
Simplified82.2%
if 1.47999999999999992e206 < l Initial program 63.0%
Simplified63.0%
Taylor expanded in M around 0 57.6%
Final simplification62.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* D (/ M d)) 2.0)))
(if (<= l -3.5e-42)
(* (- d) (pow (* l h) -0.5))
(if (<= l -5e-310)
(* (sqrt (/ d h)) (* (sqrt (/ d l)) (* h (* (/ -0.125 l) t_0))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* -0.5 (* (/ h l) (* 0.25 t_0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((D * (M / d)), 2.0);
double tmp;
if (l <= -3.5e-42) {
tmp = -d * pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (h * ((-0.125 / l) * t_0)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * t_0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 * (m / d)) ** 2.0d0
if (l <= (-3.5d-42)) then
tmp = -d * ((l * h) ** (-0.5d0))
else if (l <= (-5d-310)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (h * (((-0.125d0) / l) * t_0)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + ((-0.5d0) * ((h / l) * (0.25d0 * t_0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((D * (M / d)), 2.0);
double tmp;
if (l <= -3.5e-42) {
tmp = -d * Math.pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (h * ((-0.125 / l) * t_0)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * t_0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((D * (M / d)), 2.0) tmp = 0 if l <= -3.5e-42: tmp = -d * math.pow((l * h), -0.5) elif l <= -5e-310: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (h * ((-0.125 / l) * t_0))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * t_0)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / d)) ^ 2.0 tmp = 0.0 if (l <= -3.5e-42) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); elseif (l <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(h * Float64(Float64(-0.125 / l) * t_0)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * Float64(0.25 * t_0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (D * (M / d)) ^ 2.0; tmp = 0.0; if (l <= -3.5e-42) tmp = -d * ((l * h) ^ -0.5); elseif (l <= -5e-310) tmp = sqrt((d / h)) * (sqrt((d / l)) * (h * ((-0.125 / l) * t_0))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * t_0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -3.5e-42], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[(0.25 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(D \cdot \frac{M}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -3.5 \cdot 10^{-42}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(h \cdot \left(\frac{-0.125}{\ell} \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if l < -3.5000000000000002e-42Initial program 60.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.8%
neg-mul-145.8%
Simplified45.8%
Taylor expanded in h around 0 45.8%
*-commutative45.8%
rem-exp-log43.4%
exp-neg43.4%
unpow1/243.4%
exp-prod43.4%
distribute-lft-neg-out43.4%
distribute-rgt-neg-in43.4%
metadata-eval43.4%
exp-to-pow45.8%
*-commutative45.8%
Simplified45.8%
if -3.5000000000000002e-42 < l < -4.999999999999985e-310Initial program 69.4%
Simplified67.6%
Taylor expanded in M around inf 31.3%
associate-*r/31.3%
associate-*r*31.3%
associate-*r*31.3%
associate-*l/31.3%
associate-*r/31.3%
*-commutative31.3%
associate-*r/31.3%
*-commutative31.3%
times-frac31.2%
*-commutative31.2%
associate-/l*23.9%
unpow223.9%
unpow223.9%
unpow223.9%
times-frac40.5%
swap-sqr53.4%
associate-/l*53.4%
Simplified51.0%
if -4.999999999999985e-310 < l Initial program 70.9%
Applied egg-rr85.8%
unpow185.8%
cancel-sign-sub-inv85.8%
metadata-eval85.8%
*-commutative85.8%
associate-/l*84.9%
Simplified84.9%
Final simplification65.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h 3.6e-272)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(sqrt (/ d h))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* -0.5 (* (/ h l) (* 0.25 (pow (* D (/ M d)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3.6e-272) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * sqrt((d / h)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * pow((D * (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 <= 3.6d-272) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * sqrt((d / h)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + ((-0.5d0) * ((h / l) * (0.25d0 * ((d_1 * (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 <= 3.6e-272) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * Math.sqrt((d / h)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * Math.pow((D * (M / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 3.6e-272: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * math.sqrt((d / h))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * math.pow((D * (M / d)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 3.6e-272) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 3.6e-272) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt((d / h))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * ((D * (M / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 3.6e-272], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 3.6 \cdot 10^{-272}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < 3.59999999999999968e-272Initial program 65.3%
Simplified62.5%
if 3.59999999999999968e-272 < h Initial program 69.7%
Applied egg-rr85.2%
unpow185.2%
cancel-sign-sub-inv85.2%
metadata-eval85.2%
*-commutative85.2%
associate-/l*85.1%
Simplified85.1%
Final simplification72.6%
(FPCore (d h l M D)
:precision binary64
(if (<= h -3.05e-304)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ M (* 2.0 (/ d D))) 2.0))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* -0.5 (* (/ h l) (* 0.25 (pow (* D (/ M d)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -3.05e-304) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((M / (2.0 * (d / D))), 2.0)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * pow((D * (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 <= (-3.05d-304)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((m / (2.0d0 * (d / d_1))) ** 2.0d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + ((-0.5d0) * ((h / l) * (0.25d0 * ((d_1 * (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 <= -3.05e-304) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((M / (2.0 * (d / D))), 2.0)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * Math.pow((D * (M / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -3.05e-304: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((M / (2.0 * (d / D))), 2.0))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * math.pow((D * (M / d)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -3.05e-304) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(M / Float64(2.0 * Float64(d / D))) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -3.05e-304) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((M / (2.0 * (d / D))) ^ 2.0))))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * ((D * (M / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -3.05e-304], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(M / N[(2.0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -3.05 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M}{2 \cdot \frac{d}{D}}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < -3.0500000000000002e-304Initial program 64.5%
Simplified62.3%
associate-*r/64.5%
*-un-lft-identity64.5%
times-frac62.3%
associate-/l/62.3%
*-commutative62.3%
times-frac64.5%
*-un-lft-identity64.5%
*-commutative64.5%
frac-times63.0%
clear-num63.0%
frac-times63.1%
*-un-lft-identity63.1%
Applied egg-rr63.1%
if -3.0500000000000002e-304 < h Initial program 70.3%
Applied egg-rr85.1%
unpow185.1%
cancel-sign-sub-inv85.1%
metadata-eval85.1%
*-commutative85.1%
associate-/l*84.2%
Simplified84.2%
Final simplification73.0%
(FPCore (d h l M D)
:precision binary64
(if (<= h 1.72e-227)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* h (* -0.5 (* 0.25 (pow (/ (* D M) d) 2.0)))) l))))
(*
(/ d (* (sqrt h) (sqrt l)))
(+ 1.0 (* -0.5 (* (/ h l) (* 0.25 (pow (* D (/ M d)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.72e-227) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * pow(((D * M) / d), 2.0)))) / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * pow((D * (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 <= 1.72d-227) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h * ((-0.5d0) * (0.25d0 * (((d_1 * m) / d) ** 2.0d0)))) / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 + ((-0.5d0) * ((h / l) * (0.25d0 * ((d_1 * (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 <= 1.72e-227) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * Math.pow(((D * M) / d), 2.0)))) / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * Math.pow((D * (M / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 1.72e-227: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * math.pow(((D * M) / d), 2.0)))) / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * math.pow((D * (M / d)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 1.72e-227) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * Float64(0.25 * (Float64(Float64(D * M) / d) ^ 2.0)))) / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * Float64(0.25 * (Float64(D * Float64(M / d)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 1.72e-227) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h * (-0.5 * (0.25 * (((D * M) / d) ^ 2.0)))) / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 + (-0.5 * ((h / l) * (0.25 * ((D * (M / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.72e-227], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[(0.25 * N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[(0.25 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.72 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(0.25 \cdot {\left(\frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < 1.72e-227Initial program 64.9%
Simplified62.3%
associate-*l/64.5%
Applied egg-rr67.1%
if 1.72e-227 < h Initial program 70.8%
Applied egg-rr87.3%
unpow187.3%
cancel-sign-sub-inv87.3%
metadata-eval87.3%
*-commutative87.3%
associate-/l*87.2%
Simplified87.2%
Final simplification75.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-73)
(* (- d) (pow (* l h) -0.5))
(if (<= l -5e-310)
(log1p (expm1 (* d (/ 1.0 (sqrt (* l h))))))
(if (<= l 2.2e-249)
(* d (- (sqrt (log (exp (/ 1.0 (* l h)))))))
(* (sqrt (/ d l)) (sqrt (/ d h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5e-73) {
tmp = -d * pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = log1p(expm1((d * (1.0 / sqrt((l * h))))));
} else if (l <= 2.2e-249) {
tmp = d * -sqrt(log(exp((1.0 / (l * h)))));
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5e-73) {
tmp = -d * Math.pow((l * h), -0.5);
} else if (l <= -5e-310) {
tmp = Math.log1p(Math.expm1((d * (1.0 / Math.sqrt((l * h))))));
} else if (l <= 2.2e-249) {
tmp = d * -Math.sqrt(Math.log(Math.exp((1.0 / (l * h)))));
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5e-73: tmp = -d * math.pow((l * h), -0.5) elif l <= -5e-310: tmp = math.log1p(math.expm1((d * (1.0 / math.sqrt((l * h)))))) elif l <= 2.2e-249: tmp = d * -math.sqrt(math.log(math.exp((1.0 / (l * h))))) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5e-73) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); elseif (l <= -5e-310) tmp = log1p(expm1(Float64(d * Float64(1.0 / sqrt(Float64(l * h)))))); elseif (l <= 2.2e-249) tmp = Float64(d * Float64(-sqrt(log(exp(Float64(1.0 / Float64(l * h))))))); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5e-73], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[Log[1 + N[(Exp[N[(d * N[(1.0 / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.2e-249], N[(d * (-N[Sqrt[N[Log[N[Exp[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-73}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)\\
\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-249}:\\
\;\;\;\;d \cdot \left(-\sqrt{\log \left(e^{\frac{1}{\ell \cdot h}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if l < -4.9999999999999998e-73Initial program 62.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.2%
neg-mul-145.2%
Simplified45.2%
Taylor expanded in h around 0 45.2%
*-commutative45.2%
rem-exp-log42.8%
exp-neg42.8%
unpow1/242.8%
exp-prod42.8%
distribute-lft-neg-out42.8%
distribute-rgt-neg-in42.8%
metadata-eval42.8%
exp-to-pow45.2%
*-commutative45.2%
Simplified45.2%
if -4.9999999999999998e-73 < l < -4.999999999999985e-310Initial program 67.1%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt22.6%
neg-mul-122.6%
Simplified22.6%
add-sqr-sqrt22.6%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod0.0%
add-sqr-sqrt18.6%
log1p-expm1-u41.5%
add-sqr-sqrt0.0%
sqrt-unprod14.0%
sqr-neg14.0%
sqrt-unprod14.1%
add-sqr-sqrt14.1%
*-commutative14.1%
add-sqr-sqrt14.1%
sqrt-unprod14.0%
sqr-neg14.0%
sqrt-unprod0.0%
add-sqr-sqrt41.5%
associate-/l/41.5%
sqrt-div41.5%
metadata-eval41.5%
Applied egg-rr41.5%
if -4.999999999999985e-310 < l < 2.2e-249Initial program 38.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt14.6%
neg-mul-114.6%
Simplified14.6%
add-log-exp75.2%
associate-/l/75.2%
Applied egg-rr75.2%
if 2.2e-249 < l Initial program 73.3%
Simplified71.5%
Taylor expanded in M around 0 47.5%
Final simplification46.5%
(FPCore (d h l M D) :precision binary64 (if (<= M 4.4e+18) (* (sqrt (/ d l)) (sqrt (/ d h))) (log1p (expm1 (* d (/ 1.0 (sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.4e+18) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = log1p(expm1((d * (1.0 / sqrt((l * h))))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 4.4e+18) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = Math.log1p(Math.expm1((d * (1.0 / Math.sqrt((l * h))))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 4.4e+18: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = math.log1p(math.expm1((d * (1.0 / math.sqrt((l * h)))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 4.4e+18) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = log1p(expm1(Float64(d * Float64(1.0 / sqrt(Float64(l * h)))))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 4.4e+18], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(d * N[(1.0 / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.4 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)\\
\end{array}
\end{array}
if M < 4.4e18Initial program 66.9%
Simplified65.4%
Taylor expanded in M around 0 42.5%
if 4.4e18 < M Initial program 68.1%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt11.0%
neg-mul-111.0%
Simplified11.0%
add-sqr-sqrt8.1%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod15.6%
add-sqr-sqrt27.4%
log1p-expm1-u24.5%
add-sqr-sqrt8.5%
sqrt-unprod10.6%
sqr-neg10.6%
sqrt-unprod3.7%
add-sqr-sqrt13.7%
*-commutative13.7%
add-sqr-sqrt3.7%
sqrt-unprod10.6%
sqr-neg10.6%
sqrt-unprod8.5%
add-sqr-sqrt24.5%
associate-/l/24.5%
sqrt-div24.5%
metadata-eval24.5%
Applied egg-rr24.5%
Final simplification37.9%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.3e-249) (* (- d) (sqrt (/ (/ 1.0 l) h))) (* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.3e-249) {
tmp = -d * sqrt(((1.0 / l) / h));
} else {
tmp = sqrt((d / l)) * sqrt((d / 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 <= 3.3d-249) then
tmp = -d * sqrt(((1.0d0 / l) / h))
else
tmp = sqrt((d / l)) * sqrt((d / 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 <= 3.3e-249) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.3e-249: tmp = -d * math.sqrt(((1.0 / l) / h)) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.3e-249) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.3e-249) tmp = -d * sqrt(((1.0 / l) / h)); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.3e-249], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.3 \cdot 10^{-249}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if l < 3.3e-249Initial program 62.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt36.5%
neg-mul-136.5%
Simplified36.5%
Taylor expanded in h around 0 36.5%
*-commutative36.5%
associate-/r*36.5%
Simplified36.5%
if 3.3e-249 < l Initial program 73.3%
Simplified71.5%
Taylor expanded in M around 0 47.5%
Final simplification41.3%
(FPCore (d h l M D) :precision binary64 (if (<= l -5.6e-298) (* (- d) (sqrt (/ (/ 1.0 l) h))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.6e-298) {
tmp = -d * sqrt(((1.0 / l) / h));
} else {
tmp = d / sqrt((l * 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 <= (-5.6d-298)) then
tmp = -d * sqrt(((1.0d0 / l) / h))
else
tmp = d / sqrt((l * 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 <= -5.6e-298) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.6e-298: tmp = -d * math.sqrt(((1.0 / l) / h)) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.6e-298) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -5.6e-298) tmp = -d * sqrt(((1.0 / l) / h)); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.6e-298], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{-298}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -5.59999999999999985e-298Initial program 64.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt38.6%
neg-mul-138.6%
Simplified38.6%
Taylor expanded in h around 0 38.6%
*-commutative38.6%
associate-/r*38.6%
Simplified38.6%
if -5.59999999999999985e-298 < l Initial program 70.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt5.8%
neg-mul-15.8%
Simplified5.8%
pow15.8%
*-commutative5.8%
add-sqr-sqrt0.0%
sqrt-unprod31.1%
sqr-neg31.1%
sqrt-unprod42.4%
add-sqr-sqrt43.5%
associate-/l/43.5%
sqrt-div43.5%
metadata-eval43.5%
Applied egg-rr43.5%
unpow143.5%
associate-*r/43.6%
*-rgt-identity43.6%
*-commutative43.6%
Simplified43.6%
Final simplification41.0%
(FPCore (d h l M D) :precision binary64 (if (<= l -3e-293) (* (- d) (pow (* l h) -0.5)) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3e-293) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d / sqrt((l * 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 <= (-3d-293)) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d / sqrt((l * 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 <= -3e-293) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3e-293: tmp = -d * math.pow((l * h), -0.5) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3e-293) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3e-293) tmp = -d * ((l * h) ^ -0.5); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3e-293], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3 \cdot 10^{-293}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -3.0000000000000002e-293Initial program 64.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt38.6%
neg-mul-138.6%
Simplified38.6%
Taylor expanded in h around 0 38.6%
*-commutative38.6%
rem-exp-log36.8%
exp-neg36.8%
unpow1/236.8%
exp-prod36.8%
distribute-lft-neg-out36.8%
distribute-rgt-neg-in36.8%
metadata-eval36.8%
exp-to-pow38.6%
*-commutative38.6%
Simplified38.6%
if -3.0000000000000002e-293 < l Initial program 70.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt5.8%
neg-mul-15.8%
Simplified5.8%
pow15.8%
*-commutative5.8%
add-sqr-sqrt0.0%
sqrt-unprod31.1%
sqr-neg31.1%
sqrt-unprod42.4%
add-sqr-sqrt43.5%
associate-/l/43.5%
sqrt-div43.5%
metadata-eval43.5%
Applied egg-rr43.5%
unpow143.5%
associate-*r/43.6%
*-rgt-identity43.6%
*-commutative43.6%
Simplified43.6%
Final simplification41.0%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (* l h)))) (if (<= l -5e-294) (/ (- d) t_0) (/ d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (l <= -5e-294) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (l <= (-5d-294)) then
tmp = -d / t_0
else
tmp = d / t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (l <= -5e-294) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if l <= -5e-294: tmp = -d / t_0 else: tmp = d / t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (l <= -5e-294) tmp = Float64(Float64(-d) / t_0); else tmp = Float64(d / t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (l <= -5e-294) tmp = -d / t_0; else tmp = d / t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5e-294], N[((-d) / t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-294}:\\
\;\;\;\;\frac{-d}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\
\end{array}
\end{array}
if l < -5.0000000000000003e-294Initial program 64.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt38.6%
neg-mul-138.6%
Simplified38.6%
distribute-rgt-neg-out38.6%
neg-sub038.6%
add-sqr-sqrt0.0%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod8.7%
add-sqr-sqrt8.7%
*-commutative8.7%
add-sqr-sqrt8.7%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod0.0%
add-sqr-sqrt38.6%
associate-/l/38.6%
sqrt-div38.6%
metadata-eval38.6%
Applied egg-rr38.6%
neg-sub038.6%
distribute-lft-neg-in38.6%
associate-*r/38.6%
*-rgt-identity38.6%
distribute-neg-frac38.6%
distribute-neg-frac238.6%
*-commutative38.6%
Simplified38.6%
if -5.0000000000000003e-294 < l Initial program 70.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt5.8%
neg-mul-15.8%
Simplified5.8%
pow15.8%
*-commutative5.8%
add-sqr-sqrt0.0%
sqrt-unprod31.1%
sqr-neg31.1%
sqrt-unprod42.4%
add-sqr-sqrt43.5%
associate-/l/43.5%
sqrt-div43.5%
metadata-eval43.5%
Applied egg-rr43.5%
unpow143.5%
associate-*r/43.6%
*-rgt-identity43.6%
*-commutative43.6%
Simplified43.6%
Final simplification41.0%
(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 67.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt23.0%
neg-mul-123.0%
Simplified23.0%
pow123.0%
*-commutative23.0%
add-sqr-sqrt20.2%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-unprod20.2%
add-sqr-sqrt25.3%
associate-/l/25.3%
sqrt-div25.3%
metadata-eval25.3%
Applied egg-rr25.3%
unpow125.3%
associate-*r/25.3%
*-rgt-identity25.3%
*-commutative25.3%
Simplified25.3%
Final simplification25.3%
herbie shell --seed 2024072
(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)))))