
(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 19 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}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* 0.5 (* D (/ M d)))) (t_1 (sqrt (- d))))
(if (<= l -1e-309)
(*
(/ t_1 (sqrt (- h)))
(*
(/ t_1 (sqrt (- l)))
(fma (pow (* 0.5 (* M (/ D d))) 2.0) (* -0.5 (/ h l)) 1.0)))
(if (<= l 2.9e+158)
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) 0.5))
(+ 1.0 (/ -1.0 (/ l (* 0.5 (* h (pow t_0 2.0)))))))
(*
(* (pow (/ d h) 0.5) (* (sqrt d) (sqrt (/ 1.0 l))))
(-
1.0
(*
(/ (* h (* 0.5 (* (/ (* M D) d) (sqrt 0.5)))) l)
(* t_0 (sqrt 0.5)))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = 0.5 * (D * (M / d));
double t_1 = sqrt(-d);
double tmp;
if (l <= -1e-309) {
tmp = (t_1 / sqrt(-h)) * ((t_1 / sqrt(-l)) * fma(pow((0.5 * (M * (D / d))), 2.0), (-0.5 * (h / l)), 1.0));
} else if (l <= 2.9e+158) {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), 0.5)) * (1.0 + (-1.0 / (l / (0.5 * (h * pow(t_0, 2.0))))));
} else {
tmp = (pow((d / h), 0.5) * (sqrt(d) * sqrt((1.0 / l)))) * (1.0 - (((h * (0.5 * (((M * D) / d) * sqrt(0.5)))) / l) * (t_0 * sqrt(0.5))));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(D * Float64(M / d))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(Float64(t_1 / sqrt(Float64(-l))) * fma((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0), Float64(-0.5 * Float64(h / l)), 1.0))); elseif (l <= 2.9e+158) tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ 0.5)) * Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.5 * Float64(h * (t_0 ^ 2.0))))))); else tmp = Float64(Float64((Float64(d / h) ^ 0.5) * Float64(sqrt(d) * sqrt(Float64(1.0 / l)))) * Float64(1.0 - Float64(Float64(Float64(h * Float64(0.5 * Float64(Float64(Float64(M * D) / d) * sqrt(0.5)))) / l) * Float64(t_0 * sqrt(0.5))))); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-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], If[LessEqual[l, 2.9e+158], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-1.0 / N[(l / N[(0.5 * N[(h * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(h * N[(0.5 * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$0 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(D \cdot \frac{M}{d}\right)\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{t\_1}{\sqrt{-h}} \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+158}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{-1}{\frac{\ell}{0.5 \cdot \left(h \cdot {t\_0}^{2}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{\ell}}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot \left(\frac{M \cdot D}{d} \cdot \sqrt{0.5}\right)\right)}{\ell} \cdot \left(t\_0 \cdot \sqrt{0.5}\right)\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 72.4%
Simplified73.7%
frac-2neg73.7%
sqrt-div77.0%
Applied egg-rr77.0%
frac-2neg77.0%
sqrt-div87.2%
Applied egg-rr87.2%
if -1.000000000000002e-309 < l < 2.90000000000000024e158Initial program 70.1%
associate-*r/71.3%
clear-num71.3%
metadata-eval71.3%
associate-*l*71.3%
Applied egg-rr70.4%
metadata-eval70.4%
pow1/270.4%
sqrt-div87.0%
Applied egg-rr87.0%
if 2.90000000000000024e158 < l Initial program 54.2%
*-commutative54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
associate-*r*54.2%
Applied egg-rr54.9%
associate-*l/64.0%
metadata-eval64.0%
associate-*l*64.0%
metadata-eval64.0%
associate-*r/64.0%
Applied egg-rr64.0%
div-inv64.1%
unpow-prod-down82.6%
metadata-eval82.6%
pow1/282.6%
metadata-eval82.6%
Applied egg-rr82.6%
unpow1/282.6%
Simplified82.6%
Final simplification86.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* 0.5 (* D (/ M d))) 2.0)))
(if (<= l -11000000000.0)
(*
(sqrt (/ d h))
(* (/ (sqrt (- d)) (sqrt (- l))) (+ 1.0 (* t_0 (/ (* h -0.5) l)))))
(if (<= l -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) 0.5))
(+ 1.0 (/ -1.0 (/ l (* 0.5 (* h t_0))))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((0.5 * (D * (M / d))), 2.0);
double tmp;
if (l <= -11000000000.0) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + (t_0 * ((h * -0.5) / l))));
} else if (l <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), 0.5)) * (1.0 + (-1.0 / (l / (0.5 * (h * t_0)))));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 = (0.5d0 * (d_1 * (m / d))) ** 2.0d0
if (l <= (-11000000000.0d0)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0d0 + (t_0 * ((h * (-0.5d0)) / l))))
else if (l <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ** 0.5d0)) * (1.0d0 + ((-1.0d0) / (l / (0.5d0 * (h * t_0)))))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((0.5 * (D * (M / d))), 2.0);
double tmp;
if (l <= -11000000000.0) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * (1.0 + (t_0 * ((h * -0.5) / l))));
} else if (l <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.pow((d / l), 0.5)) * (1.0 + (-1.0 / (l / (0.5 * (h * t_0)))));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.pow((0.5 * (D * (M / d))), 2.0) tmp = 0 if l <= -11000000000.0: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * (1.0 + (t_0 * ((h * -0.5) / l)))) elif l <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.pow((d / l), 0.5)) * (1.0 + (-1.0 / (l / (0.5 * (h * t_0))))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(0.5 * Float64(D * Float64(M / d))) ^ 2.0 tmp = 0.0 if (l <= -11000000000.0) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64(t_0 * Float64(Float64(h * -0.5) / l))))); elseif (l <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ 0.5)) * Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.5 * Float64(h * t_0)))))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (0.5 * (D * (M / d))) ^ 2.0;
tmp = 0.0;
if (l <= -11000000000.0)
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + (t_0 * ((h * -0.5) / l))));
elseif (l <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ^ 0.5)) * (1.0 + (-1.0 / (l / (0.5 * (h * t_0)))));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -11000000000.0], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t$95$0 * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-1.0 / N[(l / N[(0.5 * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := {\left(0.5 \cdot \left(D \cdot \frac{M}{d}\right)\right)}^{2}\\
\mathbf{if}\;\ell \leq -11000000000:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + t\_0 \cdot \frac{h \cdot -0.5}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{-1}{\frac{\ell}{0.5 \cdot \left(h \cdot t\_0\right)}}\right)\\
\end{array}
\end{array}
if l < -1.1e10Initial program 66.2%
Simplified69.0%
frac-2neg69.0%
sqrt-div74.2%
Applied egg-rr74.2%
fma-undefine74.2%
Applied egg-rr75.4%
if -1.1e10 < l < -1.000000000000002e-309Initial program 78.3%
associate-*r/82.5%
clear-num82.6%
metadata-eval82.6%
associate-*l*82.6%
Applied egg-rr82.6%
*-commutative82.6%
Applied egg-rr77.1%
associate-*l/77.1%
*-un-lft-identity77.1%
*-commutative77.1%
associate-*r*77.1%
metadata-eval77.1%
associate-*r/77.1%
*-commutative77.1%
associate-*r/77.1%
Applied egg-rr77.1%
Taylor expanded in d around -inf 92.8%
mul-1-neg92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
metadata-eval68.4%
pow1/268.4%
sqrt-div82.8%
Applied egg-rr82.8%
Final simplification83.6%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (/ M d))))
(if (<= l -30500000000.0)
(*
(sqrt (/ d h))
(*
(/ (sqrt (- d)) (sqrt (- l)))
(+ 1.0 (* (pow (* 0.5 t_0) 2.0) (/ (* h -0.5) l)))))
(if (<= l -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
d
(/ (+ 1.0 (* h (/ (* -0.125 (pow t_0 2.0)) l))) (sqrt (* l h))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / d);
double tmp;
if (l <= -30500000000.0) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + (pow((0.5 * t_0), 2.0) * ((h * -0.5) / l))));
} else if (l <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow(t_0, 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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)
if (l <= (-30500000000.0d0)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0d0 + (((0.5d0 * t_0) ** 2.0d0) * ((h * (-0.5d0)) / l))))
else if (l <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * (t_0 ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / d);
double tmp;
if (l <= -30500000000.0) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * (1.0 + (Math.pow((0.5 * t_0), 2.0) * ((h * -0.5) / l))));
} else if (l <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow(t_0, 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = D * (M / d) tmp = 0 if l <= -30500000000.0: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * (1.0 + (math.pow((0.5 * t_0), 2.0) * ((h * -0.5) / l)))) elif l <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow(t_0, 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / d)) tmp = 0.0 if (l <= -30500000000.0) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64((Float64(0.5 * t_0) ^ 2.0) * Float64(Float64(h * -0.5) / l))))); elseif (l <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (t_0 ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = D * (M / d);
tmp = 0.0;
if (l <= -30500000000.0)
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + (((0.5 * t_0) ^ 2.0) * ((h * -0.5) / l))));
elseif (l <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * (t_0 ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -30500000000.0], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[Power[N[(0.5 * t$95$0), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := D \cdot \frac{M}{d}\\
\mathbf{if}\;\ell \leq -30500000000:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + {\left(0.5 \cdot t\_0\right)}^{2} \cdot \frac{h \cdot -0.5}{\ell}\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {t\_0}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -3.05e10Initial program 66.2%
Simplified69.0%
frac-2neg69.0%
sqrt-div74.2%
Applied egg-rr74.2%
fma-undefine74.2%
Applied egg-rr75.4%
if -3.05e10 < l < -1.000000000000002e-309Initial program 78.3%
associate-*r/82.5%
clear-num82.6%
metadata-eval82.6%
associate-*l*82.6%
Applied egg-rr82.6%
*-commutative82.6%
Applied egg-rr77.1%
associate-*l/77.1%
*-un-lft-identity77.1%
*-commutative77.1%
associate-*r*77.1%
metadata-eval77.1%
associate-*r/77.1%
*-commutative77.1%
associate-*r/77.1%
Applied egg-rr77.1%
Taylor expanded in d around -inf 92.8%
mul-1-neg92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification83.3%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.5e-67)
(*
(sqrt (/ d h))
(* (sqrt (/ d l)) (fma h (* (/ -0.125 l) (pow (* M (/ D d)) 2.0)) 1.0)))
(if (<= d -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h)))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.5e-67) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma(h, ((-0.125 / l) * pow((M * (D / d)), 2.0)), 1.0));
} else if (d <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.5e-67) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(h, Float64(Float64(-0.125 / l) * (Float64(M * Float64(D / d)) ^ 2.0)), 1.0))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.5e-67], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.5 \cdot 10^{-67}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h, \frac{-0.125}{\ell} \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}, 1\right)\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -6.4999999999999997e-67Initial program 86.0%
Simplified88.5%
Taylor expanded in M around 0 55.3%
Simplified93.5%
if -6.4999999999999997e-67 < d < -1.000000000000002e-309Initial program 53.7%
associate-*r/54.0%
clear-num54.0%
metadata-eval54.0%
associate-*l*54.0%
Applied egg-rr54.0%
*-commutative54.0%
Applied egg-rr45.3%
associate-*l/45.3%
*-un-lft-identity45.3%
*-commutative45.3%
associate-*r*45.3%
metadata-eval45.3%
associate-*r/45.3%
*-commutative45.3%
associate-*r/45.3%
Applied egg-rr45.3%
Taylor expanded in d around -inf 72.9%
mul-1-neg72.9%
distribute-rgt-neg-in72.9%
Simplified72.9%
if -1.000000000000002e-309 < d Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification83.5%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (/ M d))))
(if (<= d -1e-85)
(*
(+ 1.0 (/ -1.0 (/ l (* 0.5 (* h (pow (* 0.5 t_0) 2.0))))))
(* (pow (/ d h) 0.5) (sqrt (/ d l))))
(if (<= d -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
d
(/ (+ 1.0 (* h (/ (* -0.125 (pow t_0 2.0)) l))) (sqrt (* l h))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / d);
double tmp;
if (d <= -1e-85) {
tmp = (1.0 + (-1.0 / (l / (0.5 * (h * pow((0.5 * t_0), 2.0)))))) * (pow((d / h), 0.5) * sqrt((d / l)));
} else if (d <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow(t_0, 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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)
if (d <= (-1d-85)) then
tmp = (1.0d0 + ((-1.0d0) / (l / (0.5d0 * (h * ((0.5d0 * t_0) ** 2.0d0)))))) * (((d / h) ** 0.5d0) * sqrt((d / l)))
else if (d <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * (t_0 ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / d);
double tmp;
if (d <= -1e-85) {
tmp = (1.0 + (-1.0 / (l / (0.5 * (h * Math.pow((0.5 * t_0), 2.0)))))) * (Math.pow((d / h), 0.5) * Math.sqrt((d / l)));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow(t_0, 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = D * (M / d) tmp = 0 if d <= -1e-85: tmp = (1.0 + (-1.0 / (l / (0.5 * (h * math.pow((0.5 * t_0), 2.0)))))) * (math.pow((d / h), 0.5) * math.sqrt((d / l))) elif d <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow(t_0, 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / d)) tmp = 0.0 if (d <= -1e-85) tmp = Float64(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(0.5 * Float64(h * (Float64(0.5 * t_0) ^ 2.0)))))) * Float64((Float64(d / h) ^ 0.5) * sqrt(Float64(d / l)))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (t_0 ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = D * (M / d);
tmp = 0.0;
if (d <= -1e-85)
tmp = (1.0 + (-1.0 / (l / (0.5 * (h * ((0.5 * t_0) ^ 2.0)))))) * (((d / h) ^ 0.5) * sqrt((d / l)));
elseif (d <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * (t_0 ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1e-85], N[(N[(1.0 + N[(-1.0 / N[(l / N[(0.5 * N[(h * N[Power[N[(0.5 * t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := D \cdot \frac{M}{d}\\
\mathbf{if}\;d \leq -1 \cdot 10^{-85}:\\
\;\;\;\;\left(1 + \frac{-1}{\frac{\ell}{0.5 \cdot \left(h \cdot {\left(0.5 \cdot t\_0\right)}^{2}\right)}}\right) \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {t\_0}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -9.9999999999999998e-86Initial program 86.5%
associate-*r/90.2%
clear-num90.2%
metadata-eval90.2%
associate-*l*90.2%
Applied egg-rr91.2%
Taylor expanded in d around 0 91.2%
if -9.9999999999999998e-86 < d < -1.000000000000002e-309Initial program 51.1%
associate-*r/51.4%
clear-num51.4%
metadata-eval51.4%
associate-*l*51.4%
Applied egg-rr51.4%
*-commutative51.4%
Applied egg-rr42.3%
associate-*l/42.3%
*-un-lft-identity42.3%
*-commutative42.3%
associate-*r*42.3%
metadata-eval42.3%
associate-*r/42.3%
*-commutative42.3%
associate-*r/42.3%
Applied egg-rr42.3%
Taylor expanded in d around -inf 73.1%
mul-1-neg73.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
if -1.000000000000002e-309 < d Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification83.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (/ (* M D) d) 2.0)))
(if (<= d -9.2e-87)
(*
(sqrt (/ d h))
(* (sqrt (/ d l)) (+ 1.0 (* (* h (* 0.5 (* t_0 0.25))) (/ -1.0 l)))))
(if (<= d -1e-309)
(* (* d (sqrt (/ 1.0 (* l h)))) (+ (/ (* h (* t_0 0.125)) l) -1.0))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * D) / d), 2.0);
double tmp;
if (d <= -9.2e-87) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (0.5 * (t_0 * 0.25))) * (-1.0 / l))));
} else if (d <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 = ((m * d_1) / d) ** 2.0d0
if (d <= (-9.2d-87)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h * (0.5d0 * (t_0 * 0.25d0))) * ((-1.0d0) / l))))
else if (d <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * (t_0 * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow(((M * D) / d), 2.0);
double tmp;
if (d <= -9.2e-87) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h * (0.5 * (t_0 * 0.25))) * (-1.0 / l))));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.pow(((M * D) / d), 2.0) tmp = 0 if d <= -9.2e-87: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h * (0.5 * (t_0 * 0.25))) * (-1.0 / l)))) elif d <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / d) ^ 2.0 tmp = 0.0 if (d <= -9.2e-87) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(0.5 * Float64(t_0 * 0.25))) * Float64(-1.0 / l))))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64(t_0 * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = ((M * D) / d) ^ 2.0;
tmp = 0.0;
if (d <= -9.2e-87)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (0.5 * (t_0 * 0.25))) * (-1.0 / l))));
elseif (d <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[d, -9.2e-87], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(0.5 * N[(t$95$0 * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{d}\right)}^{2}\\
\mathbf{if}\;d \leq -9.2 \cdot 10^{-87}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \left(h \cdot \left(0.5 \cdot \left(t\_0 \cdot 0.25\right)\right)\right) \cdot \frac{-1}{\ell}\right)\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left(t\_0 \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -9.2000000000000006e-87Initial program 86.5%
associate-*r/90.2%
clear-num90.2%
metadata-eval90.2%
associate-*l*90.2%
Applied egg-rr91.2%
metadata-eval91.2%
pow1/291.2%
metadata-eval91.2%
pow1/291.2%
associate-*l*91.2%
associate-/r/91.2%
metadata-eval91.2%
associate-*r*91.2%
Applied egg-rr90.2%
if -9.2000000000000006e-87 < d < -1.000000000000002e-309Initial program 51.1%
associate-*r/51.4%
clear-num51.4%
metadata-eval51.4%
associate-*l*51.4%
Applied egg-rr51.4%
*-commutative51.4%
Applied egg-rr42.3%
associate-*l/42.3%
*-un-lft-identity42.3%
*-commutative42.3%
associate-*r*42.3%
metadata-eval42.3%
associate-*r/42.3%
*-commutative42.3%
associate-*r/42.3%
Applied egg-rr42.3%
Taylor expanded in d around -inf 73.1%
mul-1-neg73.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
if -1.000000000000002e-309 < d Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification82.8%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -4e-86)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (/ h l) (* 0.25 (pow (/ M (/ d D)) 2.0)))))))
(if (<= d -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h)))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e-86) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (0.25 * pow((M / (d / D)), 2.0))))));
} else if (d <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-4d-86)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (0.25d0 * ((m / (d / d_1)) ** 2.0d0))))))
else if (d <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e-86) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (0.25 * Math.pow((M / (d / D)), 2.0))))));
} else if (d <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -4e-86: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (0.25 * math.pow((M / (d / D)), 2.0)))))) elif d <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -4e-86) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * Float64(0.25 * (Float64(M / Float64(d / D)) ^ 2.0))))))); elseif (d <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -4e-86)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (0.25 * ((M / (d / D)) ^ 2.0))))));
elseif (d <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4e-86], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[(0.25 * N[Power[N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4 \cdot 10^{-86}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(\frac{M}{\frac{d}{D}}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -4.00000000000000034e-86Initial program 86.5%
times-frac88.9%
div-inv88.9%
metadata-eval88.9%
*-commutative88.9%
clear-num88.9%
un-div-inv88.9%
Applied egg-rr88.9%
metadata-eval88.9%
pow1/288.9%
metadata-eval88.9%
pow1/288.9%
associate-*l*88.9%
associate-*l*88.9%
metadata-eval88.9%
Applied egg-rr88.9%
if -4.00000000000000034e-86 < d < -1.000000000000002e-309Initial program 51.1%
associate-*r/51.4%
clear-num51.4%
metadata-eval51.4%
associate-*l*51.4%
Applied egg-rr51.4%
*-commutative51.4%
Applied egg-rr42.3%
associate-*l/42.3%
*-un-lft-identity42.3%
*-commutative42.3%
associate-*r*42.3%
metadata-eval42.3%
associate-*r/42.3%
*-commutative42.3%
associate-*r/42.3%
Applied egg-rr42.3%
Taylor expanded in d around -inf 73.1%
mul-1-neg73.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
if -1.000000000000002e-309 < d Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification82.4%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* D (/ M d)) 2.0)))
(if (<= l -9.5e+150)
(* (sqrt (/ d l)) (* (sqrt (/ d h)) (+ 1.0 (* -0.125 (* (/ h l) t_0)))))
(if (<= l -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(* d (/ (+ 1.0 (* h (/ (* -0.125 t_0) l))) (sqrt (* l h))))))))assert(d < h && h < l && l < M && M < D);
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 <= -9.5e+150) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * t_0))));
} else if (l <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * t_0) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 <= (-9.5d+150)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.125d0) * ((h / l) * t_0))))
else if (l <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * t_0) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
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 <= -9.5e+150) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * t_0))));
} else if (l <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * t_0) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.pow((D * (M / d)), 2.0) tmp = 0 if l <= -9.5e+150: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * t_0)))) elif l <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * t_0) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / d)) ^ 2.0 tmp = 0.0 if (l <= -9.5e+150) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * t_0))))); elseif (l <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * t_0) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = (D * (M / d)) ^ 2.0;
tmp = 0.0;
if (l <= -9.5e+150)
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * t_0))));
elseif (l <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * t_0) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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, -9.5e+150], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := {\left(D \cdot \frac{M}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -9.5 \cdot 10^{+150}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot t\_0}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -9.5000000000000001e150Initial program 64.9%
associate-*r/65.5%
clear-num65.5%
metadata-eval65.5%
associate-*l*65.5%
Applied egg-rr65.5%
metadata-eval65.5%
pow1/265.4%
metadata-eval65.4%
pow1/265.4%
associate-*l*65.4%
associate-/r/65.4%
metadata-eval65.4%
associate-*r*65.4%
Applied egg-rr65.4%
Simplified67.5%
if -9.5000000000000001e150 < l < -1.000000000000002e-309Initial program 75.1%
associate-*r/78.0%
clear-num78.0%
metadata-eval78.0%
associate-*l*78.0%
Applied egg-rr78.9%
*-commutative78.9%
Applied egg-rr70.2%
associate-*l/70.2%
*-un-lft-identity70.2%
*-commutative70.2%
associate-*r*70.2%
metadata-eval70.2%
associate-*r/71.0%
*-commutative71.0%
associate-*r/70.2%
Applied egg-rr70.2%
Taylor expanded in d around -inf 88.0%
mul-1-neg88.0%
distribute-rgt-neg-in88.0%
Simplified88.0%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification82.4%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (/ (* M D) d) 2.0)))
(if (<= l -8.5e+147)
(* (sqrt (/ d h)) (* (sqrt (/ d l)) (- 1.0 (* t_0 (* (/ h l) 0.125)))))
(if (<= l -1e-309)
(* (* d (sqrt (/ 1.0 (* l h)))) (+ (/ (* h (* t_0 0.125)) l) -1.0))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h))))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * D) / d), 2.0);
double tmp;
if (l <= -8.5e+147) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (t_0 * ((h / l) * 0.125))));
} else if (l <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 = ((m * d_1) / d) ** 2.0d0
if (l <= (-8.5d+147)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (t_0 * ((h / l) * 0.125d0))))
else if (l <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * (t_0 * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow(((M * D) / d), 2.0);
double tmp;
if (l <= -8.5e+147) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (t_0 * ((h / l) * 0.125))));
} else if (l <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.pow(((M * D) / d), 2.0) tmp = 0 if l <= -8.5e+147: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (t_0 * ((h / l) * 0.125)))) elif l <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / d) ^ 2.0 tmp = 0.0 if (l <= -8.5e+147) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(t_0 * Float64(Float64(h / l) * 0.125))))); elseif (l <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64(t_0 * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = ((M * D) / d) ^ 2.0;
tmp = 0.0;
if (l <= -8.5e+147)
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (t_0 * ((h / l) * 0.125))));
elseif (l <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (t_0 * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -8.5e+147], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - t\_0 \cdot \left(\frac{h}{\ell} \cdot 0.125\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left(t\_0 \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -8.5000000000000007e147Initial program 64.9%
associate-*r/65.5%
clear-num65.5%
metadata-eval65.5%
associate-*l*65.5%
Applied egg-rr65.5%
*-commutative65.5%
Applied egg-rr57.4%
Applied egg-rr64.9%
if -8.5000000000000007e147 < l < -1.000000000000002e-309Initial program 75.1%
associate-*r/78.0%
clear-num78.0%
metadata-eval78.0%
associate-*l*78.0%
Applied egg-rr78.9%
*-commutative78.9%
Applied egg-rr70.2%
associate-*l/70.2%
*-un-lft-identity70.2%
*-commutative70.2%
associate-*r*70.2%
metadata-eval70.2%
associate-*r/71.0%
*-commutative71.0%
associate-*r/70.2%
Applied egg-rr70.2%
Taylor expanded in d around -inf 88.0%
mul-1-neg88.0%
distribute-rgt-neg-in88.0%
Simplified88.0%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification82.0%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e+259)
(*
(- 1.0 (* (* h (/ 0.125 l)) (pow (/ (/ d D) M) -2.0)))
(sqrt (* (/ d l) (/ d h))))
(if (<= l -1e-309)
(*
(* d (sqrt (/ 1.0 (* l h))))
(+ (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l) -1.0))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h)))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e+259) {
tmp = (1.0 - ((h * (0.125 / l)) * pow(((d / D) / M), -2.0))) * sqrt(((d / l) * (d / h)));
} else if (l <= -1e-309) {
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * (pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-6d+259)) then
tmp = (1.0d0 - ((h * (0.125d0 / l)) * (((d / d_1) / m) ** (-2.0d0)))) * sqrt(((d / l) * (d / h)))
else if (l <= (-1d-309)) then
tmp = (d * sqrt((1.0d0 / (l * h)))) * (((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l) + (-1.0d0))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e+259) {
tmp = (1.0 - ((h * (0.125 / l)) * Math.pow(((d / D) / M), -2.0))) * Math.sqrt(((d / l) * (d / h)));
} else if (l <= -1e-309) {
tmp = (d * Math.sqrt((1.0 / (l * h)))) * (((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0);
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -6e+259: tmp = (1.0 - ((h * (0.125 / l)) * math.pow(((d / D) / M), -2.0))) * math.sqrt(((d / l) * (d / h))) elif l <= -1e-309: tmp = (d * math.sqrt((1.0 / (l * h)))) * (((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l) + -1.0) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e+259) tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64(0.125 / l)) * (Float64(Float64(d / D) / M) ^ -2.0))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (l <= -1e-309) tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0)); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -6e+259)
tmp = (1.0 - ((h * (0.125 / l)) * (((d / D) / M) ^ -2.0))) * sqrt(((d / l) * (d / h)));
elseif (l <= -1e-309)
tmp = (d * sqrt((1.0 / (l * h)))) * (((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l) + -1.0);
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e+259], N[(N[(1.0 - N[(N[(h * N[(0.125 / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{+259}:\\
\;\;\;\;\left(1 - \left(h \cdot \frac{0.125}{\ell}\right) \cdot {\left(\frac{\frac{d}{D}}{M}\right)}^{-2}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(\frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -6.00000000000000026e259Initial program 67.0%
associate-*r/67.0%
clear-num67.0%
metadata-eval67.0%
associate-*l*67.0%
Applied egg-rr67.0%
*-commutative67.0%
Applied egg-rr55.8%
Taylor expanded in l around 0 22.0%
associate-*r*22.0%
times-frac22.1%
associate-/l*33.2%
unpow233.2%
unpow233.2%
unpow233.2%
times-frac55.4%
swap-sqr66.5%
associate-*r/55.8%
associate-*r/55.8%
unpow255.8%
*-commutative55.8%
associate-*l*55.8%
*-commutative55.8%
associate-*l/55.8%
associate-/l*55.8%
unpow255.8%
Simplified66.5%
if -6.00000000000000026e259 < l < -1.000000000000002e-309Initial program 72.7%
associate-*r/75.2%
clear-num75.3%
metadata-eval75.3%
associate-*l*75.3%
Applied egg-rr75.9%
*-commutative75.9%
Applied egg-rr67.6%
associate-*l/67.6%
*-un-lft-identity67.6%
*-commutative67.6%
associate-*r*67.6%
metadata-eval67.6%
associate-*r/68.2%
*-commutative68.2%
associate-*r/67.6%
Applied egg-rr67.6%
Taylor expanded in d around -inf 81.4%
mul-1-neg81.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification81.2%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= l -1.5e-226)
(* (pow (/ d h) 0.5) (sqrt (/ d l)))
(if (<= l -1e-309)
(/ d t_0)
(* d (/ (+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l))) t_0))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (l <= -1.5e-226) {
tmp = pow((d / h), 0.5) * sqrt((d / l));
} else if (l <= -1e-309) {
tmp = d / t_0;
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / t_0);
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 <= (-1.5d-226)) then
tmp = ((d / h) ** 0.5d0) * sqrt((d / l))
else if (l <= (-1d-309)) then
tmp = d / t_0
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / t_0)
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
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 <= -1.5e-226) {
tmp = Math.pow((d / h), 0.5) * Math.sqrt((d / l));
} else if (l <= -1e-309) {
tmp = d / t_0;
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / t_0);
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if l <= -1.5e-226: tmp = math.pow((d / h), 0.5) * math.sqrt((d / l)) elif l <= -1e-309: tmp = d / t_0 else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / t_0) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (l <= -1.5e-226) tmp = Float64((Float64(d / h) ^ 0.5) * sqrt(Float64(d / l))); elseif (l <= -1e-309) tmp = Float64(d / t_0); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / t_0)); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = sqrt((l * h));
tmp = 0.0;
if (l <= -1.5e-226)
tmp = ((d / h) ^ 0.5) * sqrt((d / l));
elseif (l <= -1e-309)
tmp = d / t_0;
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / t_0);
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.5e-226], N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(d / t$95$0), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-226}:\\
\;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{t\_0}\\
\end{array}
\end{array}
if l < -1.49999999999999998e-226Initial program 69.6%
Simplified71.2%
Taylor expanded in M around 0 47.5%
pow1/247.5%
Applied egg-rr47.5%
if -1.49999999999999998e-226 < l < -1.000000000000002e-309Initial program 89.3%
Simplified89.3%
Taylor expanded in M around 0 21.4%
pow1/221.4%
metadata-eval21.4%
*-rgt-identity21.4%
pow1/221.4%
metadata-eval21.4%
pow-prod-down21.4%
metadata-eval21.4%
unpow1/221.4%
Applied egg-rr21.4%
associate-*l/21.4%
Applied egg-rr21.4%
associate-*l/21.4%
frac-times21.3%
unpow221.3%
sqrt-div21.3%
sqrt-pow158.5%
metadata-eval58.5%
pow158.5%
*-commutative58.5%
Applied egg-rr58.5%
if -1.000000000000002e-309 < l Initial program 67.2%
associate-*r/69.1%
clear-num69.1%
metadata-eval69.1%
associate-*l*69.1%
Applied egg-rr68.4%
*-commutative68.4%
Applied egg-rr59.8%
associate-*l/59.8%
*-un-lft-identity59.8%
*-commutative59.8%
associate-*r*59.8%
metadata-eval59.8%
associate-*r/59.1%
*-commutative59.1%
associate-*r/59.8%
Applied egg-rr59.8%
Applied egg-rr75.4%
*-lft-identity75.4%
associate-*l/77.9%
associate-/l*77.1%
Simplified82.1%
Final simplification64.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= h 5.6e-146)
(*
(- 1.0 (/ (* h (* (pow (/ (* M D) d) 2.0) 0.125)) l))
(sqrt (* (/ d l) (/ d h))))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.6e-146) {
tmp = (1.0 - ((h * (pow(((M * D) / d), 2.0) * 0.125)) / l)) * sqrt(((d / l) * (d / h)));
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 <= 5.6d-146) then
tmp = (1.0d0 - ((h * ((((m * d_1) / d) ** 2.0d0) * 0.125d0)) / l)) * sqrt(((d / l) * (d / h)))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 5.6e-146) {
tmp = (1.0 - ((h * (Math.pow(((M * D) / d), 2.0) * 0.125)) / l)) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if h <= 5.6e-146: tmp = (1.0 - ((h * (math.pow(((M * D) / d), 2.0) * 0.125)) / l)) * math.sqrt(((d / l) * (d / h))) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (h <= 5.6e-146) tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64((Float64(Float64(M * D) / d) ^ 2.0) * 0.125)) / l)) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (h <= 5.6e-146)
tmp = (1.0 - ((h * ((((M * D) / d) ^ 2.0) * 0.125)) / l)) * sqrt(((d / l) * (d / h)));
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[h, 5.6e-146], N[(N[(1.0 - N[(N[(h * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 5.6 \cdot 10^{-146}:\\
\;\;\;\;\left(1 - \frac{h \cdot \left({\left(\frac{M \cdot D}{d}\right)}^{2} \cdot 0.125\right)}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if h < 5.60000000000000006e-146Initial program 72.8%
associate-*r/75.3%
clear-num75.3%
metadata-eval75.3%
associate-*l*75.3%
Applied egg-rr75.2%
*-commutative75.2%
Applied egg-rr69.0%
associate-*l/69.0%
*-un-lft-identity69.0%
*-commutative69.0%
associate-*r*69.0%
metadata-eval69.0%
associate-*r/68.9%
*-commutative68.9%
associate-*r/69.0%
Applied egg-rr69.0%
if 5.60000000000000006e-146 < h Initial program 64.4%
associate-*r/65.8%
clear-num65.8%
metadata-eval65.8%
associate-*l*65.8%
Applied egg-rr65.8%
*-commutative65.8%
Applied egg-rr52.8%
associate-*l/52.8%
*-un-lft-identity52.8%
*-commutative52.8%
associate-*r*52.8%
metadata-eval52.8%
associate-*r/52.8%
*-commutative52.8%
associate-*r/52.8%
Applied egg-rr52.8%
Applied egg-rr76.3%
*-lft-identity76.3%
associate-*l/79.7%
associate-/l*78.6%
Simplified84.4%
Final simplification74.2%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.75e-289)
(*
(- 1.0 (* (* h (/ 0.125 l)) (pow (/ (/ d D) M) -2.0)))
(sqrt (* (/ d l) (/ d h))))
(*
d
(/
(+ 1.0 (* h (/ (* -0.125 (pow (* D (/ M d)) 2.0)) l)))
(sqrt (* l h))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.75e-289) {
tmp = (1.0 - ((h * (0.125 / l)) * pow(((d / D) / M), -2.0))) * sqrt(((d / l) * (d / h)));
} else {
tmp = d * ((1.0 + (h * ((-0.125 * pow((D * (M / d)), 2.0)) / l))) / sqrt((l * h)));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.75d-289)) then
tmp = (1.0d0 - ((h * (0.125d0 / l)) * (((d / d_1) / m) ** (-2.0d0)))) * sqrt(((d / l) * (d / h)))
else
tmp = d * ((1.0d0 + (h * (((-0.125d0) * ((d_1 * (m / d)) ** 2.0d0)) / l))) / sqrt((l * h)))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.75e-289) {
tmp = (1.0 - ((h * (0.125 / l)) * Math.pow(((d / D) / M), -2.0))) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * ((1.0 + (h * ((-0.125 * Math.pow((D * (M / d)), 2.0)) / l))) / Math.sqrt((l * h)));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if d <= -1.75e-289: tmp = (1.0 - ((h * (0.125 / l)) * math.pow(((d / D) / M), -2.0))) * math.sqrt(((d / l) * (d / h))) else: tmp = d * ((1.0 + (h * ((-0.125 * math.pow((D * (M / d)), 2.0)) / l))) / math.sqrt((l * h))) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.75e-289) tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64(0.125 / l)) * (Float64(Float64(d / D) / M) ^ -2.0))) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(d * Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.125 * (Float64(D * Float64(M / d)) ^ 2.0)) / l))) / sqrt(Float64(l * h)))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (d <= -1.75e-289)
tmp = (1.0 - ((h * (0.125 / l)) * (((d / D) / M) ^ -2.0))) * sqrt(((d / l) * (d / h)));
else
tmp = d * ((1.0 + (h * ((-0.125 * ((D * (M / d)) ^ 2.0)) / l))) / sqrt((l * h)));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.75e-289], N[(N[(1.0 - N[(N[(h * N[(0.125 / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 + N[(h * N[(N[(-0.125 * N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.75 \cdot 10^{-289}:\\
\;\;\;\;\left(1 - \left(h \cdot \frac{0.125}{\ell}\right) \cdot {\left(\frac{\frac{d}{D}}{M}\right)}^{-2}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1 + h \cdot \frac{-0.125 \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.75e-289Initial program 76.9%
associate-*r/79.3%
clear-num79.3%
metadata-eval79.3%
associate-*l*79.3%
Applied egg-rr80.0%
*-commutative80.0%
Applied egg-rr70.9%
Taylor expanded in l around 0 38.3%
associate-*r*41.5%
times-frac42.9%
associate-/l*43.7%
unpow243.7%
unpow243.7%
unpow243.7%
times-frac54.3%
swap-sqr69.1%
associate-*r/67.6%
associate-*r/67.7%
unpow267.7%
*-commutative67.7%
associate-*l*67.7%
*-commutative67.7%
associate-*l/68.5%
associate-/l*68.5%
unpow268.5%
Simplified70.1%
if -1.75e-289 < d Initial program 63.1%
associate-*r/64.9%
clear-num64.9%
metadata-eval64.9%
associate-*l*64.9%
Applied egg-rr64.2%
*-commutative64.2%
Applied egg-rr56.2%
associate-*l/56.2%
*-un-lft-identity56.2%
*-commutative56.2%
associate-*r*56.2%
metadata-eval56.2%
associate-*r/55.5%
*-commutative55.5%
associate-*r/56.2%
Applied egg-rr56.2%
Applied egg-rr70.8%
*-lft-identity70.8%
associate-*l/73.1%
associate-/l*72.3%
Simplified77.1%
Final simplification73.6%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.1e+155)
(sqrt (* (/ d l) (/ d h)))
(if (<= l -2.5e-229)
(* d (- (sqrt (/ 1.0 (* l h)))))
(if (<= l 3.8e-298)
(/ 1.0 (/ (sqrt (* l h)) d))
(/ (/ d (sqrt l)) (sqrt h))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.1e+155) {
tmp = sqrt(((d / l) * (d / h)));
} else if (l <= -2.5e-229) {
tmp = d * -sqrt((1.0 / (l * h)));
} else if (l <= 3.8e-298) {
tmp = 1.0 / (sqrt((l * h)) / d);
} else {
tmp = (d / sqrt(l)) / sqrt(h);
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.1d+155)) then
tmp = sqrt(((d / l) * (d / h)))
else if (l <= (-2.5d-229)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else if (l <= 3.8d-298) then
tmp = 1.0d0 / (sqrt((l * h)) / d)
else
tmp = (d / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.1e+155) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (l <= -2.5e-229) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else if (l <= 3.8e-298) {
tmp = 1.0 / (Math.sqrt((l * h)) / d);
} else {
tmp = (d / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2.1e+155: tmp = math.sqrt(((d / l) * (d / h))) elif l <= -2.5e-229: tmp = d * -math.sqrt((1.0 / (l * h))) elif l <= 3.8e-298: tmp = 1.0 / (math.sqrt((l * h)) / d) else: tmp = (d / math.sqrt(l)) / math.sqrt(h) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.1e+155) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (l <= -2.5e-229) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 3.8e-298) tmp = Float64(1.0 / Float64(sqrt(Float64(l * h)) / d)); else tmp = Float64(Float64(d / sqrt(l)) / sqrt(h)); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2.1e+155)
tmp = sqrt(((d / l) * (d / h)));
elseif (l <= -2.5e-229)
tmp = d * -sqrt((1.0 / (l * h)));
elseif (l <= 3.8e-298)
tmp = 1.0 / (sqrt((l * h)) / d);
else
tmp = (d / sqrt(l)) / sqrt(h);
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.1e+155], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -2.5e-229], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 3.8e-298], N[(1.0 / N[(N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.1 \cdot 10^{+155}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -2.5 \cdot 10^{-229}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-298}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2.1e155Initial program 62.8%
Simplified65.6%
Taylor expanded in M around 0 48.9%
pow1/249.0%
metadata-eval49.0%
*-rgt-identity49.0%
pow1/249.0%
metadata-eval49.0%
pow-prod-down46.4%
metadata-eval46.4%
unpow1/246.4%
Applied egg-rr46.4%
if -2.1e155 < l < -2.50000000000000008e-229Initial program 71.5%
associate-*r/75.0%
clear-num75.1%
metadata-eval75.1%
associate-*l*75.1%
Applied egg-rr76.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.7%
neg-mul-148.7%
Simplified48.7%
if -2.50000000000000008e-229 < l < 3.8e-298Initial program 89.9%
Simplified89.9%
Taylor expanded in M around 0 25.2%
pow1/225.2%
metadata-eval25.2%
*-rgt-identity25.2%
pow1/225.2%
metadata-eval25.2%
pow-prod-down25.2%
metadata-eval25.2%
unpow1/225.2%
Applied egg-rr25.2%
associate-*l/25.2%
Applied egg-rr25.2%
associate-*l/25.2%
frac-times25.1%
unpow225.1%
sqrt-div25.1%
sqrt-pow160.5%
metadata-eval60.5%
pow160.5%
clear-num60.5%
*-commutative60.5%
Applied egg-rr60.5%
if 3.8e-298 < l Initial program 67.5%
Simplified66.7%
Taylor expanded in M around 0 37.5%
pow1/237.5%
metadata-eval37.5%
*-rgt-identity37.5%
pow1/237.5%
metadata-eval37.5%
pow-prod-down30.5%
metadata-eval30.5%
unpow1/230.5%
Applied egg-rr30.5%
associate-*l/25.7%
Applied egg-rr25.7%
sqrt-div30.1%
clear-num30.1%
associate-*r/23.7%
unpow223.7%
sqrt-div32.7%
sqrt-pow146.2%
metadata-eval46.2%
pow146.2%
Applied egg-rr46.2%
associate-/r/46.9%
times-frac47.8%
*-lft-identity47.8%
associate-/l/47.0%
Simplified47.0%
Final simplification48.5%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -9e-227) (* (pow (/ d h) 0.5) (sqrt (/ d l))) (if (<= l -1e-309) (/ d (sqrt (* l h))) (/ (/ d (sqrt l)) (sqrt h)))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9e-227) {
tmp = pow((d / h), 0.5) * sqrt((d / l));
} else if (l <= -1e-309) {
tmp = d / sqrt((l * h));
} else {
tmp = (d / sqrt(l)) / sqrt(h);
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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-227)) then
tmp = ((d / h) ** 0.5d0) * sqrt((d / l))
else if (l <= (-1d-309)) then
tmp = d / sqrt((l * h))
else
tmp = (d / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -9e-227) {
tmp = Math.pow((d / h), 0.5) * Math.sqrt((d / l));
} else if (l <= -1e-309) {
tmp = d / Math.sqrt((l * h));
} else {
tmp = (d / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -9e-227: tmp = math.pow((d / h), 0.5) * math.sqrt((d / l)) elif l <= -1e-309: tmp = d / math.sqrt((l * h)) else: tmp = (d / math.sqrt(l)) / math.sqrt(h) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -9e-227) tmp = Float64((Float64(d / h) ^ 0.5) * sqrt(Float64(d / l))); elseif (l <= -1e-309) tmp = Float64(d / sqrt(Float64(l * h))); else tmp = Float64(Float64(d / sqrt(l)) / sqrt(h)); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -9e-227)
tmp = ((d / h) ^ 0.5) * sqrt((d / l));
elseif (l <= -1e-309)
tmp = d / sqrt((l * h));
else
tmp = (d / sqrt(l)) / sqrt(h);
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-227], N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-227}:\\
\;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -8.99999999999999986e-227Initial program 69.6%
Simplified71.2%
Taylor expanded in M around 0 47.5%
pow1/247.5%
Applied egg-rr47.5%
if -8.99999999999999986e-227 < l < -1.000000000000002e-309Initial program 89.3%
Simplified89.3%
Taylor expanded in M around 0 21.4%
pow1/221.4%
metadata-eval21.4%
*-rgt-identity21.4%
pow1/221.4%
metadata-eval21.4%
pow-prod-down21.4%
metadata-eval21.4%
unpow1/221.4%
Applied egg-rr21.4%
associate-*l/21.4%
Applied egg-rr21.4%
associate-*l/21.4%
frac-times21.3%
unpow221.3%
sqrt-div21.3%
sqrt-pow158.5%
metadata-eval58.5%
pow158.5%
*-commutative58.5%
Applied egg-rr58.5%
if -1.000000000000002e-309 < l Initial program 67.2%
Simplified66.4%
Taylor expanded in M around 0 37.7%
pow1/237.7%
metadata-eval37.7%
*-rgt-identity37.7%
pow1/237.7%
metadata-eval37.7%
pow-prod-down30.9%
metadata-eval30.9%
unpow1/230.9%
Applied egg-rr30.9%
associate-*l/26.1%
Applied egg-rr26.1%
sqrt-div30.5%
clear-num30.4%
associate-*r/24.1%
unpow224.1%
sqrt-div33.0%
sqrt-pow146.3%
metadata-eval46.3%
pow146.3%
Applied egg-rr46.3%
associate-/r/47.0%
times-frac47.8%
*-lft-identity47.8%
associate-/l/47.0%
Simplified47.0%
Final simplification48.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -2.2e-227) (* (sqrt (/ d h)) (sqrt (/ d l))) (if (<= l 2e-309) (/ d (sqrt (* l h))) (/ (/ d (sqrt l)) (sqrt h)))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.2e-227) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= 2e-309) {
tmp = d / sqrt((l * h));
} else {
tmp = (d / sqrt(l)) / sqrt(h);
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.2d-227)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= 2d-309) then
tmp = d / sqrt((l * h))
else
tmp = (d / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.2e-227) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= 2e-309) {
tmp = d / Math.sqrt((l * h));
} else {
tmp = (d / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -2.2e-227: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= 2e-309: tmp = d / math.sqrt((l * h)) else: tmp = (d / math.sqrt(l)) / math.sqrt(h) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.2e-227) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= 2e-309) tmp = Float64(d / sqrt(Float64(l * h))); else tmp = Float64(Float64(d / sqrt(l)) / sqrt(h)); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -2.2e-227)
tmp = sqrt((d / h)) * sqrt((d / l));
elseif (l <= 2e-309)
tmp = d / sqrt((l * h));
else
tmp = (d / sqrt(l)) / sqrt(h);
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.2e-227], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2e-309], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.2 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2.19999999999999981e-227Initial program 69.6%
Simplified71.2%
Taylor expanded in M around 0 47.5%
*-rgt-identity47.5%
Applied egg-rr47.5%
*-commutative47.5%
Simplified47.5%
if -2.19999999999999981e-227 < l < 1.9999999999999988e-309Initial program 89.3%
Simplified89.3%
Taylor expanded in M around 0 21.4%
pow1/221.4%
metadata-eval21.4%
*-rgt-identity21.4%
pow1/221.4%
metadata-eval21.4%
pow-prod-down21.4%
metadata-eval21.4%
unpow1/221.4%
Applied egg-rr21.4%
associate-*l/21.4%
Applied egg-rr21.4%
associate-*l/21.4%
frac-times21.3%
unpow221.3%
sqrt-div21.3%
sqrt-pow158.5%
metadata-eval58.5%
pow158.5%
*-commutative58.5%
Applied egg-rr58.5%
if 1.9999999999999988e-309 < l Initial program 67.2%
Simplified66.4%
Taylor expanded in M around 0 37.7%
pow1/237.7%
metadata-eval37.7%
*-rgt-identity37.7%
pow1/237.7%
metadata-eval37.7%
pow-prod-down30.9%
metadata-eval30.9%
unpow1/230.9%
Applied egg-rr30.9%
associate-*l/26.1%
Applied egg-rr26.1%
sqrt-div30.5%
clear-num30.4%
associate-*r/24.1%
unpow224.1%
sqrt-div33.0%
sqrt-pow146.3%
metadata-eval46.3%
pow146.3%
Applied egg-rr46.3%
associate-/r/47.0%
times-frac47.8%
*-lft-identity47.8%
associate-/l/47.0%
Simplified47.0%
Final simplification48.1%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(if (<= l -1e+156)
(sqrt (* (/ d l) (/ d h)))
(if (<= l -3.2e-227)
(* d (- (sqrt (/ 1.0 (* l h)))))
(/ d (sqrt (* l h))))))assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e+156) {
tmp = sqrt(((d / l) * (d / h)));
} else if (l <= -3.2e-227) {
tmp = d * -sqrt((1.0 / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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 <= (-1d+156)) then
tmp = sqrt(((d / l) * (d / h)))
else if (l <= (-3.2d-227)) then
tmp = d * -sqrt((1.0d0 / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1e+156) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else if (l <= -3.2e-227) {
tmp = d * -Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -1e+156: tmp = math.sqrt(((d / l) * (d / h))) elif l <= -3.2e-227: tmp = d * -math.sqrt((1.0 / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -1e+156) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); elseif (l <= -3.2e-227) tmp = Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -1e+156)
tmp = sqrt(((d / l) * (d / h)));
elseif (l <= -3.2e-227)
tmp = d * -sqrt((1.0 / (l * h)));
else
tmp = d / sqrt((l * h));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1e+156], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -3.2e-227], N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{+156}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -3.2 \cdot 10^{-227}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -9.9999999999999998e155Initial program 62.8%
Simplified65.6%
Taylor expanded in M around 0 48.9%
pow1/249.0%
metadata-eval49.0%
*-rgt-identity49.0%
pow1/249.0%
metadata-eval49.0%
pow-prod-down46.4%
metadata-eval46.4%
unpow1/246.4%
Applied egg-rr46.4%
if -9.9999999999999998e155 < l < -3.2000000000000001e-227Initial program 72.4%
associate-*r/75.9%
clear-num76.0%
metadata-eval76.0%
associate-*l*76.0%
Applied egg-rr77.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt49.3%
neg-mul-149.3%
Simplified49.3%
if -3.2000000000000001e-227 < l Initial program 70.2%
Simplified69.6%
Taylor expanded in M around 0 35.5%
pow1/235.5%
metadata-eval35.5%
*-rgt-identity35.5%
pow1/235.5%
metadata-eval35.5%
pow-prod-down29.6%
metadata-eval29.6%
unpow1/229.6%
Applied egg-rr29.6%
associate-*l/25.5%
Applied egg-rr25.5%
associate-*l/29.6%
frac-times23.7%
unpow223.7%
sqrt-div29.2%
sqrt-pow145.7%
metadata-eval45.7%
pow145.7%
*-commutative45.7%
Applied egg-rr45.7%
Final simplification46.9%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (if (<= l -1.48e-227) (sqrt (* (/ d l) (/ d h))) (/ d (sqrt (* l h)))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.48e-227) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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.48d-227)) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.48e-227) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): tmp = 0 if l <= -1.48e-227: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d / math.sqrt((l * h)) return tmp
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.48e-227) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
tmp = 0.0;
if (l <= -1.48e-227)
tmp = sqrt(((d / l) * (d / h)));
else
tmp = d / sqrt((l * h));
end
tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.48e-227], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.48 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.48e-227Initial program 69.6%
Simplified71.2%
Taylor expanded in M around 0 47.5%
pow1/247.5%
metadata-eval47.5%
*-rgt-identity47.5%
pow1/247.5%
metadata-eval47.5%
pow-prod-down43.6%
metadata-eval43.6%
unpow1/243.6%
Applied egg-rr43.6%
if -1.48e-227 < l Initial program 70.2%
Simplified69.6%
Taylor expanded in M around 0 35.5%
pow1/235.5%
metadata-eval35.5%
*-rgt-identity35.5%
pow1/235.5%
metadata-eval35.5%
pow-prod-down29.6%
metadata-eval29.6%
unpow1/229.6%
Applied egg-rr29.6%
associate-*l/25.5%
Applied egg-rr25.5%
associate-*l/29.6%
frac-times23.7%
unpow223.7%
sqrt-div29.2%
sqrt-pow145.7%
metadata-eval45.7%
pow145.7%
*-commutative45.7%
Applied egg-rr45.7%
Final simplification44.7%
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
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
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
[d, h, l, M, D] = sort([d, h, l, M, D]) def code(d, h, l, M, D): return d / math.sqrt((l * h))
d, h, l, M, D = sort([d, h, l, M, D]) function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp = code(d, h, l, M, D)
tmp = d / sqrt((l * h));
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 69.9%
Simplified70.3%
Taylor expanded in M around 0 40.9%
pow1/240.9%
metadata-eval40.9%
*-rgt-identity40.9%
pow1/240.9%
metadata-eval40.9%
pow-prod-down35.9%
metadata-eval35.9%
unpow1/235.9%
Applied egg-rr35.9%
associate-*l/29.7%
Applied egg-rr29.7%
associate-*l/35.9%
frac-times24.9%
unpow224.9%
sqrt-div28.6%
sqrt-pow127.4%
metadata-eval27.4%
pow127.4%
*-commutative27.4%
Applied egg-rr27.4%
herbie shell --seed 2024096
(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)))))