
(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}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -5e-309)
(*
(/ t_0 (sqrt (- l)))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5)))))
(if (<= l 1e+117)
(*
(/ (sqrt d) (sqrt h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (/ (* h (pow (/ (* M D) (/ d 0.5)) 2.0)) l)))))
(*
(fma (pow (* (/ D d) (* M -0.5)) 2.0) (* h (/ -0.5 l)) 1.0)
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -5e-309) {
tmp = (t_0 / sqrt(-l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else if (l <= 1e+117) {
tmp = (sqrt(d) / sqrt(h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h * pow(((M * D) / (d / 0.5)), 2.0)) / l))));
} else {
tmp = fma(pow(((D / d) * (M * -0.5)), 2.0), (h * (-0.5 / l)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -5e-309) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))))); elseif (l <= 1e+117) tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * D) / Float64(d / 0.5)) ^ 2.0)) / l))))); else tmp = Float64(fma((Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0), Float64(h * Float64(-0.5 / l)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -5e-309], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+117], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d / 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-309}:\\
\;\;\;\;\frac{t_0}{\sqrt{-\ell}} \cdot \left(\frac{t_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 10^{+117}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{M \cdot D}{\frac{d}{0.5}}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}, h \cdot \frac{-0.5}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.9999999999999995e-309Initial program 73.0%
Simplified73.0%
frac-2neg73.0%
sqrt-div74.5%
Applied egg-rr74.5%
frac-2neg74.5%
sqrt-div87.6%
Applied egg-rr87.6%
if -4.9999999999999995e-309 < l < 1.00000000000000005e117Initial program 69.7%
Simplified68.7%
frac-times69.7%
associate-/r*69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
associate-*r/75.4%
associate-/l*75.4%
Applied egg-rr75.4%
sqrt-div88.8%
div-inv88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
Simplified88.8%
if 1.00000000000000005e117 < l Initial program 59.4%
Simplified59.4%
Applied egg-rr36.9%
expm1-def65.1%
expm1-log1p79.6%
associate-/r/79.7%
Simplified79.7%
Final simplification86.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0))))))
(t_2 (sqrt (/ d h))))
(if (<= t_1 -1e-203)
(*
(* t_0 (- 1.0 (* 0.5 (* (/ h l) (pow (/ (* 0.5 (* M D)) d) 2.0)))))
t_2)
(if (or (<= t_1 5e-260) (not (<= t_1 2e+268)))
(fabs (* d (pow (* l h) -0.5)))
(*
t_2
(*
t_0
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))));
double t_2 = sqrt((d / h));
double tmp;
if (t_1 <= -1e-203) {
tmp = (t_0 * (1.0 - (0.5 * ((h / l) * pow(((0.5 * (M * D)) / d), 2.0))))) * t_2;
} else if ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
t_2 = sqrt((d / h))
if (t_1 <= (-1d-203)) then
tmp = (t_0 * (1.0d0 - (0.5d0 * ((h / l) * (((0.5d0 * (m * d_1)) / d) ** 2.0d0))))) * t_2
else if ((t_1 <= 5d-260) .or. (.not. (t_1 <= 2d+268))) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = t_2 * (t_0 * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (d_1 / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))));
double t_2 = Math.sqrt((d / h));
double tmp;
if (t_1 <= -1e-203) {
tmp = (t_0 * (1.0 - (0.5 * ((h / l) * Math.pow(((0.5 * (M * D)) / d), 2.0))))) * t_2;
} else if ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)))) t_2 = math.sqrt((d / h)) tmp = 0 if t_1 <= -1e-203: tmp = (t_0 * (1.0 - (0.5 * ((h / l) * math.pow(((0.5 * (M * D)) / d), 2.0))))) * t_2 elif (t_1 <= 5e-260) or not (t_1 <= 2e+268): tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (t_1 <= -1e-203) tmp = Float64(Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(0.5 * Float64(M * D)) / d) ^ 2.0))))) * t_2); elseif ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(t_2 * Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0)))); t_2 = sqrt((d / h)); tmp = 0.0; if (t_1 <= -1e-203) tmp = (t_0 * (1.0 - (0.5 * ((h / l) * (((0.5 * (M * D)) / d) ^ 2.0))))) * t_2; elseif ((t_1 <= 5e-260) || ~((t_1 <= 2e+268))) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -1e-203], N[(N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[Or[LessEqual[t$95$1, 5e-260], N[Not[LessEqual[t$95$1, 2e+268]], $MachinePrecision]], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;\left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{0.5 \cdot \left(M \cdot D\right)}{d}\right)}^{2}\right)\right)\right) \cdot t_2\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-260} \lor \neg \left(t_1 \leq 2 \cdot 10^{+268}\right):\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -1e-203Initial program 91.2%
Simplified90.2%
frac-times91.3%
associate-/r*91.3%
div-inv91.3%
metadata-eval91.3%
Applied egg-rr91.3%
if -1e-203 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 5.0000000000000003e-260 or 1.9999999999999999e268 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 30.0%
Simplified30.0%
Taylor expanded in d around inf 39.3%
expm1-log1p-u38.7%
expm1-udef29.5%
inv-pow29.5%
sqrt-pow129.5%
metadata-eval29.5%
Applied egg-rr29.5%
expm1-def38.7%
expm1-log1p39.3%
Simplified39.3%
add-sqr-sqrt38.5%
sqrt-unprod41.8%
pow241.8%
*-commutative41.8%
Applied egg-rr41.8%
unpow241.8%
rem-sqrt-square63.1%
Simplified63.1%
if 5.0000000000000003e-260 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.9999999999999999e268Initial program 99.4%
Simplified99.4%
frac-times99.4%
associate-/r*99.4%
div-inv99.4%
metadata-eval99.4%
Applied egg-rr99.4%
associate-*r/99.4%
associate-/l*99.4%
Applied egg-rr99.4%
Applied egg-rr48.8%
expm1-def94.9%
expm1-log1p97.9%
Simplified97.9%
Final simplification82.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0))))))
(t_2 (sqrt (/ d h))))
(if (<= t_1 -1e-203)
(*
t_2
(*
t_0
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M -0.5)) (sqrt (/ h l))) 2.0)))))
(if (or (<= t_1 5e-260) (not (<= t_1 2e+268)))
(fabs (* d (pow (* l h) -0.5)))
(*
t_2
(*
t_0
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))));
double t_2 = sqrt((d / h));
double tmp;
if (t_1 <= -1e-203) {
tmp = t_2 * (t_0 * (1.0 - (0.5 * pow((((D / d) * (M * -0.5)) * sqrt((h / l))), 2.0))));
} else if ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
t_2 = sqrt((d / h))
if (t_1 <= (-1d-203)) then
tmp = t_2 * (t_0 * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m * (-0.5d0))) * sqrt((h / l))) ** 2.0d0))))
else if ((t_1 <= 5d-260) .or. (.not. (t_1 <= 2d+268))) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = t_2 * (t_0 * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (d_1 / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0))));
double t_2 = Math.sqrt((d / h));
double tmp;
if (t_1 <= -1e-203) {
tmp = t_2 * (t_0 * (1.0 - (0.5 * Math.pow((((D / d) * (M * -0.5)) * Math.sqrt((h / l))), 2.0))));
} else if ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)))) t_2 = math.sqrt((d / h)) tmp = 0 if t_1 <= -1e-203: tmp = t_2 * (t_0 * (1.0 - (0.5 * math.pow((((D / d) * (M * -0.5)) * math.sqrt((h / l))), 2.0)))) elif (t_1 <= 5e-260) or not (t_1 <= 2e+268): tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0))))) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (t_1 <= -1e-203) tmp = Float64(t_2 * Float64(t_0 * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * -0.5)) * sqrt(Float64(h / l))) ^ 2.0))))); elseif ((t_1 <= 5e-260) || !(t_1 <= 2e+268)) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(t_2 * Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0)))); t_2 = sqrt((d / h)); tmp = 0.0; if (t_1 <= -1e-203) tmp = t_2 * (t_0 * (1.0 - (0.5 * ((((D / d) * (M * -0.5)) * sqrt((h / l))) ^ 2.0)))); elseif ((t_1 <= 5e-260) || ~((t_1 <= 2e+268))) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = t_2 * (t_0 * (1.0 + (-0.5 * ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -1e-203], N[(t$95$2 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 5e-260], N[Not[LessEqual[t$95$1, 2e+268]], $MachinePrecision]], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-260} \lor \neg \left(t_1 \leq 2 \cdot 10^{+268}\right):\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -1e-203Initial program 91.2%
Simplified90.2%
add-sqr-sqrt90.1%
pow290.1%
Applied egg-rr92.2%
if -1e-203 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 5.0000000000000003e-260 or 1.9999999999999999e268 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 30.0%
Simplified30.0%
Taylor expanded in d around inf 39.3%
expm1-log1p-u38.7%
expm1-udef29.5%
inv-pow29.5%
sqrt-pow129.5%
metadata-eval29.5%
Applied egg-rr29.5%
expm1-def38.7%
expm1-log1p39.3%
Simplified39.3%
add-sqr-sqrt38.5%
sqrt-unprod41.8%
pow241.8%
*-commutative41.8%
Applied egg-rr41.8%
unpow241.8%
rem-sqrt-square63.1%
Simplified63.1%
if 5.0000000000000003e-260 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 1.9999999999999999e268Initial program 99.4%
Simplified99.4%
frac-times99.4%
associate-/r*99.4%
div-inv99.4%
metadata-eval99.4%
Applied egg-rr99.4%
associate-*r/99.4%
associate-/l*99.4%
Applied egg-rr99.4%
Applied egg-rr48.8%
expm1-def94.9%
expm1-log1p97.9%
Simplified97.9%
Final simplification82.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -5e-309)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))))
(if (<= l 5e+117)
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ (* M D) (/ d 0.5)) 2.0)) l)))))
(*
(fma (pow (* (/ D d) (* M -0.5)) 2.0) (* h (/ -0.5 l)) 1.0)
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -5e-309) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))));
} else if (l <= 5e+117) {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * pow(((M * D) / (d / 0.5)), 2.0)) / l))));
} else {
tmp = fma(pow(((D / d) * (M * -0.5)), 2.0), (h * (-0.5 / l)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -5e-309) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))))); elseif (l <= 5e+117) tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * D) / Float64(d / 0.5)) ^ 2.0)) / l))))); else tmp = Float64(fma((Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0), Float64(h * Float64(-0.5 / l)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5e-309], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e+117], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d / 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{M \cdot D}{\frac{d}{0.5}}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}, h \cdot \frac{-0.5}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.9999999999999995e-309Initial program 73.0%
Simplified73.0%
frac-2neg74.5%
sqrt-div87.6%
Applied egg-rr85.3%
if -4.9999999999999995e-309 < l < 4.99999999999999983e117Initial program 69.7%
Simplified68.7%
frac-times69.7%
associate-/r*69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
associate-*r/75.4%
associate-/l*75.4%
Applied egg-rr75.4%
sqrt-div88.8%
div-inv88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
Simplified88.8%
if 4.99999999999999983e117 < l Initial program 59.4%
Simplified59.4%
Applied egg-rr36.9%
expm1-def65.1%
expm1-log1p79.6%
associate-/r/79.7%
Simplified79.7%
Final simplification85.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -5e-309)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (- 1.0 (* 0.5 (* (/ h l) (pow (/ (* 0.5 (* M D)) d) 2.0))))))
(if (<= l 3.05e+116)
(*
(/ (sqrt d) (sqrt h))
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ (* M D) (/ d 0.5)) 2.0)) l)))))
(*
(fma (pow (* (/ D d) (* M -0.5)) 2.0) (* h (/ -0.5 l)) 1.0)
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -5e-309) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (1.0 - (0.5 * ((h / l) * pow(((0.5 * (M * D)) / d), 2.0)))));
} else if (l <= 3.05e+116) {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (1.0 - (0.5 * ((h * pow(((M * D) / (d / 0.5)), 2.0)) / l))));
} else {
tmp = fma(pow(((D / d) * (M * -0.5)), 2.0), (h * (-0.5 / l)), 1.0) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -5e-309) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(0.5 * Float64(M * D)) / d) ^ 2.0)))))); elseif (l <= 3.05e+116) tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * D) / Float64(d / 0.5)) ^ 2.0)) / l))))); else tmp = Float64(fma((Float64(Float64(D / d) * Float64(M * -0.5)) ^ 2.0), Float64(h * Float64(-0.5 / l)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5e-309], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.05e+116], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d / 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * -0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{0.5 \cdot \left(M \cdot D\right)}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+116}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{M \cdot D}{\frac{d}{0.5}}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{D}{d} \cdot \left(M \cdot -0.5\right)\right)}^{2}, h \cdot \frac{-0.5}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.9999999999999995e-309Initial program 73.0%
Simplified73.0%
frac-times73.0%
associate-/r*73.0%
div-inv73.0%
metadata-eval73.0%
Applied egg-rr73.0%
frac-2neg74.5%
sqrt-div87.6%
Applied egg-rr84.6%
if -4.9999999999999995e-309 < l < 3.05000000000000009e116Initial program 69.7%
Simplified68.7%
frac-times69.7%
associate-/r*69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
associate-*r/75.4%
associate-/l*75.4%
Applied egg-rr75.4%
sqrt-div88.8%
div-inv88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
Simplified88.8%
if 3.05000000000000009e116 < l Initial program 59.4%
Simplified59.4%
Applied egg-rr36.9%
expm1-def65.1%
expm1-log1p79.6%
associate-/r/79.7%
Simplified79.7%
Final simplification85.3%
(FPCore (d h l M D)
:precision binary64
(if (<= D 1.45e-8)
(fabs (* d (pow (* l h) -0.5)))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* -0.5 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.45e-8) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + (-0.5 * ((h / l) * pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.45d-8) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((-0.5d0) * ((h / l) * (((m / d) * (d_1 / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.45e-8) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + (-0.5 * ((h / l) * Math.pow(((M / d) * (D / 2.0)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 1.45e-8: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + (-0.5 * ((h / l) * math.pow(((M / d) * (D / 2.0)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 1.45e-8) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 1.45e-8) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + (-0.5 * ((h / l) * (((M / d) * (D / 2.0)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 1.45e-8], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.45 \cdot 10^{-8}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if D < 1.4500000000000001e-8Initial program 68.3%
Simplified67.2%
Taylor expanded in d around inf 29.8%
expm1-log1p-u29.2%
expm1-udef19.0%
inv-pow19.0%
sqrt-pow119.0%
metadata-eval19.0%
Applied egg-rr19.0%
expm1-def29.2%
expm1-log1p29.8%
Simplified29.8%
add-sqr-sqrt28.3%
sqrt-unprod39.2%
pow239.2%
*-commutative39.2%
Applied egg-rr39.2%
unpow239.2%
rem-sqrt-square52.9%
Simplified52.9%
if 1.4500000000000001e-8 < D Initial program 73.8%
Simplified73.9%
frac-times73.9%
associate-/r*73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
associate-*r/72.6%
associate-/l*72.6%
Applied egg-rr72.6%
Applied egg-rr13.0%
expm1-def27.0%
expm1-log1p73.9%
Simplified73.9%
Final simplification58.4%
(FPCore (d h l M D)
:precision binary64
(if (<= D 1.42e-8)
(fabs (* d (pow (* l h) -0.5)))
(*
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))
(sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0))))) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.42d-8) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (((m / 2.0d0) * (d_1 / d)) ** 2.0d0))))) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0))))) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 1.42e-8: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0))))) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 1.42e-8) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0))))) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 1.42e-8) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0))))) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 1.42e-8], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.42 \cdot 10^{-8}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if D < 1.41999999999999998e-8Initial program 68.3%
Simplified67.2%
Taylor expanded in d around inf 29.8%
expm1-log1p-u29.2%
expm1-udef19.0%
inv-pow19.0%
sqrt-pow119.0%
metadata-eval19.0%
Applied egg-rr19.0%
expm1-def29.2%
expm1-log1p29.8%
Simplified29.8%
add-sqr-sqrt28.3%
sqrt-unprod39.2%
pow239.2%
*-commutative39.2%
Applied egg-rr39.2%
unpow239.2%
rem-sqrt-square52.9%
Simplified52.9%
if 1.41999999999999998e-8 < D Initial program 73.8%
Simplified73.9%
Final simplification58.4%
(FPCore (d h l M D)
:precision binary64
(if (<= D 1.42e-8)
(fabs (* d (pow (* l h) -0.5)))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* (/ h l) (pow (/ (* M -0.5) (/ d D)) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * pow(((M * -0.5) / (d / D)), 2.0)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d_1 <= 1.42d-8) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((h / l) * (((m * (-0.5d0)) / (d / d_1)) ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 1.42e-8) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * Math.pow(((M * -0.5) / (d / D)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 1.42e-8: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * math.pow(((M * -0.5) / (d / D)), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 1.42e-8) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M * -0.5) / Float64(d / D)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 1.42e-8) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((h / l) * (((M * -0.5) / (d / D)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 1.42e-8], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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[Power[N[(N[(M * -0.5), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.42 \cdot 10^{-8}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M \cdot -0.5}{\frac{d}{D}}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if D < 1.41999999999999998e-8Initial program 68.3%
Simplified67.2%
Taylor expanded in d around inf 29.8%
expm1-log1p-u29.2%
expm1-udef19.0%
inv-pow19.0%
sqrt-pow119.0%
metadata-eval19.0%
Applied egg-rr19.0%
expm1-def29.2%
expm1-log1p29.8%
Simplified29.8%
add-sqr-sqrt28.3%
sqrt-unprod39.2%
pow239.2%
*-commutative39.2%
Applied egg-rr39.2%
unpow239.2%
rem-sqrt-square52.9%
Simplified52.9%
if 1.41999999999999998e-8 < D Initial program 73.8%
Simplified73.9%
clear-num73.9%
un-div-inv73.9%
add-sqr-sqrt36.3%
sqrt-unprod69.6%
pow269.6%
pow269.6%
div-inv69.6%
div-inv69.6%
swap-sqr69.6%
metadata-eval69.6%
metadata-eval69.6%
metadata-eval69.6%
metadata-eval69.6%
swap-sqr69.6%
*-commutative69.6%
*-commutative69.6%
sqrt-unprod37.5%
add-sqr-sqrt73.9%
*-commutative73.9%
Applied egg-rr73.9%
Final simplification58.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6e-84)
(fabs (* d (pow (* l h) -0.5)))
(if (<= d 1.95e-306)
(* d (sqrt (log (exp (/ (/ 1.0 h) l)))))
(if (<= d 8.6e+25)
(* (/ (* -0.125 (pow (* M D) 2.0)) d) (sqrt (* h (pow l -3.0))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6e-84) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * sqrt(log(exp(((1.0 / h) / l))));
} else if (d <= 8.6e+25) {
tmp = ((-0.125 * pow((M * D), 2.0)) / d) * sqrt((h * pow(l, -3.0)));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-6d-84)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (d <= 1.95d-306) then
tmp = d * sqrt(log(exp(((1.0d0 / h) / l))))
else if (d <= 8.6d+25) then
tmp = (((-0.125d0) * ((m * d_1) ** 2.0d0)) / d) * sqrt((h * (l ** (-3.0d0))))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6e-84) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / h) / l))));
} else if (d <= 8.6e+25) {
tmp = ((-0.125 * Math.pow((M * D), 2.0)) / d) * Math.sqrt((h * Math.pow(l, -3.0)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -6e-84: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif d <= 1.95e-306: tmp = d * math.sqrt(math.log(math.exp(((1.0 / h) / l)))) elif d <= 8.6e+25: tmp = ((-0.125 * math.pow((M * D), 2.0)) / d) * math.sqrt((h * math.pow(l, -3.0))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6e-84) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / h) / l))))); elseif (d <= 8.6e+25) tmp = Float64(Float64(Float64(-0.125 * (Float64(M * D) ^ 2.0)) / d) * sqrt(Float64(h * (l ^ -3.0)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -6e-84) tmp = abs((d * ((l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = d * sqrt(log(exp(((1.0 / h) / l)))); elseif (d <= 8.6e+25) tmp = ((-0.125 * ((M * D) ^ 2.0)) / d) * sqrt((h * (l ^ -3.0))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6e-84], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, 1.95e-306], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.6e+25], N[(N[(N[(-0.125 * N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6 \cdot 10^{-84}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;d \leq 1.95 \cdot 10^{-306}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{h}}{\ell}}\right)}\\
\mathbf{elif}\;d \leq 8.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{-0.125 \cdot {\left(M \cdot D\right)}^{2}}{d} \cdot \sqrt{h \cdot {\ell}^{-3}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.0000000000000002e-84Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -6.0000000000000002e-84 < d < 1.95e-306Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 15.0%
add-log-exp39.5%
associate-/r*39.5%
Applied egg-rr39.5%
if 1.95e-306 < d < 8.59999999999999996e25Initial program 60.4%
Simplified60.4%
Taylor expanded in d around 0 39.3%
associate-*r*39.3%
*-commutative39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
swap-sqr46.3%
unpow246.3%
associate-*r/46.3%
*-commutative46.3%
Simplified46.3%
pow1/246.3%
add-sqr-sqrt46.3%
sqrt-pow146.3%
div-inv46.3%
pow-flip46.3%
metadata-eval46.3%
metadata-eval46.3%
sqrt-pow146.3%
div-inv46.3%
pow-flip46.3%
metadata-eval46.3%
metadata-eval46.3%
Applied egg-rr46.3%
pow-sqr46.3%
metadata-eval46.3%
unpow1/246.3%
Simplified46.3%
if 8.59999999999999996e25 < d Initial program 72.4%
Simplified72.4%
Taylor expanded in d around inf 60.4%
associate-/r*61.7%
sqrt-div66.6%
Applied egg-rr66.6%
Final simplification56.1%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.9e-84)
(fabs (* d (pow (* l h) -0.5)))
(if (<= d 1.95e-306)
(* d (sqrt (log (exp (/ (/ 1.0 h) l)))))
(if (<= d 5.3e+26)
(* (sqrt (/ h (pow l 3.0))) (/ (* -0.125 (pow (* M D) 2.0)) d))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.9e-84) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * sqrt(log(exp(((1.0 / h) / l))));
} else if (d <= 5.3e+26) {
tmp = sqrt((h / pow(l, 3.0))) * ((-0.125 * pow((M * D), 2.0)) / d);
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.9d-84)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (d <= 1.95d-306) then
tmp = d * sqrt(log(exp(((1.0d0 / h) / l))))
else if (d <= 5.3d+26) then
tmp = sqrt((h / (l ** 3.0d0))) * (((-0.125d0) * ((m * d_1) ** 2.0d0)) / d)
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.9e-84) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / h) / l))));
} else if (d <= 5.3e+26) {
tmp = Math.sqrt((h / Math.pow(l, 3.0))) * ((-0.125 * Math.pow((M * D), 2.0)) / d);
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.9e-84: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif d <= 1.95e-306: tmp = d * math.sqrt(math.log(math.exp(((1.0 / h) / l)))) elif d <= 5.3e+26: tmp = math.sqrt((h / math.pow(l, 3.0))) * ((-0.125 * math.pow((M * D), 2.0)) / d) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.9e-84) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / h) / l))))); elseif (d <= 5.3e+26) tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(-0.125 * (Float64(M * D) ^ 2.0)) / d)); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.9e-84) tmp = abs((d * ((l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = d * sqrt(log(exp(((1.0 / h) / l)))); elseif (d <= 5.3e+26) tmp = sqrt((h / (l ^ 3.0))) * ((-0.125 * ((M * D) ^ 2.0)) / d); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.9e-84], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, 1.95e-306], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.3e+26], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.9 \cdot 10^{-84}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;d \leq 1.95 \cdot 10^{-306}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{h}}{\ell}}\right)}\\
\mathbf{elif}\;d \leq 5.3 \cdot 10^{+26}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-0.125 \cdot {\left(M \cdot D\right)}^{2}}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.89999999999999993e-84Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -1.89999999999999993e-84 < d < 1.95e-306Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 15.0%
add-log-exp39.5%
associate-/r*39.5%
Applied egg-rr39.5%
if 1.95e-306 < d < 5.29999999999999969e26Initial program 60.4%
Simplified60.4%
Taylor expanded in d around 0 39.3%
associate-*r*39.3%
*-commutative39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
swap-sqr46.3%
unpow246.3%
associate-*r/46.3%
*-commutative46.3%
Simplified46.3%
if 5.29999999999999969e26 < d Initial program 72.4%
Simplified72.4%
Taylor expanded in d around inf 60.4%
associate-/r*61.7%
sqrt-div66.6%
Applied egg-rr66.6%
Final simplification56.1%
(FPCore (d h l M D)
:precision binary64
(if (<= d -8.5e-84)
(fabs (* d (pow (* l h) -0.5)))
(if (<= d 1.95e-306)
(* d (sqrt (log (exp (/ (/ 1.0 h) l)))))
(if (<= d 2.95e+26)
(/ (* (sqrt h) -0.125) (* (pow l 1.5) (/ d (pow (* M D) 2.0))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.5e-84) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * sqrt(log(exp(((1.0 / h) / l))));
} else if (d <= 2.95e+26) {
tmp = (sqrt(h) * -0.125) / (pow(l, 1.5) * (d / pow((M * D), 2.0)));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-8.5d-84)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (d <= 1.95d-306) then
tmp = d * sqrt(log(exp(((1.0d0 / h) / l))))
else if (d <= 2.95d+26) then
tmp = (sqrt(h) * (-0.125d0)) / ((l ** 1.5d0) * (d / ((m * d_1) ** 2.0d0)))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.5e-84) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / h) / l))));
} else if (d <= 2.95e+26) {
tmp = (Math.sqrt(h) * -0.125) / (Math.pow(l, 1.5) * (d / Math.pow((M * D), 2.0)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -8.5e-84: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif d <= 1.95e-306: tmp = d * math.sqrt(math.log(math.exp(((1.0 / h) / l)))) elif d <= 2.95e+26: tmp = (math.sqrt(h) * -0.125) / (math.pow(l, 1.5) * (d / math.pow((M * D), 2.0))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -8.5e-84) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / h) / l))))); elseif (d <= 2.95e+26) tmp = Float64(Float64(sqrt(h) * -0.125) / Float64((l ^ 1.5) * Float64(d / (Float64(M * D) ^ 2.0)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -8.5e-84) tmp = abs((d * ((l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = d * sqrt(log(exp(((1.0 / h) / l)))); elseif (d <= 2.95e+26) tmp = (sqrt(h) * -0.125) / ((l ^ 1.5) * (d / ((M * D) ^ 2.0))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -8.5e-84], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, 1.95e-306], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.95e+26], N[(N[(N[Sqrt[h], $MachinePrecision] * -0.125), $MachinePrecision] / N[(N[Power[l, 1.5], $MachinePrecision] * N[(d / N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -8.5 \cdot 10^{-84}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;d \leq 1.95 \cdot 10^{-306}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{h}}{\ell}}\right)}\\
\mathbf{elif}\;d \leq 2.95 \cdot 10^{+26}:\\
\;\;\;\;\frac{\sqrt{h} \cdot -0.125}{{\ell}^{1.5} \cdot \frac{d}{{\left(M \cdot D\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -8.4999999999999994e-84Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -8.4999999999999994e-84 < d < 1.95e-306Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 15.0%
add-log-exp39.5%
associate-/r*39.5%
Applied egg-rr39.5%
if 1.95e-306 < d < 2.95000000000000015e26Initial program 60.4%
Simplified60.4%
Taylor expanded in d around 0 39.3%
associate-*r*39.3%
*-commutative39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
swap-sqr46.3%
unpow246.3%
associate-*r/46.3%
*-commutative46.3%
Simplified46.3%
sqrt-div51.2%
associate-/l*51.2%
frac-times51.2%
sqrt-pow156.5%
metadata-eval56.5%
*-commutative56.5%
Applied egg-rr56.5%
if 2.95000000000000015e26 < d Initial program 72.4%
Simplified72.4%
Taylor expanded in d around inf 60.4%
associate-/r*61.7%
sqrt-div66.6%
Applied egg-rr66.6%
Final simplification58.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.6e-83)
(fabs (* d (pow (* l h) -0.5)))
(if (<= d 1.95e-306)
(* d (sqrt (log (exp (/ (/ 1.0 h) l)))))
(if (<= d 4.7e+26)
(/ (* (/ (sqrt h) (pow l 1.5)) (* -0.125 (pow (* M D) 2.0))) d)
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.6e-83) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * sqrt(log(exp(((1.0 / h) / l))));
} else if (d <= 4.7e+26) {
tmp = ((sqrt(h) / pow(l, 1.5)) * (-0.125 * pow((M * D), 2.0))) / d;
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-6.6d-83)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (d <= 1.95d-306) then
tmp = d * sqrt(log(exp(((1.0d0 / h) / l))))
else if (d <= 4.7d+26) then
tmp = ((sqrt(h) / (l ** 1.5d0)) * ((-0.125d0) * ((m * d_1) ** 2.0d0))) / d
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.6e-83) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (d <= 1.95e-306) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / h) / l))));
} else if (d <= 4.7e+26) {
tmp = ((Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 * Math.pow((M * D), 2.0))) / d;
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -6.6e-83: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif d <= 1.95e-306: tmp = d * math.sqrt(math.log(math.exp(((1.0 / h) / l)))) elif d <= 4.7e+26: tmp = ((math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 * math.pow((M * D), 2.0))) / d else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.6e-83) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / h) / l))))); elseif (d <= 4.7e+26) tmp = Float64(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 * (Float64(M * D) ^ 2.0))) / d); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -6.6e-83) tmp = abs((d * ((l * h) ^ -0.5))); elseif (d <= 1.95e-306) tmp = d * sqrt(log(exp(((1.0 / h) / l)))); elseif (d <= 4.7e+26) tmp = ((sqrt(h) / (l ^ 1.5)) * (-0.125 * ((M * D) ^ 2.0))) / d; else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.6e-83], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, 1.95e-306], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.7e+26], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.6 \cdot 10^{-83}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;d \leq 1.95 \cdot 10^{-306}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{h}}{\ell}}\right)}\\
\mathbf{elif}\;d \leq 4.7 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(-0.125 \cdot {\left(M \cdot D\right)}^{2}\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.5999999999999999e-83Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -6.5999999999999999e-83 < d < 1.95e-306Initial program 65.1%
Simplified65.1%
Taylor expanded in d around inf 15.0%
add-log-exp39.5%
associate-/r*39.5%
Applied egg-rr39.5%
if 1.95e-306 < d < 4.6999999999999998e26Initial program 60.4%
Simplified60.4%
Taylor expanded in d around 0 39.3%
associate-*r*39.3%
*-commutative39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
swap-sqr46.3%
unpow246.3%
associate-*r/46.3%
*-commutative46.3%
Simplified46.3%
associate-*r/47.9%
sqrt-div52.7%
sqrt-pow157.3%
metadata-eval57.3%
*-commutative57.3%
Applied egg-rr57.3%
if 4.6999999999999998e26 < d Initial program 72.4%
Simplified72.4%
Taylor expanded in d around inf 60.4%
associate-/r*61.7%
sqrt-div66.6%
Applied egg-rr66.6%
Final simplification58.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -3.4e-84)
(fabs (* d (pow (* l h) -0.5)))
(if (<= d -5e-310)
(* d (sqrt (log (exp (/ (/ 1.0 h) l)))))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.4e-84) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (d <= -5e-310) {
tmp = d * sqrt(log(exp(((1.0 / h) / l))));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-3.4d-84)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (d <= (-5d-310)) then
tmp = d * sqrt(log(exp(((1.0d0 / h) / l))))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -3.4e-84) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (d <= -5e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / h) / l))));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -3.4e-84: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif d <= -5e-310: tmp = d * math.sqrt(math.log(math.exp(((1.0 / h) / l)))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -3.4e-84) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (d <= -5e-310) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / h) / l))))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -3.4e-84) tmp = abs((d * ((l * h) ^ -0.5))); elseif (d <= -5e-310) tmp = d * sqrt(log(exp(((1.0 / h) / l)))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.4e-84], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.4 \cdot 10^{-84}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{h}}{\ell}}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -3.40000000000000021e-84Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -3.40000000000000021e-84 < d < -4.999999999999985e-310Initial program 64.2%
Simplified64.2%
Taylor expanded in d around inf 15.3%
add-log-exp40.5%
associate-/r*40.5%
Applied egg-rr40.5%
if -4.999999999999985e-310 < d Initial program 67.1%
Simplified67.1%
Taylor expanded in d around inf 44.1%
expm1-log1p-u43.2%
expm1-udef26.1%
inv-pow26.1%
sqrt-pow126.1%
metadata-eval26.1%
Applied egg-rr26.1%
expm1-def43.2%
expm1-log1p44.1%
Simplified44.1%
*-commutative44.1%
unpow-prod-down51.8%
Applied egg-rr51.8%
Final simplification53.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* l h) -0.5)))
(if (<= d -1.1e-84)
(fabs (* d t_0))
(if (<= d -5e-310)
(* d (log (exp t_0)))
(* d (* (pow l -0.5) (pow h -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((l * h), -0.5);
double tmp;
if (d <= -1.1e-84) {
tmp = fabs((d * t_0));
} else if (d <= -5e-310) {
tmp = d * log(exp(t_0));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (l * h) ** (-0.5d0)
if (d <= (-1.1d-84)) then
tmp = abs((d * t_0))
else if (d <= (-5d-310)) then
tmp = d * log(exp(t_0))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.pow((l * h), -0.5);
double tmp;
if (d <= -1.1e-84) {
tmp = Math.abs((d * t_0));
} else if (d <= -5e-310) {
tmp = d * Math.log(Math.exp(t_0));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((l * h), -0.5) tmp = 0 if d <= -1.1e-84: tmp = math.fabs((d * t_0)) elif d <= -5e-310: tmp = d * math.log(math.exp(t_0)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(l * h) ^ -0.5 tmp = 0.0 if (d <= -1.1e-84) tmp = abs(Float64(d * t_0)); elseif (d <= -5e-310) tmp = Float64(d * log(exp(t_0))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (l * h) ^ -0.5; tmp = 0.0; if (d <= -1.1e-84) tmp = abs((d * t_0)); elseif (d <= -5e-310) tmp = d * log(exp(t_0)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[d, -1.1e-84], N[Abs[N[(d * t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;d \leq -1.1 \cdot 10^{-84}:\\
\;\;\;\;\left|d \cdot t_0\right|\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \log \left(e^{t_0}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -1.0999999999999999e-84Initial program 76.2%
Simplified73.9%
Taylor expanded in d around inf 5.5%
expm1-log1p-u5.5%
expm1-udef5.7%
inv-pow5.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
expm1-def5.5%
expm1-log1p5.5%
Simplified5.5%
add-sqr-sqrt0.2%
sqrt-unprod48.9%
pow248.9%
*-commutative48.9%
Applied egg-rr48.9%
unpow248.9%
rem-sqrt-square62.0%
Simplified62.0%
if -1.0999999999999999e-84 < d < -4.999999999999985e-310Initial program 64.2%
Simplified64.2%
Taylor expanded in d around inf 15.3%
add-log-exp40.5%
inv-pow40.5%
sqrt-pow140.5%
metadata-eval40.5%
Applied egg-rr40.5%
if -4.999999999999985e-310 < d Initial program 67.1%
Simplified67.1%
Taylor expanded in d around inf 44.1%
expm1-log1p-u43.2%
expm1-udef26.1%
inv-pow26.1%
sqrt-pow126.1%
metadata-eval26.1%
Applied egg-rr26.1%
expm1-def43.2%
expm1-log1p44.1%
Simplified44.1%
*-commutative44.1%
unpow-prod-down51.8%
Applied egg-rr51.8%
Final simplification53.5%
(FPCore (d h l M D) :precision binary64 (if (<= d -5e-310) (fabs (* d (pow (* l h) -0.5))) (* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-5d-310)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5e-310: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -5e-310) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 72.4%
Simplified70.8%
Taylor expanded in d around inf 8.6%
expm1-log1p-u8.6%
expm1-udef8.7%
inv-pow8.7%
sqrt-pow18.7%
metadata-eval8.7%
Applied egg-rr8.7%
expm1-def8.6%
expm1-log1p8.6%
Simplified8.6%
add-sqr-sqrt2.6%
sqrt-unprod38.2%
pow238.2%
*-commutative38.2%
Applied egg-rr38.2%
unpow238.2%
rem-sqrt-square48.6%
Simplified48.6%
if -4.999999999999985e-310 < d Initial program 67.1%
Simplified67.1%
Taylor expanded in d around inf 44.1%
expm1-log1p-u43.2%
expm1-udef26.1%
inv-pow26.1%
sqrt-pow126.1%
metadata-eval26.1%
Applied egg-rr26.1%
expm1-def43.2%
expm1-log1p44.1%
Simplified44.1%
*-commutative44.1%
unpow-prod-down51.8%
Applied egg-rr51.8%
Final simplification50.2%
(FPCore (d h l M D) :precision binary64 (if (<= M 3.8e-29) (fabs (* d (pow (* l h) -0.5))) (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.8e-29) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 3.8d-29) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 3.8e-29) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 3.8e-29: tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 3.8e-29) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= 3.8e-29) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 3.8e-29], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.8 \cdot 10^{-29}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if M < 3.79999999999999976e-29Initial program 69.5%
Simplified69.0%
Taylor expanded in d around inf 29.7%
expm1-log1p-u29.2%
expm1-udef18.7%
inv-pow18.7%
sqrt-pow118.7%
metadata-eval18.7%
Applied egg-rr18.7%
expm1-def29.2%
expm1-log1p29.6%
Simplified29.6%
add-sqr-sqrt27.1%
sqrt-unprod38.8%
pow238.8%
*-commutative38.8%
Applied egg-rr38.8%
unpow238.8%
rem-sqrt-square52.5%
Simplified52.5%
if 3.79999999999999976e-29 < M Initial program 70.2%
Simplified68.9%
Taylor expanded in d around inf 19.5%
*-commutative19.5%
associate-/r*19.4%
Simplified19.4%
Final simplification43.0%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* l h)))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.0 / (l * h)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt((1.0d0 / (l * h)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (l * h)));
}
def code(d, h, l, M, D): return d * math.sqrt((1.0 / (l * h)))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt((1.0 / (l * h))); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Initial program 69.7%
Simplified68.9%
Taylor expanded in d around inf 26.7%
Final simplification26.7%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / h) / l));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / h) / l)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Initial program 69.7%
Simplified68.9%
Taylor expanded in d around inf 26.7%
expm1-log1p-u26.3%
expm1-udef17.6%
inv-pow17.6%
sqrt-pow117.6%
metadata-eval17.6%
Applied egg-rr17.6%
expm1-def26.3%
expm1-log1p26.7%
Simplified26.7%
Taylor expanded in d around 0 26.7%
associate-/r*27.1%
Simplified27.1%
Final simplification27.1%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 69.7%
Simplified68.9%
Taylor expanded in d around inf 26.7%
expm1-log1p-u26.3%
expm1-udef17.6%
inv-pow17.6%
sqrt-pow117.6%
metadata-eval17.6%
Applied egg-rr17.6%
expm1-def26.3%
expm1-log1p26.7%
Simplified26.7%
Final simplification26.7%
herbie shell --seed 2023309
(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)))))