
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -1e-309)
(*
(pow (* (pow (/ -1.0 h) 0.25) (pow (- d) 0.25)) 2.0)
(* t_0 (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))))
(*
(* t_0 (* (sqrt d) (sqrt (/ 1.0 h))))
(- 1.0 (/ (* h (* 0.5 (pow (* M (* 0.5 (/ D d))) 2.0))) l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -1e-309) {
tmp = pow((pow((-1.0 / h), 0.25) * pow(-d, 0.25)), 2.0) * (t_0 * (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * pow((M * (0.5 * (D / d))), 2.0))) / 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) :: tmp
t_0 = sqrt((d / l))
if (l <= (-1d-309)) then
tmp = (((((-1.0d0) / h) ** 0.25d0) * (-d ** 0.25d0)) ** 2.0d0) * (t_0 * (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))))
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0d0 / h)))) * (1.0d0 - ((h * (0.5d0 * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))) / 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 tmp;
if (l <= -1e-309) {
tmp = Math.pow((Math.pow((-1.0 / h), 0.25) * Math.pow(-d, 0.25)), 2.0) * (t_0 * (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))));
} else {
tmp = (t_0 * (Math.sqrt(d) * Math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * Math.pow((M * (0.5 * (D / d))), 2.0))) / l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -1e-309: tmp = math.pow((math.pow((-1.0 / h), 0.25) * math.pow(-d, 0.25)), 2.0) * (t_0 * (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))))) else: tmp = (t_0 * (math.sqrt(d) * math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * math.pow((M * (0.5 * (D / d))), 2.0))) / l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1e-309) tmp = Float64((Float64((Float64(-1.0 / h) ^ 0.25) * (Float64(-d) ^ 0.25)) ^ 2.0) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) * sqrt(Float64(1.0 / h)))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (l <= -1e-309) tmp = ((((-1.0 / h) ^ 0.25) * (-d ^ 0.25)) ^ 2.0) * (t_0 * (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))))); else tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * ((M * (0.5 * (D / d))) ^ 2.0))) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e-309], 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 * 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]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;{\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(-d\right)}^{0.25}\right)}^{2} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 71.2%
associate-*l*71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
associate-*l*71.2%
metadata-eval71.2%
times-frac69.8%
Simplified69.8%
pow1/269.8%
metadata-eval69.8%
sqr-pow69.7%
pow269.7%
metadata-eval69.7%
metadata-eval69.7%
Applied egg-rr69.7%
Taylor expanded in h around -inf 78.0%
distribute-lft-in78.0%
exp-sum78.2%
*-commutative78.2%
exp-to-pow78.6%
*-commutative78.6%
rem-square-sqrt0.0%
unpow20.0%
exp-to-pow0.0%
unpow20.0%
rem-square-sqrt81.6%
mul-1-neg81.6%
Simplified81.6%
if -1.000000000000002e-309 < l Initial program 72.3%
div-inv72.3%
unpow-prod-down85.0%
metadata-eval85.0%
pow1/285.0%
metadata-eval85.0%
Applied egg-rr85.0%
unpow1/285.0%
Simplified85.0%
metadata-eval85.0%
pow1/285.0%
expm1-log1p-u83.6%
expm1-udef52.1%
Applied egg-rr52.1%
expm1-def83.6%
expm1-log1p85.0%
Simplified85.0%
associate-*r/89.3%
metadata-eval89.3%
frac-times90.1%
associate-*l/90.1%
associate-*r/90.1%
div-inv90.1%
metadata-eval90.1%
Applied egg-rr90.1%
Final simplification85.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l -1e-309)
(*
(- 1.0 (* (pow (/ 1.0 (/ (* d 2.0) (* M D))) 2.0) (* 0.5 (/ h l))))
(* t_0 (sqrt (/ d h))))
(*
(* t_0 (* (sqrt d) (sqrt (/ 1.0 h))))
(- 1.0 (/ (* h (* 0.5 (pow (* M (* 0.5 (/ D d))) 2.0))) l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= -1e-309) {
tmp = (1.0 - (pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (t_0 * sqrt((d / h)));
} else {
tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * pow((M * (0.5 * (D / d))), 2.0))) / 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) :: tmp
t_0 = sqrt((d / l))
if (l <= (-1d-309)) then
tmp = (1.0d0 - (((1.0d0 / ((d * 2.0d0) / (m * d_1))) ** 2.0d0) * (0.5d0 * (h / l)))) * (t_0 * sqrt((d / h)))
else
tmp = (t_0 * (sqrt(d) * sqrt((1.0d0 / h)))) * (1.0d0 - ((h * (0.5d0 * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))) / 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 tmp;
if (l <= -1e-309) {
tmp = (1.0 - (Math.pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (t_0 * Math.sqrt((d / h)));
} else {
tmp = (t_0 * (Math.sqrt(d) * Math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * Math.pow((M * (0.5 * (D / d))), 2.0))) / l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= -1e-309: tmp = (1.0 - (math.pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (t_0 * math.sqrt((d / h))) else: tmp = (t_0 * (math.sqrt(d) * math.sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * math.pow((M * (0.5 * (D / d))), 2.0))) / l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(1.0 - Float64((Float64(1.0 / Float64(Float64(d * 2.0) / Float64(M * D))) ^ 2.0) * Float64(0.5 * Float64(h / l)))) * Float64(t_0 * sqrt(Float64(d / h)))); else tmp = Float64(Float64(t_0 * Float64(sqrt(d) * sqrt(Float64(1.0 / h)))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (l <= -1e-309) tmp = (1.0 - (((1.0 / ((d * 2.0) / (M * D))) ^ 2.0) * (0.5 * (h / l)))) * (t_0 * sqrt((d / h))); else tmp = (t_0 * (sqrt(d) * sqrt((1.0 / h)))) * (1.0 - ((h * (0.5 * ((M * (0.5 * (D / d))) ^ 2.0))) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(1.0 - N[(N[Power[N[(1.0 / N[(N[(d * 2.0), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(1 - {\left(\frac{1}{\frac{d \cdot 2}{M \cdot D}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(t_0 \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
*-commutative71.2%
associate-*l*71.2%
times-frac69.9%
metadata-eval69.9%
Simplified69.9%
frac-times71.2%
clear-num71.3%
*-commutative71.3%
Applied egg-rr71.3%
if -1.000000000000002e-309 < l Initial program 72.3%
div-inv72.3%
unpow-prod-down85.0%
metadata-eval85.0%
pow1/285.0%
metadata-eval85.0%
Applied egg-rr85.0%
unpow1/285.0%
Simplified85.0%
metadata-eval85.0%
pow1/285.0%
expm1-log1p-u83.6%
expm1-udef52.1%
Applied egg-rr52.1%
expm1-def83.6%
expm1-log1p85.0%
Simplified85.0%
associate-*r/89.3%
metadata-eval89.3%
frac-times90.1%
associate-*l/90.1%
associate-*r/90.1%
div-inv90.1%
metadata-eval90.1%
Applied egg-rr90.1%
Final simplification79.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) d)))
(if (<= l -1e-309)
(*
(- 1.0 (* (pow (/ 1.0 (/ (* d 2.0) (* M D))) 2.0) (* 0.5 (/ h l))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) 0.5))
(- 1.0 (* 0.125 (* (/ h l) (* t_0 t_0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / d;
double tmp;
if (l <= -1e-309) {
tmp = (1.0 - (pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), 0.5)) * (1.0 - (0.125 * ((h / l) * (t_0 * t_0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (m * d_1) / d
if (l <= (-1d-309)) then
tmp = (1.0d0 - (((1.0d0 / ((d * 2.0d0) / (m * d_1))) ** 2.0d0) * (0.5d0 * (h / l)))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ** 0.5d0)) * (1.0d0 - (0.125d0 * ((h / l) * (t_0 * t_0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / d;
double tmp;
if (l <= -1e-309) {
tmp = (1.0 - (Math.pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.pow((d / l), 0.5)) * (1.0 - (0.125 * ((h / l) * (t_0 * t_0))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M * D) / d tmp = 0 if l <= -1e-309: tmp = (1.0 - (math.pow((1.0 / ((d * 2.0) / (M * D))), 2.0) * (0.5 * (h / l)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.pow((d / l), 0.5)) * (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / d) tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(1.0 - Float64((Float64(1.0 / Float64(Float64(d * 2.0) / Float64(M * D))) ^ 2.0) * Float64(0.5 * Float64(h / l)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(0.125 * Float64(Float64(h / l) * Float64(t_0 * t_0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M * D) / d; tmp = 0.0; if (l <= -1e-309) tmp = (1.0 - (((1.0 / ((d * 2.0) / (M * D))) ^ 2.0) * (0.5 * (h / l)))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ^ 0.5)) * (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(1.0 - N[(N[Power[N[(1.0 / N[(N[(d * 2.0), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(h / l), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(1 - {\left(\frac{1}{\frac{d \cdot 2}{M \cdot D}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{h}{\ell} \cdot \left(t_0 \cdot t_0\right)\right)\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 71.2%
metadata-eval71.2%
unpow1/271.2%
metadata-eval71.2%
unpow1/271.2%
*-commutative71.2%
associate-*l*71.2%
times-frac69.9%
metadata-eval69.9%
Simplified69.9%
frac-times71.2%
clear-num71.3%
*-commutative71.3%
Applied egg-rr71.3%
if -1.000000000000002e-309 < l Initial program 72.3%
Taylor expanded in M around 0 52.1%
associate-*r/52.1%
*-commutative52.1%
associate-*r/52.1%
associate-*r*52.2%
*-commutative52.2%
*-commutative52.2%
times-frac51.1%
unpow251.1%
unpow251.1%
unswap-sqr61.6%
unpow261.6%
Simplified61.6%
metadata-eval61.6%
pow1/261.6%
sqrt-div72.6%
Applied egg-rr72.6%
times-frac72.3%
*-commutative72.3%
*-commutative72.3%
Applied egg-rr85.1%
Final simplification77.4%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ d h)) (* (sqrt (/ d l)) (- 1.0 (* 0.5 (* h (/ (pow (* M (* 0.5 (/ D d))) 2.0) l)))))))
double code(double d, double h, double l, double M, double D) {
return sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (pow((M * (0.5 * (D / d))), 2.0) / 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 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (h * (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) / l)))))
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * (h * (Math.pow((M * (0.5 * (D / d))), 2.0) / l)))));
}
def code(d, h, l, M, D): return math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (h * (math.pow((M * (0.5 * (D / d))), 2.0) / l)))))
function code(d, h, l, M, D) return Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) / l)))))) end
function tmp = code(d, h, l, M, D) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (((M * (0.5 * (D / d))) ^ 2.0) / l))))); end
code[d_, h_, l_, M_, D_] := 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[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\right)
\end{array}
Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
associate-*l*71.7%
metadata-eval71.7%
times-frac71.3%
Simplified71.3%
associate-*r/73.5%
associate-*l/73.5%
associate-*r/73.5%
div-inv73.5%
metadata-eval73.5%
Applied egg-rr73.5%
expm1-log1p-u73.0%
expm1-udef73.0%
associate-/l*70.8%
Applied egg-rr70.8%
expm1-def70.8%
expm1-log1p71.3%
associate-/r/73.9%
*-commutative73.9%
Simplified73.9%
Final simplification73.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= M 1.65e-226)
(* t_0 t_1)
(if (<= M 2.15e-66)
(*
t_1
(*
t_0
(- 1.0 (* 0.5 (/ (* 0.25 (/ (* h (* (* M D) (* M D))) l)) (* d d))))))
(*
t_1
(*
t_0
(-
1.0
(* 0.5 (* 0.25 (* (/ (* D D) (* l d)) (/ (* M (* h M)) d)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (M <= 1.65e-226) {
tmp = t_0 * t_1;
} else if (M <= 2.15e-66) {
tmp = t_1 * (t_0 * (1.0 - (0.5 * ((0.25 * ((h * ((M * D) * (M * D))) / l)) / (d * d)))));
} else {
tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = sqrt((d / h))
if (m <= 1.65d-226) then
tmp = t_0 * t_1
else if (m <= 2.15d-66) then
tmp = t_1 * (t_0 * (1.0d0 - (0.5d0 * ((0.25d0 * ((h * ((m * d_1) * (m * d_1))) / l)) / (d * d)))))
else
tmp = t_1 * (t_0 * (1.0d0 - (0.5d0 * (0.25d0 * (((d_1 * d_1) / (l * d)) * ((m * (h * m)) / d))))))
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.sqrt((d / h));
double tmp;
if (M <= 1.65e-226) {
tmp = t_0 * t_1;
} else if (M <= 2.15e-66) {
tmp = t_1 * (t_0 * (1.0 - (0.5 * ((0.25 * ((h * ((M * D) * (M * D))) / l)) / (d * d)))));
} else {
tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if M <= 1.65e-226: tmp = t_0 * t_1 elif M <= 2.15e-66: tmp = t_1 * (t_0 * (1.0 - (0.5 * ((0.25 * ((h * ((M * D) * (M * D))) / l)) / (d * d))))) else: tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d)))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 1.65e-226) tmp = Float64(t_0 * t_1); elseif (M <= 2.15e-66) tmp = Float64(t_1 * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(0.25 * Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l)) / Float64(d * d)))))); else tmp = Float64(t_1 * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / Float64(l * d)) * Float64(Float64(M * Float64(h * M)) / d))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); tmp = 0.0; if (M <= 1.65e-226) tmp = t_0 * t_1; elseif (M <= 2.15e-66) tmp = t_1 * (t_0 * (1.0 - (0.5 * ((0.25 * ((h * ((M * D) * (M * D))) / l)) / (d * d))))); else tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d)))))); 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[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.65e-226], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[M, 2.15e-66], N[(t$95$1 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(0.25 * N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.65 \cdot 10^{-226}:\\
\;\;\;\;t_0 \cdot t_1\\
\mathbf{elif}\;M \leq 2.15 \cdot 10^{-66}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{0.25 \cdot \frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}{d \cdot d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell \cdot d} \cdot \frac{M \cdot \left(h \cdot M\right)}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.65e-226Initial program 74.5%
associate-*l*74.5%
metadata-eval74.5%
unpow1/274.5%
metadata-eval74.5%
unpow1/274.5%
sub-neg74.5%
+-commutative74.5%
*-commutative74.5%
distribute-rgt-neg-in74.5%
fma-def74.5%
Simplified73.2%
Taylor expanded in h around 0 45.9%
expm1-log1p-u43.9%
expm1-udef35.5%
*-rgt-identity35.5%
*-commutative35.5%
Applied egg-rr35.5%
expm1-def43.9%
expm1-log1p45.9%
Simplified45.9%
if 1.65e-226 < M < 2.15000000000000007e-66Initial program 65.7%
associate-*l*65.6%
metadata-eval65.6%
unpow1/265.6%
metadata-eval65.6%
unpow1/265.6%
associate-*l*65.6%
metadata-eval65.6%
times-frac65.6%
Simplified65.6%
Taylor expanded in M around 0 49.6%
associate-/r*52.8%
associate-*r/52.8%
*-commutative52.8%
*-commutative52.8%
associate-*l*52.8%
*-commutative52.8%
unpow252.8%
unpow252.8%
unswap-sqr62.7%
unpow262.7%
Simplified62.7%
if 2.15000000000000007e-66 < M Initial program 68.3%
associate-*l*68.3%
metadata-eval68.3%
unpow1/268.3%
metadata-eval68.3%
unpow1/268.3%
associate-*l*68.3%
metadata-eval68.3%
times-frac69.5%
Simplified69.5%
associate-*r/71.0%
associate-*l/71.0%
associate-*r/71.0%
div-inv71.0%
metadata-eval71.0%
Applied egg-rr71.0%
Taylor expanded in M around 0 42.7%
*-commutative42.7%
unpow242.7%
*-commutative42.7%
unpow242.7%
unpow242.7%
associate-*r*44.1%
Simplified44.1%
times-frac51.0%
*-commutative51.0%
associate-*l*54.1%
Applied egg-rr54.1%
Final simplification50.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))) (t_1 (sqrt (/ d l))) (t_2 (sqrt (/ d h))))
(if (<= M 3.1e-10)
(* t_1 t_2)
(if (<= M 7.8e+37)
(* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
(if (<= M 1.28e+66)
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
(*
t_2
(* t_1 (* -0.125 (* (/ D (/ (* d d) D)) (/ (* M M) (/ l h)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double t_1 = sqrt((d / l));
double t_2 = sqrt((d / h));
double tmp;
if (M <= 3.1e-10) {
tmp = t_1 * t_2;
} else if (M <= 7.8e+37) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
} else if (M <= 1.28e+66) {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
} else {
tmp = t_2 * (t_1 * (-0.125 * ((D / ((d * d) / D)) * ((M * M) / (l / h)))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double t_1 = Math.sqrt((d / l));
double t_2 = Math.sqrt((d / h));
double tmp;
if (M <= 3.1e-10) {
tmp = t_1 * t_2;
} else if (M <= 7.8e+37) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else if (M <= 1.28e+66) {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
} else {
tmp = t_2 * (t_1 * (-0.125 * ((D / ((d * d) / D)) * ((M * M) / (l / h)))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 3.1e-10) tmp = Float64(t_1 * t_2); elseif (M <= 7.8e+37) tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0))))); elseif (M <= 1.28e+66) tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); else tmp = Float64(t_2 * Float64(t_1 * Float64(-0.125 * Float64(Float64(D / Float64(Float64(d * d) / D)) * Float64(Float64(M * M) / Float64(l / h)))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 3.1e-10], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[M, 7.8e+37], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.28e+66], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[(-0.125 * N[(N[(D / N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 3.1 \cdot 10^{-10}:\\
\;\;\;\;t_1 \cdot t_2\\
\mathbf{elif}\;M \leq 7.8 \cdot 10^{+37}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{elif}\;M \leq 1.28 \cdot 10^{+66}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \left(-0.125 \cdot \left(\frac{D}{\frac{d \cdot d}{D}} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 3.10000000000000015e-10Initial program 72.8%
associate-*l*72.8%
metadata-eval72.8%
unpow1/272.8%
metadata-eval72.8%
unpow1/272.8%
sub-neg72.8%
+-commutative72.8%
*-commutative72.8%
distribute-rgt-neg-in72.8%
fma-def72.8%
Simplified71.3%
Taylor expanded in h around 0 48.8%
expm1-log1p-u46.9%
expm1-udef34.8%
*-rgt-identity34.8%
*-commutative34.8%
Applied egg-rr34.8%
expm1-def46.9%
expm1-log1p48.8%
Simplified48.8%
if 3.10000000000000015e-10 < M < 7.7999999999999997e37Initial program 41.7%
div-inv41.7%
unpow-prod-down30.0%
metadata-eval30.0%
pow1/230.0%
metadata-eval30.0%
Applied egg-rr30.0%
unpow1/230.0%
Simplified30.0%
Taylor expanded in d around 0 20.8%
associate-/l*20.8%
unpow220.8%
unpow220.8%
Simplified20.8%
if 7.7999999999999997e37 < M < 1.28000000000000003e66Initial program 61.3%
associate-*l*61.3%
metadata-eval61.3%
unpow1/261.3%
metadata-eval61.3%
unpow1/261.3%
sub-neg61.3%
+-commutative61.3%
*-commutative61.3%
distribute-rgt-neg-in61.3%
fma-def61.3%
Simplified61.3%
Taylor expanded in h around 0 61.5%
Taylor expanded in d around 0 21.6%
*-commutative21.6%
associate-/r*21.6%
Simplified21.6%
add-cbrt-cube2.2%
associate-/l/2.2%
associate-/l/2.2%
associate-/l/2.2%
Applied egg-rr2.2%
if 1.28000000000000003e66 < M Initial program 74.6%
associate-*l*74.5%
metadata-eval74.5%
unpow1/274.5%
metadata-eval74.5%
unpow1/274.5%
sub-neg74.5%
+-commutative74.5%
*-commutative74.5%
distribute-rgt-neg-in74.5%
fma-def74.5%
Simplified72.5%
Taylor expanded in h around inf 36.2%
*-commutative36.2%
*-commutative36.2%
times-frac37.8%
*-commutative37.8%
unpow237.8%
associate-/l*40.0%
unpow240.0%
associate-/l*40.0%
unpow240.0%
Simplified40.0%
Final simplification45.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= M 1.9e-79)
(* t_0 t_1)
(*
t_1
(*
t_0
(-
1.0
(* 0.5 (* 0.25 (* (/ (* D D) (* l d)) (/ (* M (* h M)) d))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (M <= 1.9e-79) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = sqrt((d / h))
if (m <= 1.9d-79) then
tmp = t_0 * t_1
else
tmp = t_1 * (t_0 * (1.0d0 - (0.5d0 * (0.25d0 * (((d_1 * d_1) / (l * d)) * ((m * (h * m)) / d))))))
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.sqrt((d / h));
double tmp;
if (M <= 1.9e-79) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d))))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if M <= 1.9e-79: tmp = t_0 * t_1 else: tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d)))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 1.9e-79) tmp = Float64(t_0 * t_1); else tmp = Float64(t_1 * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(0.25 * Float64(Float64(Float64(D * D) / Float64(l * d)) * Float64(Float64(M * Float64(h * M)) / d))))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); tmp = 0.0; if (M <= 1.9e-79) tmp = t_0 * t_1; else tmp = t_1 * (t_0 * (1.0 - (0.5 * (0.25 * (((D * D) / (l * d)) * ((M * (h * M)) / d)))))); 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[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.9e-79], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.9 \cdot 10^{-79}:\\
\;\;\;\;t_0 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell \cdot d} \cdot \frac{M \cdot \left(h \cdot M\right)}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 1.9000000000000001e-79Initial program 73.8%
associate-*l*73.8%
metadata-eval73.8%
unpow1/273.8%
metadata-eval73.8%
unpow1/273.8%
sub-neg73.8%
+-commutative73.8%
*-commutative73.8%
distribute-rgt-neg-in73.8%
fma-def73.8%
Simplified72.2%
Taylor expanded in h around 0 48.7%
expm1-log1p-u46.7%
expm1-udef35.7%
*-rgt-identity35.7%
*-commutative35.7%
Applied egg-rr35.7%
expm1-def46.7%
expm1-log1p48.7%
Simplified48.7%
if 1.9000000000000001e-79 < M Initial program 66.5%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
associate-*l*66.4%
metadata-eval66.4%
times-frac67.6%
Simplified67.6%
associate-*r/69.1%
associate-*l/69.1%
associate-*r/69.1%
div-inv69.1%
metadata-eval69.1%
Applied egg-rr69.1%
Taylor expanded in M around 0 41.6%
*-commutative41.6%
unpow241.6%
*-commutative41.6%
unpow241.6%
unpow241.6%
associate-*r*42.9%
Simplified42.9%
times-frac49.6%
*-commutative49.6%
associate-*l*52.6%
Applied egg-rr52.6%
Final simplification49.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= M 1.8e-79)
(* t_0 t_1)
(*
t_1
(*
t_0
(+ 1.0 (/ (* -0.125 (* (* D D) (* h (* M M)))) (* l (* d d)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (M <= 1.8e-79) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (1.0 + ((-0.125 * ((D * D) * (h * (M * M)))) / (l * (d * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = sqrt((d / h))
if (m <= 1.8d-79) then
tmp = t_0 * t_1
else
tmp = t_1 * (t_0 * (1.0d0 + (((-0.125d0) * ((d_1 * d_1) * (h * (m * m)))) / (l * (d * d)))))
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.sqrt((d / h));
double tmp;
if (M <= 1.8e-79) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (1.0 + ((-0.125 * ((D * D) * (h * (M * M)))) / (l * (d * d)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if M <= 1.8e-79: tmp = t_0 * t_1 else: tmp = t_1 * (t_0 * (1.0 + ((-0.125 * ((D * D) * (h * (M * M)))) / (l * (d * d))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 1.8e-79) tmp = Float64(t_0 * t_1); else tmp = Float64(t_1 * Float64(t_0 * Float64(1.0 + Float64(Float64(-0.125 * Float64(Float64(D * D) * Float64(h * Float64(M * M)))) / Float64(l * Float64(d * d)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); tmp = 0.0; if (M <= 1.8e-79) tmp = t_0 * t_1; else tmp = t_1 * (t_0 * (1.0 + ((-0.125 * ((D * D) * (h * (M * M)))) / (l * (d * d))))); 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[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.8e-79], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(1.0 + N[(N[(-0.125 * N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.8 \cdot 10^{-79}:\\
\;\;\;\;t_0 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + \frac{-0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\right)\\
\end{array}
\end{array}
if M < 1.8000000000000001e-79Initial program 73.8%
associate-*l*73.8%
metadata-eval73.8%
unpow1/273.8%
metadata-eval73.8%
unpow1/273.8%
sub-neg73.8%
+-commutative73.8%
*-commutative73.8%
distribute-rgt-neg-in73.8%
fma-def73.8%
Simplified72.2%
Taylor expanded in h around 0 48.7%
expm1-log1p-u46.7%
expm1-udef35.7%
*-rgt-identity35.7%
*-commutative35.7%
Applied egg-rr35.7%
expm1-def46.7%
expm1-log1p48.7%
Simplified48.7%
if 1.8000000000000001e-79 < M Initial program 66.5%
associate-*l*66.4%
metadata-eval66.4%
unpow1/266.4%
metadata-eval66.4%
unpow1/266.4%
sub-neg66.4%
+-commutative66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
fma-def66.4%
Simplified65.1%
Taylor expanded in h around 0 41.6%
associate-*r/41.6%
unpow241.6%
*-commutative41.6%
unpow241.6%
unpow241.6%
Simplified41.6%
Final simplification46.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) d)))
(*
(- 1.0 (* 0.125 (* (/ h l) (* t_0 t_0))))
(* (pow (/ d l) 0.5) (pow (/ d h) 0.5)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / d;
return (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))) * (pow((d / l), 0.5) * pow((d / 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
real(8) :: t_0
t_0 = (m * d_1) / d
code = (1.0d0 - (0.125d0 * ((h / l) * (t_0 * t_0)))) * (((d / l) ** 0.5d0) * ((d / h) ** 0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / d;
return (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))) * (Math.pow((d / l), 0.5) * Math.pow((d / h), 0.5));
}
def code(d, h, l, M, D): t_0 = (M * D) / d return (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))) * (math.pow((d / l), 0.5) * math.pow((d / h), 0.5))
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / d) return Float64(Float64(1.0 - Float64(0.125 * Float64(Float64(h / l) * Float64(t_0 * t_0)))) * Float64((Float64(d / l) ^ 0.5) * (Float64(d / h) ^ 0.5))) end
function tmp = code(d, h, l, M, D) t_0 = (M * D) / d; tmp = (1.0 - (0.125 * ((h / l) * (t_0 * t_0)))) * (((d / l) ^ 0.5) * ((d / h) ^ 0.5)); end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, N[(N[(1.0 - N[(0.125 * N[(N[(h / l), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
\left(1 - 0.125 \cdot \left(\frac{h}{\ell} \cdot \left(t_0 \cdot t_0\right)\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot {\left(\frac{d}{h}\right)}^{0.5}\right)
\end{array}
\end{array}
Initial program 71.7%
Taylor expanded in M around 0 46.3%
associate-*r/46.3%
*-commutative46.3%
associate-*r/46.3%
associate-*r*46.9%
*-commutative46.9%
*-commutative46.9%
times-frac46.7%
unpow246.7%
unpow246.7%
unswap-sqr58.9%
unpow258.9%
Simplified58.9%
times-frac71.7%
*-commutative71.7%
*-commutative71.7%
Applied egg-rr71.7%
Final simplification71.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h))))
(if (<= M 5.5e-11)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (or (<= M 2.2e+38) (and (not (<= M 3.5e+74)) (<= M 3e+200)))
(* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
(* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double tmp;
if (M <= 5.5e-11) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200))) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
} else {
tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
}
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 (M <= 5.5e-11) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200))) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else {
tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) tmp = 0.0 if (M <= 5.5e-11) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200))) tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0))))); else tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 5.5e-11], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 2.2e+38], And[N[Not[LessEqual[M, 3.5e+74]], $MachinePrecision], LessEqual[M, 3e+200]]], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;M \leq 5.5 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;M \leq 2.2 \cdot 10^{+38} \lor \neg \left(M \leq 3.5 \cdot 10^{+74}\right) \land M \leq 3 \cdot 10^{+200}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\
\end{array}
\end{array}
if M < 5.49999999999999975e-11Initial program 72.8%
associate-*l*72.8%
metadata-eval72.8%
unpow1/272.8%
metadata-eval72.8%
unpow1/272.8%
sub-neg72.8%
+-commutative72.8%
*-commutative72.8%
distribute-rgt-neg-in72.8%
fma-def72.8%
Simplified71.3%
Taylor expanded in h around 0 48.8%
expm1-log1p-u46.9%
expm1-udef34.8%
*-rgt-identity34.8%
*-commutative34.8%
Applied egg-rr34.8%
expm1-def46.9%
expm1-log1p48.8%
Simplified48.8%
if 5.49999999999999975e-11 < M < 2.20000000000000006e38 or 3.50000000000000014e74 < M < 2.99999999999999991e200Initial program 62.6%
div-inv62.6%
unpow-prod-down46.9%
metadata-eval46.9%
pow1/246.9%
metadata-eval46.9%
Applied egg-rr46.9%
unpow1/246.9%
Simplified46.9%
Taylor expanded in d around 0 32.8%
associate-/l*32.7%
unpow232.7%
unpow232.7%
Simplified32.7%
if 2.20000000000000006e38 < M < 3.50000000000000014e74 or 2.99999999999999991e200 < M Initial program 74.9%
associate-*l*74.9%
metadata-eval74.9%
unpow1/274.9%
metadata-eval74.9%
unpow1/274.9%
sub-neg74.9%
+-commutative74.9%
*-commutative74.9%
distribute-rgt-neg-in74.9%
fma-def74.9%
Simplified74.7%
Taylor expanded in h around 0 23.6%
Taylor expanded in d around 0 11.4%
*-commutative11.4%
associate-/r*11.4%
Simplified11.4%
add-cbrt-cube14.3%
associate-/l/14.3%
associate-/l/14.3%
associate-/l/14.3%
Applied egg-rr14.3%
Final simplification42.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= M 1.02e-11)
(* t_0 t_1)
(* t_1 (* t_0 (* (/ (* h (* (* M D) (* M D))) l) (/ -0.125 (* d d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double tmp;
if (M <= 1.02e-11) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (((h * ((M * D) * (M * D))) / l) * (-0.125 / (d * 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = sqrt((d / h))
if (m <= 1.02d-11) then
tmp = t_0 * t_1
else
tmp = t_1 * (t_0 * (((h * ((m * d_1) * (m * d_1))) / l) * ((-0.125d0) / (d * d))))
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.sqrt((d / h));
double tmp;
if (M <= 1.02e-11) {
tmp = t_0 * t_1;
} else {
tmp = t_1 * (t_0 * (((h * ((M * D) * (M * D))) / l) * (-0.125 / (d * d))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) tmp = 0 if M <= 1.02e-11: tmp = t_0 * t_1 else: tmp = t_1 * (t_0 * (((h * ((M * D) * (M * D))) / l) * (-0.125 / (d * d)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (M <= 1.02e-11) tmp = Float64(t_0 * t_1); else tmp = Float64(t_1 * Float64(t_0 * Float64(Float64(Float64(h * Float64(Float64(M * D) * Float64(M * D))) / l) * Float64(-0.125 / Float64(d * d))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); tmp = 0.0; if (M <= 1.02e-11) tmp = t_0 * t_1; else tmp = t_1 * (t_0 * (((h * ((M * D) * (M * D))) / l) * (-0.125 / (d * d)))); 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[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 1.02e-11], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(N[(N[(h * N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(-0.125 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.02 \cdot 10^{-11}:\\
\;\;\;\;t_0 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell} \cdot \frac{-0.125}{d \cdot d}\right)\right)\\
\end{array}
\end{array}
if M < 1.01999999999999994e-11Initial program 72.8%
associate-*l*72.8%
metadata-eval72.8%
unpow1/272.8%
metadata-eval72.8%
unpow1/272.8%
sub-neg72.8%
+-commutative72.8%
*-commutative72.8%
distribute-rgt-neg-in72.8%
fma-def72.8%
Simplified71.3%
Taylor expanded in h around 0 48.8%
expm1-log1p-u46.9%
expm1-udef34.8%
*-rgt-identity34.8%
*-commutative34.8%
Applied egg-rr34.8%
expm1-def46.9%
expm1-log1p48.8%
Simplified48.8%
if 1.01999999999999994e-11 < M Initial program 68.5%
associate-*l*68.4%
metadata-eval68.4%
unpow1/268.4%
metadata-eval68.4%
unpow1/268.4%
sub-neg68.4%
+-commutative68.4%
*-commutative68.4%
distribute-rgt-neg-in68.4%
fma-def68.4%
Simplified66.9%
Taylor expanded in h around inf 32.8%
associate-*r/32.8%
*-commutative32.8%
*-commutative32.8%
times-frac34.3%
*-commutative34.3%
*-commutative34.3%
associate-*l*34.7%
*-commutative34.7%
unpow234.7%
unpow234.7%
unswap-sqr39.3%
unpow239.3%
Simplified39.3%
Final simplification46.4%
(FPCore (d h l M D)
:precision binary64
(if (<= M 1.9e-10)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (or (<= M 1.6e+38) (not (<= M 8.5e+71)))
(* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
(* d (cbrt (pow (/ (/ 1.0 h) l) 1.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.9e-10) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if ((M <= 1.6e+38) || !(M <= 8.5e+71)) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
} else {
tmp = d * cbrt(pow(((1.0 / h) / l), 1.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 1.9e-10) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if ((M <= 1.6e+38) || !(M <= 8.5e+71)) {
tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
} else {
tmp = d * Math.cbrt(Math.pow(((1.0 / h) / l), 1.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (M <= 1.9e-10) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif ((M <= 1.6e+38) || !(M <= 8.5e+71)) tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0))))); else tmp = Float64(d * cbrt((Float64(Float64(1.0 / h) / l) ^ 1.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 1.9e-10], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 1.6e+38], N[Not[LessEqual[M, 8.5e+71]], $MachinePrecision]], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[Power[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.9 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;M \leq 1.6 \cdot 10^{+38} \lor \neg \left(M \leq 8.5 \cdot 10^{+71}\right):\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\
\end{array}
\end{array}
if M < 1.8999999999999999e-10Initial program 72.8%
associate-*l*72.8%
metadata-eval72.8%
unpow1/272.8%
metadata-eval72.8%
unpow1/272.8%
sub-neg72.8%
+-commutative72.8%
*-commutative72.8%
distribute-rgt-neg-in72.8%
fma-def72.8%
Simplified71.3%
Taylor expanded in h around 0 48.8%
expm1-log1p-u46.9%
expm1-udef34.8%
*-rgt-identity34.8%
*-commutative34.8%
Applied egg-rr34.8%
expm1-def46.9%
expm1-log1p48.8%
Simplified48.8%
if 1.8999999999999999e-10 < M < 1.59999999999999993e38 or 8.4999999999999996e71 < M Initial program 68.5%
div-inv68.5%
unpow-prod-down40.8%
metadata-eval40.8%
pow1/240.8%
metadata-eval40.8%
Applied egg-rr40.8%
unpow1/240.8%
Simplified40.8%
Taylor expanded in d around 0 30.7%
associate-/l*30.7%
unpow230.7%
unpow230.7%
Simplified30.7%
if 1.59999999999999993e38 < M < 8.4999999999999996e71Initial program 67.8%
associate-*l*67.8%
metadata-eval67.8%
unpow1/267.8%
metadata-eval67.8%
unpow1/267.8%
sub-neg67.8%
+-commutative67.8%
*-commutative67.8%
distribute-rgt-neg-in67.8%
fma-def67.8%
Simplified67.8%
Taylor expanded in h around 0 51.5%
Taylor expanded in d around 0 18.2%
add-cbrt-cube18.0%
pow1/316.8%
add-sqr-sqrt16.8%
pow116.8%
pow1/216.8%
pow-prod-up16.7%
metadata-eval16.7%
Applied egg-rr16.7%
unpow1/318.0%
*-commutative18.0%
associate-/r*18.0%
Simplified18.0%
Final simplification43.9%
(FPCore (d h l M D) :precision binary64 (if (<= M 6600.0) (* (sqrt (/ d l)) (sqrt (/ d h))) (* d (cbrt (pow (/ (/ 1.0 h) l) 1.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 6600.0) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d * cbrt(pow(((1.0 / h) / l), 1.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 6600.0) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d * Math.cbrt(Math.pow(((1.0 / h) / l), 1.5));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (M <= 6600.0) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d * cbrt((Float64(Float64(1.0 / h) / l) ^ 1.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 6600.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[Power[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6600:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\
\end{array}
\end{array}
if M < 6600Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.2%
Taylor expanded in h around 0 48.1%
expm1-log1p-u46.2%
expm1-udef34.3%
*-rgt-identity34.3%
*-commutative34.3%
Applied egg-rr34.3%
expm1-def46.2%
expm1-log1p48.1%
Simplified48.1%
if 6600 < M Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.1%
Taylor expanded in h around 0 22.1%
Taylor expanded in d around 0 14.6%
add-cbrt-cube16.1%
pow1/315.6%
add-sqr-sqrt15.6%
pow115.6%
pow1/215.6%
pow-prod-up15.6%
metadata-eval15.6%
Applied egg-rr15.6%
unpow1/316.1%
*-commutative16.1%
associate-/r*16.1%
Simplified16.1%
Final simplification40.3%
(FPCore (d h l M D) :precision binary64 (if (<= d 3.7e-258) (sqrt (* (/ d l) (/ d h))) (* d (/ (sqrt (/ 1.0 l)) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 3.7e-258) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = d * (sqrt((1.0 / l)) / sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 3.7d-258) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = d * (sqrt((1.0d0 / l)) / sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 3.7e-258) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * (Math.sqrt((1.0 / l)) / Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 3.7e-258: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * (math.sqrt((1.0 / l)) / math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 3.7e-258) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / l)) / sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 3.7e-258) tmp = sqrt(((d / l) * (d / h))); else tmp = d * (sqrt((1.0 / l)) / sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 3.7e-258], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 3.7 \cdot 10^{-258}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < 3.7e-258Initial program 69.0%
associate-*l*69.0%
metadata-eval69.0%
unpow1/269.0%
metadata-eval69.0%
unpow1/269.0%
sub-neg69.0%
+-commutative69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
fma-def69.0%
Simplified67.1%
Taylor expanded in h around 0 39.4%
pow1/239.4%
metadata-eval39.4%
sqr-pow39.3%
pow239.3%
metadata-eval39.3%
metadata-eval39.3%
Applied egg-rr39.3%
expm1-log1p-u37.7%
expm1-udef30.4%
*-rgt-identity30.4%
*-commutative30.4%
pow-pow30.4%
metadata-eval30.4%
pow1/230.4%
pow-prod-down25.4%
Applied egg-rr25.4%
expm1-def31.0%
expm1-log1p32.1%
unpow1/232.1%
Simplified32.1%
if 3.7e-258 < d Initial program 75.5%
associate-*l*75.6%
metadata-eval75.6%
unpow1/275.6%
metadata-eval75.6%
unpow1/275.6%
sub-neg75.6%
+-commutative75.6%
*-commutative75.6%
distribute-rgt-neg-in75.6%
fma-def75.6%
Simplified74.5%
Taylor expanded in h around 0 45.3%
Taylor expanded in d around 0 41.2%
*-commutative41.2%
associate-/r*41.2%
Simplified41.2%
sqrt-div51.9%
Applied egg-rr51.9%
Final simplification40.2%
(FPCore (d h l M D) :precision binary64 (if (<= M 6500.0) (* (sqrt (/ d l)) (sqrt (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 6500.0) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = 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 <= 6500.0d0) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = 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 <= 6500.0) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 6500.0: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 6500.0) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = 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 <= 6500.0) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 6500.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6500:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if M < 6500Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.2%
Taylor expanded in h around 0 48.1%
expm1-log1p-u46.2%
expm1-udef34.3%
*-rgt-identity34.3%
*-commutative34.3%
Applied egg-rr34.3%
expm1-def46.2%
expm1-log1p48.1%
Simplified48.1%
if 6500 < M Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.1%
Taylor expanded in h around 0 22.1%
Taylor expanded in d around 0 14.6%
pow1/214.6%
inv-pow14.6%
pow-pow14.7%
metadata-eval14.7%
Applied egg-rr14.7%
Final simplification40.0%
(FPCore (d h l M D) :precision binary64 (if (<= M 6800.0) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (M <= 6800.0) {
tmp = sqrt(((d / l) * (d / h)));
} else {
tmp = 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 <= 6800.0d0) then
tmp = sqrt(((d / l) * (d / h)))
else
tmp = 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 <= 6800.0) {
tmp = Math.sqrt(((d / l) * (d / h)));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if M <= 6800.0: tmp = math.sqrt(((d / l) * (d / h))) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (M <= 6800.0) tmp = sqrt(Float64(Float64(d / l) * Float64(d / h))); else tmp = 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 <= 6800.0) tmp = sqrt(((d / l) * (d / h))); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 6800.0], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6800:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if M < 6800Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.2%
Taylor expanded in h around 0 48.1%
pow1/248.1%
metadata-eval48.1%
sqr-pow48.0%
pow248.0%
metadata-eval48.0%
metadata-eval48.0%
Applied egg-rr48.0%
expm1-log1p-u46.1%
expm1-udef34.3%
*-rgt-identity34.3%
*-commutative34.3%
pow-pow34.3%
metadata-eval34.3%
pow1/234.3%
pow-prod-down28.2%
Applied egg-rr28.2%
expm1-def36.9%
expm1-log1p38.1%
unpow1/238.1%
Simplified38.1%
if 6800 < M Initial program 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.1%
Taylor expanded in h around 0 22.1%
Taylor expanded in d around 0 14.6%
pow1/214.6%
inv-pow14.6%
pow-pow14.7%
metadata-eval14.7%
Applied egg-rr14.7%
Final simplification32.5%
(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 71.7%
associate-*l*71.7%
metadata-eval71.7%
unpow1/271.7%
metadata-eval71.7%
unpow1/271.7%
sub-neg71.7%
+-commutative71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
Simplified70.2%
Taylor expanded in h around 0 41.8%
Taylor expanded in d around 0 24.1%
pow1/224.1%
inv-pow24.1%
pow-pow24.1%
metadata-eval24.1%
Applied egg-rr24.1%
Final simplification24.1%
herbie shell --seed 2023240
(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)))))