
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)))))
(t_2 (/ (sqrt d) (sqrt h))))
(if (<= l -1.62e-301)
(* (pow (* (pow (/ -1.0 h) 0.25) (pow (- d) 0.25)) 2.0) (* t_0 t_1))
(if (<= l 1.36e+87)
(*
t_2
(* t_0 (- 1.0 (* 0.5 (/ (* h (pow (/ D (/ d (* 0.5 M))) 2.0)) l)))))
(* t_2 (* t_1 (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)));
double t_2 = sqrt(d) / sqrt(h);
double tmp;
if (l <= -1.62e-301) {
tmp = pow((pow((-1.0 / h), 0.25) * pow(-d, 0.25)), 2.0) * (t_0 * t_1);
} else if (l <= 1.36e+87) {
tmp = t_2 * (t_0 * (1.0 - (0.5 * ((h * pow((D / (d / (0.5 * M))), 2.0)) / l))));
} else {
tmp = t_2 * (t_1 * (sqrt(d) / 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = 1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))
t_2 = sqrt(d) / sqrt(h)
if (l <= (-1.62d-301)) then
tmp = (((((-1.0d0) / h) ** 0.25d0) * (-d ** 0.25d0)) ** 2.0d0) * (t_0 * t_1)
else if (l <= 1.36d+87) then
tmp = t_2 * (t_0 * (1.0d0 - (0.5d0 * ((h * ((d_1 / (d / (0.5d0 * m))) ** 2.0d0)) / l))))
else
tmp = t_2 * (t_1 * (sqrt(d) / sqrt(l)))
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 = 1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)));
double t_2 = Math.sqrt(d) / Math.sqrt(h);
double tmp;
if (l <= -1.62e-301) {
tmp = Math.pow((Math.pow((-1.0 / h), 0.25) * Math.pow(-d, 0.25)), 2.0) * (t_0 * t_1);
} else if (l <= 1.36e+87) {
tmp = t_2 * (t_0 * (1.0 - (0.5 * ((h * Math.pow((D / (d / (0.5 * M))), 2.0)) / l))));
} else {
tmp = t_2 * (t_1 * (Math.sqrt(d) / Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) t_2 = math.sqrt(d) / math.sqrt(h) tmp = 0 if l <= -1.62e-301: tmp = math.pow((math.pow((-1.0 / h), 0.25) * math.pow(-d, 0.25)), 2.0) * (t_0 * t_1) elif l <= 1.36e+87: tmp = t_2 * (t_0 * (1.0 - (0.5 * ((h * math.pow((D / (d / (0.5 * M))), 2.0)) / l)))) else: tmp = t_2 * (t_1 * (math.sqrt(d) / math.sqrt(l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) t_2 = Float64(sqrt(d) / sqrt(h)) tmp = 0.0 if (l <= -1.62e-301) tmp = Float64((Float64((Float64(-1.0 / h) ^ 0.25) * (Float64(-d) ^ 0.25)) ^ 2.0) * Float64(t_0 * t_1)); elseif (l <= 1.36e+87) tmp = Float64(t_2 * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D / Float64(d / Float64(0.5 * M))) ^ 2.0)) / l))))); else tmp = Float64(t_2 * Float64(t_1 * Float64(sqrt(d) / sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))); t_2 = sqrt(d) / sqrt(h); tmp = 0.0; if (l <= -1.62e-301) tmp = ((((-1.0 / h) ^ 0.25) * (-d ^ 0.25)) ^ 2.0) * (t_0 * t_1); elseif (l <= 1.36e+87) tmp = t_2 * (t_0 * (1.0 - (0.5 * ((h * ((D / (d / (0.5 * M))) ^ 2.0)) / l)))); else tmp = t_2 * (t_1 * (sqrt(d) / sqrt(l))); 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[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.62e-301], N[(N[Power[N[(N[Power[N[(-1.0 / h), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[(-d), 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.36e+87], N[(t$95$2 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D / N[(d / N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\\
t_2 := \frac{\sqrt{d}}{\sqrt{h}}\\
\mathbf{if}\;\ell \leq -1.62 \cdot 10^{-301}:\\
\;\;\;\;{\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(-d\right)}^{0.25}\right)}^{2} \cdot \left(t_0 \cdot t_1\right)\\
\mathbf{elif}\;\ell \leq 1.36 \cdot 10^{+87}:\\
\;\;\;\;t_2 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{\frac{d}{0.5 \cdot M}}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if l < -1.61999999999999993e-301Initial program 62.1%
associate-*l*62.2%
metadata-eval62.2%
unpow1/262.2%
metadata-eval62.2%
unpow1/262.2%
associate-*l*62.2%
metadata-eval62.2%
times-frac62.1%
Simplified62.1%
pow1/262.1%
sqr-pow62.0%
pow262.0%
metadata-eval62.0%
Applied egg-rr62.0%
Taylor expanded in h around -inf 73.9%
distribute-lft-in73.9%
exp-sum74.1%
*-commutative74.1%
exp-to-pow74.4%
*-commutative74.4%
rem-square-sqrt0.0%
unpow20.0%
exp-to-pow0.0%
unpow20.0%
rem-square-sqrt76.4%
mul-1-neg76.4%
Simplified76.4%
if -1.61999999999999993e-301 < l < 1.3599999999999999e87Initial program 80.3%
associate-*l*80.4%
metadata-eval80.4%
unpow1/280.4%
metadata-eval80.4%
unpow1/280.4%
associate-*l*80.4%
metadata-eval80.4%
times-frac79.2%
Simplified79.2%
associate-*r/86.3%
div-inv86.3%
metadata-eval86.3%
Applied egg-rr86.3%
Taylor expanded in M around 0 87.5%
*-commutative87.5%
*-commutative87.5%
associate-*l/87.5%
*-commutative87.5%
associate-*r*87.5%
associate-/l*87.5%
*-commutative87.5%
Simplified87.5%
sqrt-div94.3%
Applied egg-rr94.3%
if 1.3599999999999999e87 < l Initial program 53.2%
associate-*l*53.2%
metadata-eval53.2%
unpow1/253.2%
metadata-eval53.2%
unpow1/253.2%
associate-*l*53.2%
metadata-eval53.2%
times-frac53.3%
Simplified53.3%
sqrt-div65.4%
Applied egg-rr65.4%
sqrt-div68.6%
Applied egg-rr82.5%
Final simplification83.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)))))))
(if (or (<= t_0 -2e-125) (and (not (<= t_0 0.0)) (<= t_0 5e+163)))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (* h (/ (pow (/ D (/ d (* 0.5 M))) 2.0) l))))))
(fabs (* d (pow (* l h) -0.5))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (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 tmp;
if ((t_0 <= -2e-125) || (!(t_0 <= 0.0) && (t_0 <= 5e+163))) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (pow((D / (d / (0.5 * M))), 2.0) / l)))));
} else {
tmp = fabs((d * pow((l * h), -0.5)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((m * d_1) / (d * 2.0d0)) ** 2.0d0))))
if ((t_0 <= (-2d-125)) .or. (.not. (t_0 <= 0.0d0)) .and. (t_0 <= 5d+163)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (h * (((d_1 / (d / (0.5d0 * m))) ** 2.0d0) / l)))))
else
tmp = abs((d * ((l * h) ** (-0.5d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (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 tmp;
if ((t_0 <= -2e-125) || (!(t_0 <= 0.0) && (t_0 <= 5e+163))) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (h * (Math.pow((D / (d / (0.5 * M))), 2.0) / l)))));
} else {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (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)))) tmp = 0 if (t_0 <= -2e-125) or (not (t_0 <= 0.0) and (t_0 <= 5e+163)): tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (h * (math.pow((D / (d / (0.5 * M))), 2.0) / l))))) else: tmp = math.fabs((d * math.pow((l * h), -0.5))) return tmp
function code(d, h, l, M, D) t_0 = 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))))) tmp = 0.0 if ((t_0 <= -2e-125) || (!(t_0 <= 0.0) && (t_0 <= 5e+163))) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(D / Float64(d / Float64(0.5 * M))) ^ 2.0) / l)))))); else tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((M * D) / (d * 2.0)) ^ 2.0)))); tmp = 0.0; if ((t_0 <= -2e-125) || (~((t_0 <= 0.0)) && (t_0 <= 5e+163))) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (((D / (d / (0.5 * M))) ^ 2.0) / l))))); else tmp = abs((d * ((l * h) ^ -0.5))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[Or[LessEqual[t$95$0, -2e-125], And[N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision], LessEqual[t$95$0, 5e+163]]], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(D / N[(d / N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{-125} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 5 \cdot 10^{+163}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{\frac{d}{0.5 \cdot M}}\right)}^{2}}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\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)))) < -2.00000000000000002e-125 or 0.0 < (*.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)))) < 5e163Initial program 93.7%
associate-*l*93.7%
metadata-eval93.7%
unpow1/293.7%
metadata-eval93.7%
unpow1/293.7%
associate-*l*93.7%
metadata-eval93.7%
times-frac93.0%
Simplified93.0%
associate-*r/92.4%
div-inv92.4%
metadata-eval92.4%
Applied egg-rr92.4%
metadata-eval92.4%
div-inv92.4%
associate-*r/93.0%
expm1-log1p-u92.2%
expm1-udef92.2%
*-commutative92.2%
div-inv92.2%
metadata-eval92.2%
Applied egg-rr92.2%
expm1-def92.2%
expm1-log1p93.0%
*-commutative93.0%
associate-*l/92.4%
*-rgt-identity92.4%
associate-*r/92.4%
associate-*l*93.7%
associate-*r/93.7%
*-rgt-identity93.7%
associate-*l/94.4%
associate-/l*93.0%
*-commutative93.0%
Simplified93.0%
if -2.00000000000000002e-125 < (*.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)))) < 0.0 or 5e163 < (*.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 29.8%
metadata-eval29.8%
unpow1/229.8%
metadata-eval29.8%
unpow1/229.8%
*-commutative29.8%
associate-*l*29.8%
times-frac29.7%
metadata-eval29.7%
Simplified29.7%
Taylor expanded in d around inf 39.9%
expm1-log1p-u39.1%
expm1-udef29.0%
*-commutative29.0%
Applied egg-rr29.0%
expm1-def39.1%
expm1-log1p39.9%
unpow-139.9%
sqr-pow39.9%
rem-sqrt-square39.9%
sqr-pow39.7%
fabs-sqr39.7%
sqr-pow39.9%
metadata-eval39.9%
Simplified39.9%
add-cbrt-cube38.9%
Applied egg-rr38.9%
associate-*l*38.9%
pow-sqr38.9%
metadata-eval38.9%
unpow-138.9%
Simplified38.9%
*-commutative38.9%
add-sqr-sqrt38.8%
pow238.8%
Applied egg-rr36.1%
unpow236.1%
rem-sqrt-square65.4%
Simplified65.4%
Final simplification81.3%
(FPCore (d h l M D)
:precision binary64
(if (<= M -2.9e+53)
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* 0.5 (/ h l)))))
(if (or (<= M -1.7e-119) (and (not (<= M -4.5e-176)) (<= M 2.45e-189)))
(fabs (* d (pow (* l h) -0.5)))
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(-
1.0
(* 0.5 (* 0.25 (* (/ D (/ d D)) (/ (* h (/ M (/ l M))) d))))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= -2.9e+53) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l))));
} else if ((M <= -1.7e-119) || (!(M <= -4.5e-176) && (M <= 2.45e-189))) {
tmp = fabs((d * pow((l * h), -0.5)));
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (0.25 * ((D / (d / D)) * ((h * (M / (l / M))) / d))))));
}
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 <= (-2.9d+53)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * (0.5d0 * (h / l))))
else if ((m <= (-1.7d-119)) .or. (.not. (m <= (-4.5d-176))) .and. (m <= 2.45d-189)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (0.25d0 * ((d_1 / (d / d_1)) * ((h * (m / (l / m))) / d))))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= -2.9e+53) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (Math.pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l))));
} else if ((M <= -1.7e-119) || (!(M <= -4.5e-176) && (M <= 2.45e-189))) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (0.25 * ((D / (d / D)) * ((h * (M / (l / M))) / d))))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= -2.9e+53: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (math.pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l)))) elif (M <= -1.7e-119) or (not (M <= -4.5e-176) and (M <= 2.45e-189)): tmp = math.fabs((d * math.pow((l * h), -0.5))) else: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (0.25 * ((D / (d / D)) * ((h * (M / (l / M))) / d)))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= -2.9e+53) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); elseif ((M <= -1.7e-119) || (!(M <= -4.5e-176) && (M <= 2.45e-189))) 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(0.25 * Float64(Float64(D / Float64(d / D)) * Float64(Float64(h * Float64(M / Float64(l / M))) / d))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (M <= -2.9e+53) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (((M * (0.5 * (D / d))) ^ 2.0) * (0.5 * (h / l)))); elseif ((M <= -1.7e-119) || (~((M <= -4.5e-176)) && (M <= 2.45e-189))) tmp = abs((d * ((l * h) ^ -0.5))); else tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (0.25 * ((D / (d / D)) * ((h * (M / (l / M))) / d)))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, -2.9e+53], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, -1.7e-119], And[N[Not[LessEqual[M, -4.5e-176]], $MachinePrecision], LessEqual[M, 2.45e-189]]], 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[(0.25 * N[(N[(D / N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.9 \cdot 10^{+53}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{elif}\;M \leq -1.7 \cdot 10^{-119} \lor \neg \left(M \leq -4.5 \cdot 10^{-176}\right) \land M \leq 2.45 \cdot 10^{-189}:\\
\;\;\;\;\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(0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \frac{M}{\frac{\ell}{M}}}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < -2.9000000000000002e53Initial program 74.7%
metadata-eval74.7%
unpow1/274.7%
metadata-eval74.7%
unpow1/274.7%
*-commutative74.7%
associate-*l*74.7%
times-frac72.8%
metadata-eval72.8%
Simplified72.8%
Applied egg-rr19.8%
expm1-def21.7%
expm1-log1p63.4%
sub-neg63.4%
associate-*r*63.4%
distribute-rgt-neg-in63.4%
*-commutative63.4%
metadata-eval63.4%
associate-*r*63.4%
+-commutative63.4%
fma-def63.4%
fma-def63.4%
Simplified63.4%
if -2.9000000000000002e53 < M < -1.70000000000000012e-119 or -4.5e-176 < M < 2.4499999999999999e-189Initial program 63.2%
metadata-eval63.2%
unpow1/263.2%
metadata-eval63.2%
unpow1/263.2%
*-commutative63.2%
associate-*l*63.2%
times-frac63.1%
metadata-eval63.1%
Simplified63.1%
Taylor expanded in d around inf 45.7%
expm1-log1p-u44.6%
expm1-udef27.3%
*-commutative27.3%
Applied egg-rr27.3%
expm1-def44.6%
expm1-log1p45.7%
unpow-145.7%
sqr-pow45.7%
rem-sqrt-square46.9%
sqr-pow46.6%
fabs-sqr46.6%
sqr-pow46.9%
metadata-eval46.9%
Simplified46.9%
add-cbrt-cube38.9%
Applied egg-rr38.9%
associate-*l*38.9%
pow-sqr38.9%
metadata-eval38.9%
unpow-138.9%
Simplified38.9%
*-commutative38.9%
add-sqr-sqrt38.8%
pow238.8%
Applied egg-rr45.7%
unpow245.7%
rem-sqrt-square67.2%
Simplified67.2%
if -1.70000000000000012e-119 < M < -4.5e-176 or 2.4499999999999999e-189 < M Initial program 65.2%
associate-*l*65.2%
metadata-eval65.2%
unpow1/265.2%
metadata-eval65.2%
unpow1/265.2%
associate-*l*65.2%
metadata-eval65.2%
times-frac65.2%
Simplified65.2%
associate-*r/68.2%
div-inv68.2%
metadata-eval68.2%
Applied egg-rr68.2%
Taylor expanded in M around 0 68.2%
*-commutative68.2%
*-commutative68.2%
associate-*l/68.2%
*-commutative68.2%
associate-*r*68.2%
associate-/l*66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in D around 0 40.4%
associate-*r/40.4%
unpow240.4%
unpow240.4%
unpow240.4%
*-commutative40.4%
associate-*r*45.4%
*-commutative45.4%
associate-*r/45.4%
times-frac44.2%
associate-*r*40.9%
associate-/l*39.4%
associate-*l/41.8%
times-frac50.0%
Simplified59.6%
Final simplification62.7%
(FPCore (d h l M D)
:precision binary64
(if (or (<= M -2.9e+53) (not (<= M 4.7e-195)))
(*
(sqrt (* (/ d l) (/ d h)))
(- 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* 0.5 (/ h l)))))
(fabs (* d (pow (* l h) -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((M <= -2.9e+53) || !(M <= 4.7e-195)) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 - (pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l))));
} else {
tmp = fabs((d * pow((l * h), -0.5)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if ((m <= (-2.9d+53)) .or. (.not. (m <= 4.7d-195))) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * (0.5d0 * (h / l))))
else
tmp = abs((d * ((l * h) ** (-0.5d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if ((M <= -2.9e+53) || !(M <= 4.7e-195)) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (Math.pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l))));
} else {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (M <= -2.9e+53) or not (M <= 4.7e-195): tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (math.pow((M * (0.5 * (D / d))), 2.0) * (0.5 * (h / l)))) else: tmp = math.fabs((d * math.pow((l * h), -0.5))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if ((M <= -2.9e+53) || !(M <= 4.7e-195)) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(0.5 * Float64(h / l))))); else tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((M <= -2.9e+53) || ~((M <= 4.7e-195))) tmp = sqrt(((d / l) * (d / h))) * (1.0 - (((M * (0.5 * (D / d))) ^ 2.0) * (0.5 * (h / l)))); else tmp = abs((d * ((l * h) ^ -0.5))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[M, -2.9e+53], N[Not[LessEqual[M, 4.7e-195]], $MachinePrecision]], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.9 \cdot 10^{+53} \lor \neg \left(M \leq 4.7 \cdot 10^{-195}\right):\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\end{array}
\end{array}
if M < -2.9000000000000002e53 or 4.7000000000000001e-195 < M Initial program 67.0%
metadata-eval67.0%
unpow1/267.0%
metadata-eval67.0%
unpow1/267.0%
*-commutative67.0%
associate-*l*67.0%
times-frac66.5%
metadata-eval66.5%
Simplified66.5%
Applied egg-rr16.7%
expm1-def21.5%
expm1-log1p58.6%
sub-neg58.6%
associate-*r*58.6%
distribute-rgt-neg-in58.6%
*-commutative58.6%
metadata-eval58.6%
associate-*r*58.6%
+-commutative58.6%
fma-def58.6%
fma-def58.6%
Simplified58.6%
if -2.9000000000000002e53 < M < 4.7000000000000001e-195Initial program 65.5%
metadata-eval65.5%
unpow1/265.5%
metadata-eval65.5%
unpow1/265.5%
*-commutative65.5%
associate-*l*65.5%
times-frac65.4%
metadata-eval65.4%
Simplified65.4%
Taylor expanded in d around inf 42.5%
expm1-log1p-u41.4%
expm1-udef25.5%
*-commutative25.5%
Applied egg-rr25.5%
expm1-def41.4%
expm1-log1p42.5%
unpow-142.5%
sqr-pow42.5%
rem-sqrt-square43.4%
sqr-pow43.2%
fabs-sqr43.2%
sqr-pow43.4%
metadata-eval43.4%
Simplified43.4%
add-cbrt-cube35.6%
Applied egg-rr35.6%
associate-*l*35.6%
pow-sqr35.6%
metadata-eval35.6%
unpow-135.6%
Simplified35.6%
*-commutative35.6%
add-sqr-sqrt35.5%
pow235.5%
Applied egg-rr44.7%
unpow244.7%
rem-sqrt-square64.0%
Simplified64.0%
Final simplification60.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= l -2.55e-222)
(fabs (* d (pow (* l h) -0.5)))
(if (<= l 2.25e-273)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(if (<= l 1.45e-236)
(* (/ D (/ (/ d (* M M)) D)) (* (sqrt (/ h (pow l 3.0))) -0.125))
(* d (* (pow h -0.5) (pow l -0.5))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -2.55e-222) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (l <= 2.25e-273) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else if (l <= 1.45e-236) {
tmp = (D / ((d / (M * M)) / D)) * (sqrt((h / pow(l, 3.0))) * -0.125);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (l <= -2.55e-222) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (l <= 2.25e-273) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else if (l <= 1.45e-236) {
tmp = (D / ((d / (M * M)) / D)) * (Math.sqrt((h / Math.pow(l, 3.0))) * -0.125);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (l <= -2.55e-222) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (l <= 2.25e-273) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); elseif (l <= 1.45e-236) tmp = Float64(Float64(D / Float64(Float64(d / Float64(M * M)) / D)) * Float64(sqrt(Float64(h / (l ^ 3.0))) * -0.125)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.55e-222], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.25e-273], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e-236], N[(N[(D / N[(N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -2.55 \cdot 10^{-222}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;\ell \leq 2.25 \cdot 10^{-273}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{-236}:\\
\;\;\;\;\frac{D}{\frac{\frac{d}{M \cdot M}}{D}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.5500000000000001e-222Initial program 61.8%
metadata-eval61.8%
unpow1/261.8%
metadata-eval61.8%
unpow1/261.8%
*-commutative61.8%
associate-*l*61.8%
times-frac61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in d around inf 10.7%
expm1-log1p-u10.7%
expm1-udef10.6%
*-commutative10.6%
Applied egg-rr10.6%
expm1-def10.7%
expm1-log1p10.7%
unpow-110.7%
sqr-pow10.7%
rem-sqrt-square10.7%
sqr-pow10.7%
fabs-sqr10.7%
sqr-pow10.7%
metadata-eval10.7%
Simplified10.7%
add-cbrt-cube11.7%
Applied egg-rr11.7%
associate-*l*11.7%
pow-sqr11.7%
metadata-eval11.7%
unpow-111.7%
Simplified11.7%
*-commutative11.7%
add-sqr-sqrt11.7%
pow211.7%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square43.6%
Simplified43.6%
if -2.5500000000000001e-222 < l < 2.2499999999999998e-273Initial program 57.9%
metadata-eval57.9%
unpow1/257.9%
metadata-eval57.9%
unpow1/257.9%
*-commutative57.9%
associate-*l*57.9%
times-frac57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in d around inf 41.4%
add-cbrt-cube58.8%
*-commutative58.8%
*-commutative58.8%
*-commutative58.8%
Applied egg-rr58.8%
if 2.2499999999999998e-273 < l < 1.45e-236Initial program 80.4%
associate-*l*80.4%
metadata-eval80.4%
unpow1/280.4%
metadata-eval80.4%
unpow1/280.4%
associate-*l*80.4%
metadata-eval80.4%
times-frac73.8%
Simplified73.8%
sqrt-div73.9%
Applied egg-rr73.9%
Taylor expanded in d around 0 47.0%
*-commutative47.0%
associate-*l*47.0%
associate-/l*46.7%
unpow246.7%
associate-/l*60.0%
unpow260.0%
Simplified60.0%
if 1.45e-236 < l Initial program 70.5%
metadata-eval70.5%
unpow1/270.5%
metadata-eval70.5%
unpow1/270.5%
*-commutative70.5%
associate-*l*70.5%
times-frac70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in d around inf 54.5%
expm1-log1p-u53.3%
expm1-udef30.5%
*-commutative30.5%
Applied egg-rr30.5%
expm1-def53.3%
expm1-log1p54.5%
unpow-154.5%
sqr-pow54.5%
rem-sqrt-square55.3%
sqr-pow55.1%
fabs-sqr55.1%
sqr-pow55.3%
metadata-eval55.3%
Simplified55.3%
unpow-prod-down60.8%
Applied egg-rr60.8%
Final simplification54.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6.3e-223)
(fabs (* d (pow (* l h) -0.5)))
(if (<= l 1.36e-275)
(* d (cbrt (pow (/ 1.0 (* l h)) 1.5)))
(if (<= l 1.5e-236)
(* (/ D (/ (/ d (* M M)) D)) (* (sqrt (/ h (pow l 3.0))) -0.125))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.3e-223) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (l <= 1.36e-275) {
tmp = d * cbrt(pow((1.0 / (l * h)), 1.5));
} else if (l <= 1.5e-236) {
tmp = (D / ((d / (M * M)) / D)) * (sqrt((h / pow(l, 3.0))) * -0.125);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.3e-223) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (l <= 1.36e-275) {
tmp = d * Math.cbrt(Math.pow((1.0 / (l * h)), 1.5));
} else if (l <= 1.5e-236) {
tmp = (D / ((d / (M * M)) / D)) * (Math.sqrt((h / Math.pow(l, 3.0))) * -0.125);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.3e-223) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (l <= 1.36e-275) tmp = Float64(d * cbrt((Float64(1.0 / Float64(l * h)) ^ 1.5))); elseif (l <= 1.5e-236) tmp = Float64(Float64(D / Float64(Float64(d / Float64(M * M)) / D)) * Float64(sqrt(Float64(h / (l ^ 3.0))) * -0.125)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.3e-223], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.36e-275], N[(d * N[Power[N[Power[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.5e-236], N[(N[(D / N[(N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.3 \cdot 10^{-223}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;\ell \leq 1.36 \cdot 10^{-275}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{\ell \cdot h}\right)}^{1.5}}\\
\mathbf{elif}\;\ell \leq 1.5 \cdot 10^{-236}:\\
\;\;\;\;\frac{D}{\frac{\frac{d}{M \cdot M}}{D}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.29999999999999986e-223Initial program 61.8%
metadata-eval61.8%
unpow1/261.8%
metadata-eval61.8%
unpow1/261.8%
*-commutative61.8%
associate-*l*61.8%
times-frac61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in d around inf 10.7%
expm1-log1p-u10.7%
expm1-udef10.6%
*-commutative10.6%
Applied egg-rr10.6%
expm1-def10.7%
expm1-log1p10.7%
unpow-110.7%
sqr-pow10.7%
rem-sqrt-square10.7%
sqr-pow10.7%
fabs-sqr10.7%
sqr-pow10.7%
metadata-eval10.7%
Simplified10.7%
add-cbrt-cube11.7%
Applied egg-rr11.7%
associate-*l*11.7%
pow-sqr11.7%
metadata-eval11.7%
unpow-111.7%
Simplified11.7%
*-commutative11.7%
add-sqr-sqrt11.7%
pow211.7%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square43.6%
Simplified43.6%
if -6.29999999999999986e-223 < l < 1.35999999999999997e-275Initial program 57.9%
metadata-eval57.9%
unpow1/257.9%
metadata-eval57.9%
unpow1/257.9%
*-commutative57.9%
associate-*l*57.9%
times-frac57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in d around inf 41.4%
expm1-log1p-u41.3%
expm1-udef41.3%
*-commutative41.3%
Applied egg-rr41.3%
add-cbrt-cube48.2%
add-sqr-sqrt48.2%
expm1-def48.2%
expm1-log1p-u48.3%
associate-/r*48.3%
expm1-def48.3%
expm1-log1p-u48.3%
associate-/r*48.3%
Applied egg-rr48.3%
*-commutative48.3%
unpow1/248.3%
pow-plus48.3%
associate-/r*48.3%
metadata-eval48.3%
Simplified48.3%
if 1.35999999999999997e-275 < l < 1.50000000000000007e-236Initial program 80.4%
associate-*l*80.4%
metadata-eval80.4%
unpow1/280.4%
metadata-eval80.4%
unpow1/280.4%
associate-*l*80.4%
metadata-eval80.4%
times-frac73.8%
Simplified73.8%
sqrt-div73.9%
Applied egg-rr73.9%
Taylor expanded in d around 0 47.0%
*-commutative47.0%
associate-*l*47.0%
associate-/l*46.7%
unpow246.7%
associate-/l*60.0%
unpow260.0%
Simplified60.0%
if 1.50000000000000007e-236 < l Initial program 70.5%
metadata-eval70.5%
unpow1/270.5%
metadata-eval70.5%
unpow1/270.5%
*-commutative70.5%
associate-*l*70.5%
times-frac70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in d around inf 54.5%
expm1-log1p-u53.3%
expm1-udef30.5%
*-commutative30.5%
Applied egg-rr30.5%
expm1-def53.3%
expm1-log1p54.5%
unpow-154.5%
sqr-pow54.5%
rem-sqrt-square55.3%
sqr-pow55.1%
fabs-sqr55.1%
sqr-pow55.3%
metadata-eval55.3%
Simplified55.3%
unpow-prod-down60.8%
Applied egg-rr60.8%
Final simplification53.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (pow (* l h) -0.5))))
(if (<= l -9.8e-222)
(fabs t_0)
(if (<= l -5e-310)
(cbrt (* (* (/ 1.0 (* l h)) (* d d)) t_0))
(* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * pow((l * h), -0.5);
double tmp;
if (l <= -9.8e-222) {
tmp = fabs(t_0);
} else if (l <= -5e-310) {
tmp = cbrt((((1.0 / (l * h)) * (d * d)) * t_0));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * Math.pow((l * h), -0.5);
double tmp;
if (l <= -9.8e-222) {
tmp = Math.abs(t_0);
} else if (l <= -5e-310) {
tmp = Math.cbrt((((1.0 / (l * h)) * (d * d)) * t_0));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (l <= -9.8e-222) tmp = abs(t_0); elseif (l <= -5e-310) tmp = cbrt(Float64(Float64(Float64(1.0 / Float64(l * h)) * Float64(d * d)) * t_0)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9.8e-222], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[l, -5e-310], N[Power[N[(N[(N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], 1/3], $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -9.8 \cdot 10^{-222}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \left(d \cdot d\right)\right) \cdot t_0}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.7999999999999999e-222Initial program 61.8%
metadata-eval61.8%
unpow1/261.8%
metadata-eval61.8%
unpow1/261.8%
*-commutative61.8%
associate-*l*61.8%
times-frac61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in d around inf 10.7%
expm1-log1p-u10.7%
expm1-udef10.6%
*-commutative10.6%
Applied egg-rr10.6%
expm1-def10.7%
expm1-log1p10.7%
unpow-110.7%
sqr-pow10.7%
rem-sqrt-square10.7%
sqr-pow10.7%
fabs-sqr10.7%
sqr-pow10.7%
metadata-eval10.7%
Simplified10.7%
add-cbrt-cube11.7%
Applied egg-rr11.7%
associate-*l*11.7%
pow-sqr11.7%
metadata-eval11.7%
unpow-111.7%
Simplified11.7%
*-commutative11.7%
add-sqr-sqrt11.7%
pow211.7%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square43.6%
Simplified43.6%
if -9.7999999999999999e-222 < l < -4.999999999999985e-310Initial program 60.8%
metadata-eval60.8%
unpow1/260.8%
metadata-eval60.8%
unpow1/260.8%
*-commutative60.8%
associate-*l*60.8%
times-frac60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in d around inf 34.4%
expm1-log1p-u34.4%
expm1-udef34.4%
*-commutative34.4%
Applied egg-rr34.4%
expm1-def34.4%
expm1-log1p34.4%
unpow-134.4%
sqr-pow34.4%
rem-sqrt-square34.4%
sqr-pow34.4%
fabs-sqr34.4%
sqr-pow34.4%
metadata-eval34.4%
Simplified34.4%
add-cbrt-cube49.3%
*-commutative49.3%
*-commutative49.3%
*-commutative49.3%
Applied egg-rr49.3%
associate-*l*49.3%
swap-sqr45.3%
pow-sqr45.3%
metadata-eval45.3%
unpow-145.3%
Simplified45.3%
if -4.999999999999985e-310 < l Initial program 70.7%
metadata-eval70.7%
unpow1/270.7%
metadata-eval70.7%
unpow1/270.7%
*-commutative70.7%
associate-*l*70.7%
times-frac70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in d around inf 51.0%
expm1-log1p-u49.9%
expm1-udef30.2%
*-commutative30.2%
Applied egg-rr30.2%
expm1-def49.9%
expm1-log1p51.0%
unpow-151.0%
sqr-pow51.1%
rem-sqrt-square51.7%
sqr-pow51.5%
fabs-sqr51.5%
sqr-pow51.7%
metadata-eval51.7%
Simplified51.7%
unpow-prod-down56.5%
Applied egg-rr56.5%
Final simplification50.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (pow (* l h) -0.5))))
(if (<= M -2.1e+216)
(cbrt (* (* (/ 1.0 (* l h)) (* d d)) t_0))
(if (<= M 3.9e-63)
(fabs t_0)
(* -0.125 (* (sqrt (/ h (pow l 3.0))) (/ (* D D) (/ d (* M M)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * pow((l * h), -0.5);
double tmp;
if (M <= -2.1e+216) {
tmp = cbrt((((1.0 / (l * h)) * (d * d)) * t_0));
} else if (M <= 3.9e-63) {
tmp = fabs(t_0);
} else {
tmp = -0.125 * (sqrt((h / pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * Math.pow((l * h), -0.5);
double tmp;
if (M <= -2.1e+216) {
tmp = Math.cbrt((((1.0 / (l * h)) * (d * d)) * t_0));
} else if (M <= 3.9e-63) {
tmp = Math.abs(t_0);
} else {
tmp = -0.125 * (Math.sqrt((h / Math.pow(l, 3.0))) * ((D * D) / (d / (M * M))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (M <= -2.1e+216) tmp = cbrt(Float64(Float64(Float64(1.0 / Float64(l * h)) * Float64(d * d)) * t_0)); elseif (M <= 3.9e-63) tmp = abs(t_0); else tmp = Float64(-0.125 * Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(Float64(D * D) / Float64(d / Float64(M * M))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -2.1e+216], N[Power[N[(N[(N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[M, 3.9e-63], N[Abs[t$95$0], $MachinePrecision], N[(-0.125 * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;M \leq -2.1 \cdot 10^{+216}:\\
\;\;\;\;\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \left(d \cdot d\right)\right) \cdot t_0}\\
\mathbf{elif}\;M \leq 3.9 \cdot 10^{-63}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{D \cdot D}{\frac{d}{M \cdot M}}\right)\\
\end{array}
\end{array}
if M < -2.10000000000000001e216Initial program 72.9%
metadata-eval72.9%
unpow1/272.9%
metadata-eval72.9%
unpow1/272.9%
*-commutative72.9%
associate-*l*72.9%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
Taylor expanded in d around inf 30.8%
expm1-log1p-u30.6%
expm1-udef21.7%
*-commutative21.7%
Applied egg-rr21.7%
expm1-def30.6%
expm1-log1p30.8%
unpow-130.8%
sqr-pow30.8%
rem-sqrt-square30.8%
sqr-pow30.7%
fabs-sqr30.7%
sqr-pow30.8%
metadata-eval30.8%
Simplified30.8%
add-cbrt-cube39.2%
*-commutative39.2%
*-commutative39.2%
*-commutative39.2%
Applied egg-rr39.2%
associate-*l*39.2%
swap-sqr34.7%
pow-sqr34.7%
metadata-eval34.7%
unpow-134.7%
Simplified34.7%
if -2.10000000000000001e216 < M < 3.90000000000000022e-63Initial program 67.4%
metadata-eval67.4%
unpow1/267.4%
metadata-eval67.4%
unpow1/267.4%
*-commutative67.4%
associate-*l*67.4%
times-frac67.4%
metadata-eval67.4%
Simplified67.4%
Taylor expanded in d around inf 37.6%
expm1-log1p-u36.8%
expm1-udef23.2%
*-commutative23.2%
Applied egg-rr23.2%
expm1-def36.8%
expm1-log1p37.6%
unpow-137.6%
sqr-pow37.6%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
add-cbrt-cube32.4%
Applied egg-rr32.4%
associate-*l*32.4%
pow-sqr32.4%
metadata-eval32.4%
unpow-132.4%
Simplified32.4%
*-commutative32.4%
add-sqr-sqrt32.3%
pow232.3%
Applied egg-rr39.8%
unpow239.8%
rem-sqrt-square57.4%
Simplified57.4%
if 3.90000000000000022e-63 < M Initial program 63.0%
metadata-eval63.0%
unpow1/263.0%
metadata-eval63.0%
unpow1/263.0%
*-commutative63.0%
associate-*l*63.0%
times-frac63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in d around 0 20.2%
associate-/l*20.0%
unpow220.0%
unpow220.0%
Simplified20.0%
Final simplification43.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (pow (* l h) -0.5))))
(if (<= l -7.2e-219)
(fabs t_0)
(if (<= l 7.5e-307) t_0 (* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * pow((l * h), -0.5);
double tmp;
if (l <= -7.2e-219) {
tmp = fabs(t_0);
} else if (l <= 7.5e-307) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -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 = d * ((l * h) ** (-0.5d0))
if (l <= (-7.2d-219)) then
tmp = abs(t_0)
else if (l <= 7.5d-307) then
tmp = t_0
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-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 = d * Math.pow((l * h), -0.5);
double tmp;
if (l <= -7.2e-219) {
tmp = Math.abs(t_0);
} else if (l <= 7.5e-307) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * math.pow((l * h), -0.5) tmp = 0 if l <= -7.2e-219: tmp = math.fabs(t_0) elif l <= 7.5e-307: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (l <= -7.2e-219) tmp = abs(t_0); elseif (l <= 7.5e-307) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * ((l * h) ^ -0.5); tmp = 0.0; if (l <= -7.2e-219) tmp = abs(t_0); elseif (l <= 7.5e-307) tmp = t_0; else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.2e-219], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[l, 7.5e-307], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -7.2 \cdot 10^{-219}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{elif}\;\ell \leq 7.5 \cdot 10^{-307}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -7.19999999999999947e-219Initial program 61.8%
metadata-eval61.8%
unpow1/261.8%
metadata-eval61.8%
unpow1/261.8%
*-commutative61.8%
associate-*l*61.8%
times-frac61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in d around inf 10.7%
expm1-log1p-u10.7%
expm1-udef10.6%
*-commutative10.6%
Applied egg-rr10.6%
expm1-def10.7%
expm1-log1p10.7%
unpow-110.7%
sqr-pow10.7%
rem-sqrt-square10.7%
sqr-pow10.7%
fabs-sqr10.7%
sqr-pow10.7%
metadata-eval10.7%
Simplified10.7%
add-cbrt-cube11.7%
Applied egg-rr11.7%
associate-*l*11.7%
pow-sqr11.7%
metadata-eval11.7%
unpow-111.7%
Simplified11.7%
*-commutative11.7%
add-sqr-sqrt11.7%
pow211.7%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square43.6%
Simplified43.6%
if -7.19999999999999947e-219 < l < 7.5000000000000006e-307Initial program 60.8%
metadata-eval60.8%
unpow1/260.8%
metadata-eval60.8%
unpow1/260.8%
*-commutative60.8%
associate-*l*60.8%
times-frac60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in d around inf 34.4%
expm1-log1p-u34.4%
expm1-udef34.4%
*-commutative34.4%
Applied egg-rr34.4%
expm1-def34.4%
expm1-log1p34.4%
unpow-134.4%
sqr-pow34.4%
rem-sqrt-square34.4%
sqr-pow34.4%
fabs-sqr34.4%
sqr-pow34.4%
metadata-eval34.4%
Simplified34.4%
if 7.5000000000000006e-307 < l Initial program 70.7%
metadata-eval70.7%
unpow1/270.7%
metadata-eval70.7%
unpow1/270.7%
*-commutative70.7%
associate-*l*70.7%
times-frac70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in d around inf 51.0%
expm1-log1p-u49.9%
expm1-udef30.2%
*-commutative30.2%
Applied egg-rr30.2%
expm1-def49.9%
expm1-log1p51.0%
unpow-151.0%
sqr-pow51.1%
rem-sqrt-square51.7%
sqr-pow51.5%
fabs-sqr51.5%
sqr-pow51.7%
metadata-eval51.7%
Simplified51.7%
unpow-prod-down56.5%
Applied egg-rr56.5%
Final simplification49.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.18e-226)
(fabs (* d (pow (* l h) -0.5)))
(if (<= l -5e-310)
(* d (pow (pow (* l h) -1.5) 0.3333333333333333))
(* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.18e-226) {
tmp = fabs((d * pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * pow(pow((l * h), -1.5), 0.3333333333333333);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -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 (l <= (-1.18d-226)) then
tmp = abs((d * ((l * h) ** (-0.5d0))))
else if (l <= (-5d-310)) then
tmp = d * (((l * h) ** (-1.5d0)) ** 0.3333333333333333d0)
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-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 (l <= -1.18e-226) {
tmp = Math.abs((d * Math.pow((l * h), -0.5)));
} else if (l <= -5e-310) {
tmp = d * Math.pow(Math.pow((l * h), -1.5), 0.3333333333333333);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.18e-226: tmp = math.fabs((d * math.pow((l * h), -0.5))) elif l <= -5e-310: tmp = d * math.pow(math.pow((l * h), -1.5), 0.3333333333333333) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.18e-226) tmp = abs(Float64(d * (Float64(l * h) ^ -0.5))); elseif (l <= -5e-310) tmp = Float64(d * ((Float64(l * h) ^ -1.5) ^ 0.3333333333333333)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.18e-226) tmp = abs((d * ((l * h) ^ -0.5))); elseif (l <= -5e-310) tmp = d * (((l * h) ^ -1.5) ^ 0.3333333333333333); else tmp = d * ((h ^ -0.5) * (l ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.18e-226], N[Abs[N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], -1.5], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.18 \cdot 10^{-226}:\\
\;\;\;\;\left|d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-1.5}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.1799999999999999e-226Initial program 61.8%
metadata-eval61.8%
unpow1/261.8%
metadata-eval61.8%
unpow1/261.8%
*-commutative61.8%
associate-*l*61.8%
times-frac61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in d around inf 10.7%
expm1-log1p-u10.7%
expm1-udef10.6%
*-commutative10.6%
Applied egg-rr10.6%
expm1-def10.7%
expm1-log1p10.7%
unpow-110.7%
sqr-pow10.7%
rem-sqrt-square10.7%
sqr-pow10.7%
fabs-sqr10.7%
sqr-pow10.7%
metadata-eval10.7%
Simplified10.7%
add-cbrt-cube11.7%
Applied egg-rr11.7%
associate-*l*11.7%
pow-sqr11.7%
metadata-eval11.7%
unpow-111.7%
Simplified11.7%
*-commutative11.7%
add-sqr-sqrt11.7%
pow211.7%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square43.6%
Simplified43.6%
if -1.1799999999999999e-226 < l < -4.999999999999985e-310Initial program 60.8%
metadata-eval60.8%
unpow1/260.8%
metadata-eval60.8%
unpow1/260.8%
*-commutative60.8%
associate-*l*60.8%
times-frac60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in d around inf 34.4%
expm1-log1p-u34.4%
expm1-udef34.4%
*-commutative34.4%
Applied egg-rr34.4%
expm1-def34.4%
expm1-log1p34.4%
unpow-134.4%
sqr-pow34.4%
rem-sqrt-square34.4%
sqr-pow34.4%
fabs-sqr34.4%
sqr-pow34.4%
metadata-eval34.4%
Simplified34.4%
add-cbrt-cube42.1%
Applied egg-rr42.1%
associate-*l*42.1%
pow-sqr42.1%
metadata-eval42.1%
unpow-142.1%
Simplified42.1%
pow1/342.1%
inv-pow42.1%
pow-prod-up42.1%
metadata-eval42.1%
Applied egg-rr42.1%
if -4.999999999999985e-310 < l Initial program 70.7%
metadata-eval70.7%
unpow1/270.7%
metadata-eval70.7%
unpow1/270.7%
*-commutative70.7%
associate-*l*70.7%
times-frac70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in d around inf 51.0%
expm1-log1p-u49.9%
expm1-udef30.2%
*-commutative30.2%
Applied egg-rr30.2%
expm1-def49.9%
expm1-log1p51.0%
unpow-151.0%
sqr-pow51.1%
rem-sqrt-square51.7%
sqr-pow51.5%
fabs-sqr51.5%
sqr-pow51.7%
metadata-eval51.7%
Simplified51.7%
unpow-prod-down56.5%
Applied egg-rr56.5%
Final simplification50.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (pow (* l h) -0.5))))
(if (<= M -2.35e+216)
t_0
(if (<= M 3.9e-63)
(fabs t_0)
(* d (sqrt (+ -1.0 (+ 1.0 (/ 1.0 (* l h))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * pow((l * h), -0.5);
double tmp;
if (M <= -2.35e+216) {
tmp = t_0;
} else if (M <= 3.9e-63) {
tmp = fabs(t_0);
} else {
tmp = d * sqrt((-1.0 + (1.0 + (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) :: t_0
real(8) :: tmp
t_0 = d * ((l * h) ** (-0.5d0))
if (m <= (-2.35d+216)) then
tmp = t_0
else if (m <= 3.9d-63) then
tmp = abs(t_0)
else
tmp = d * sqrt(((-1.0d0) + (1.0d0 + (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 t_0 = d * Math.pow((l * h), -0.5);
double tmp;
if (M <= -2.35e+216) {
tmp = t_0;
} else if (M <= 3.9e-63) {
tmp = Math.abs(t_0);
} else {
tmp = d * Math.sqrt((-1.0 + (1.0 + (1.0 / (l * h)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * math.pow((l * h), -0.5) tmp = 0 if M <= -2.35e+216: tmp = t_0 elif M <= 3.9e-63: tmp = math.fabs(t_0) else: tmp = d * math.sqrt((-1.0 + (1.0 + (1.0 / (l * h))))) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * (Float64(l * h) ^ -0.5)) tmp = 0.0 if (M <= -2.35e+216) tmp = t_0; elseif (M <= 3.9e-63) tmp = abs(t_0); else tmp = Float64(d * sqrt(Float64(-1.0 + Float64(1.0 + Float64(1.0 / Float64(l * h)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * ((l * h) ^ -0.5); tmp = 0.0; if (M <= -2.35e+216) tmp = t_0; elseif (M <= 3.9e-63) tmp = abs(t_0); else tmp = d * sqrt((-1.0 + (1.0 + (1.0 / (l * h))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -2.35e+216], t$95$0, If[LessEqual[M, 3.9e-63], N[Abs[t$95$0], $MachinePrecision], N[(d * N[Sqrt[N[(-1.0 + N[(1.0 + N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;M \leq -2.35 \cdot 10^{+216}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \leq 3.9 \cdot 10^{-63}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{-1 + \left(1 + \frac{1}{\ell \cdot h}\right)}\\
\end{array}
\end{array}
if M < -2.3500000000000001e216Initial program 72.9%
metadata-eval72.9%
unpow1/272.9%
metadata-eval72.9%
unpow1/272.9%
*-commutative72.9%
associate-*l*72.9%
times-frac68.3%
metadata-eval68.3%
Simplified68.3%
Taylor expanded in d around inf 30.8%
expm1-log1p-u30.6%
expm1-udef21.7%
*-commutative21.7%
Applied egg-rr21.7%
expm1-def30.6%
expm1-log1p30.8%
unpow-130.8%
sqr-pow30.8%
rem-sqrt-square30.8%
sqr-pow30.7%
fabs-sqr30.7%
sqr-pow30.8%
metadata-eval30.8%
Simplified30.8%
if -2.3500000000000001e216 < M < 3.90000000000000022e-63Initial program 67.4%
metadata-eval67.4%
unpow1/267.4%
metadata-eval67.4%
unpow1/267.4%
*-commutative67.4%
associate-*l*67.4%
times-frac67.4%
metadata-eval67.4%
Simplified67.4%
Taylor expanded in d around inf 37.6%
expm1-log1p-u36.8%
expm1-udef23.2%
*-commutative23.2%
Applied egg-rr23.2%
expm1-def36.8%
expm1-log1p37.6%
unpow-137.6%
sqr-pow37.6%
rem-sqrt-square38.2%
sqr-pow38.1%
fabs-sqr38.1%
sqr-pow38.2%
metadata-eval38.2%
Simplified38.2%
add-cbrt-cube32.4%
Applied egg-rr32.4%
associate-*l*32.4%
pow-sqr32.4%
metadata-eval32.4%
unpow-132.4%
Simplified32.4%
*-commutative32.4%
add-sqr-sqrt32.3%
pow232.3%
Applied egg-rr39.8%
unpow239.8%
rem-sqrt-square57.4%
Simplified57.4%
if 3.90000000000000022e-63 < M Initial program 63.0%
metadata-eval63.0%
unpow1/263.0%
metadata-eval63.0%
unpow1/263.0%
*-commutative63.0%
associate-*l*63.0%
times-frac63.0%
metadata-eval63.0%
Simplified63.0%
Taylor expanded in d around inf 29.5%
expm1-log1p-u29.2%
expm1-udef23.4%
*-commutative23.4%
Applied egg-rr23.4%
Taylor expanded in h around inf 23.8%
Final simplification44.3%
(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 66.5%
metadata-eval66.5%
unpow1/266.5%
metadata-eval66.5%
unpow1/266.5%
*-commutative66.5%
associate-*l*66.5%
times-frac66.1%
metadata-eval66.1%
Simplified66.1%
Taylor expanded in d around inf 34.4%
expm1-log1p-u33.8%
expm1-udef23.3%
*-commutative23.3%
Applied egg-rr23.3%
expm1-def33.8%
expm1-log1p34.4%
unpow-134.4%
sqr-pow34.4%
rem-sqrt-square34.8%
sqr-pow34.7%
fabs-sqr34.7%
sqr-pow34.8%
metadata-eval34.8%
Simplified34.8%
Final simplification34.8%
(FPCore (d h l M D) :precision binary64 (* d (sqrt 0.0)))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(0.0);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt(0.0d0)
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(0.0);
}
def code(d, h, l, M, D): return d * math.sqrt(0.0)
function code(d, h, l, M, D) return Float64(d * sqrt(0.0)) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(0.0); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[0.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{0}
\end{array}
Initial program 66.5%
metadata-eval66.5%
unpow1/266.5%
metadata-eval66.5%
unpow1/266.5%
*-commutative66.5%
associate-*l*66.5%
times-frac66.1%
metadata-eval66.1%
Simplified66.1%
Taylor expanded in d around inf 34.4%
expm1-log1p-u33.8%
expm1-udef23.1%
*-commutative23.1%
Applied egg-rr23.1%
Taylor expanded in h around inf 4.8%
Final simplification4.8%
herbie shell --seed 2023187
(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)))))