
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -1.034e+217)
(*
(* (sqrt (/ d h)) (/ t_0 (sqrt (- l))))
(- 1.0 (* 0.5 (pow (* (* M (* 0.5 (/ D d))) (sqrt (/ h l))) 2.0))))
(if (<= l -2e-310)
(*
(sqrt (/ d l))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -1.034e+217) {
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * pow(((M * (0.5 * (D / d))) * sqrt((h / l))), 2.0)));
} else if (l <= -2e-310) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (h * (-0.125 * (pow(((M * 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)
if (l <= (-1.034d+217)) then
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0d0 - (0.5d0 * (((m * (0.5d0 * (d_1 / d))) * sqrt((h / l))) ** 2.0d0)))
else if (l <= (-2d-310)) then
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + (h * ((-0.125d0) * ((((m * 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);
double tmp;
if (l <= -1.034e+217) {
tmp = (Math.sqrt((d / h)) * (t_0 / Math.sqrt(-l))) * (1.0 - (0.5 * Math.pow(((M * (0.5 * (D / d))) * Math.sqrt((h / l))), 2.0)));
} else if (l <= -2e-310) {
tmp = Math.sqrt((d / l)) * ((t_0 / Math.sqrt(-h)) * (1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -1.034e+217: tmp = (math.sqrt((d / h)) * (t_0 / math.sqrt(-l))) * (1.0 - (0.5 * math.pow(((M * (0.5 * (D / d))) * math.sqrt((h / l))), 2.0))) elif l <= -2e-310: tmp = math.sqrt((d / l)) * ((t_0 / math.sqrt(-h)) * (1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l)))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -1.034e+217) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(M * Float64(0.5 * Float64(D / d))) * sqrt(Float64(h / l))) ^ 2.0)))); elseif (l <= -2e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -1.034e+217) tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * (((M * (0.5 * (D / d))) * sqrt((h / l))) ^ 2.0))); elseif (l <= -2e-310) tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -1.034e+217], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -1.034 \cdot 10^{+217}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.034e217Initial program 44.3%
Simplified44.3%
add-sqr-sqrt44.3%
pow244.3%
sqrt-prod44.3%
sqrt-pow145.0%
metadata-eval45.0%
pow145.0%
frac-times45.0%
associate-/l*45.0%
*-un-lft-identity45.0%
times-frac45.0%
metadata-eval45.0%
Applied egg-rr45.0%
frac-2neg45.0%
sqrt-div72.3%
Applied egg-rr72.3%
if -1.034e217 < l < -1.999999999999994e-310Initial program 74.3%
Simplified74.3%
frac-2neg74.3%
sqrt-div82.7%
Applied egg-rr82.7%
if -1.999999999999994e-310 < l Initial program 62.9%
Simplified61.7%
add-sqr-sqrt61.7%
pow261.7%
sqrt-prod61.6%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
frac-times64.1%
associate-/l*62.8%
*-un-lft-identity62.8%
times-frac62.8%
metadata-eval62.8%
Applied egg-rr62.8%
Taylor expanded in h around inf 44.4%
sub-neg44.4%
distribute-rgt-in44.4%
lft-mult-inverse44.4%
distribute-lft-neg-in44.4%
metadata-eval44.4%
associate-/r*45.8%
associate-/l*46.5%
unpow246.5%
unpow246.5%
unpow246.5%
times-frac54.9%
swap-sqr65.9%
unpow265.9%
associate-*r/65.9%
Simplified65.9%
*-commutative65.9%
sqrt-div74.5%
sqrt-div87.7%
frac-times87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Final simplification85.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))))
(*
(/ d (* (sqrt l) (sqrt h)))
(+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (h * (-0.125 * (pow(((M * 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) :: tmp
if (l <= (-2d-310)) then
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (d / (sqrt(l) * sqrt(h))) * (1.0d0 + (h * ((-0.125d0) * ((((m * 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 tmp;
if (l <= -2e-310) {
tmp = Math.sqrt((d / l)) * ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * (1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = math.sqrt((d / l)) * ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * (1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-310) tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)))); else tmp = (d / (sqrt(l) * sqrt(h))) * (1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 69.4%
Simplified69.4%
frac-2neg69.4%
sqrt-div77.3%
Applied egg-rr77.3%
if -1.999999999999994e-310 < l Initial program 62.9%
Simplified61.7%
add-sqr-sqrt61.7%
pow261.7%
sqrt-prod61.6%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
frac-times64.1%
associate-/l*62.8%
*-un-lft-identity62.8%
times-frac62.8%
metadata-eval62.8%
Applied egg-rr62.8%
Taylor expanded in h around inf 44.4%
sub-neg44.4%
distribute-rgt-in44.4%
lft-mult-inverse44.4%
distribute-lft-neg-in44.4%
metadata-eval44.4%
associate-/r*45.8%
associate-/l*46.5%
unpow246.5%
unpow246.5%
unpow246.5%
times-frac54.9%
swap-sqr65.9%
unpow265.9%
associate-*r/65.9%
Simplified65.9%
*-commutative65.9%
sqrt-div74.5%
sqrt-div87.7%
frac-times87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Final simplification83.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l))))))
(if (<= d 2e-285)
(* t_0 (* (sqrt (/ d h)) (sqrt (/ d l))))
(if (<= d 2.8e-224)
(* (* -0.125 (/ (sqrt h) (pow l 1.5))) (pow (* D (/ M (sqrt d))) 2.0))
(* (/ d (* (sqrt l) (sqrt h))) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)));
double tmp;
if (d <= 2e-285) {
tmp = t_0 * (sqrt((d / h)) * sqrt((d / l)));
} else if (d <= 2.8e-224) {
tmp = (-0.125 * (sqrt(h) / pow(l, 1.5))) * pow((D * (M / sqrt(d))), 2.0);
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * 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 = 1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))
if (d <= 2d-285) then
tmp = t_0 * (sqrt((d / h)) * sqrt((d / l)))
else if (d <= 2.8d-224) then
tmp = ((-0.125d0) * (sqrt(h) / (l ** 1.5d0))) * ((d_1 * (m / sqrt(d))) ** 2.0d0)
else
tmp = (d / (sqrt(l) * sqrt(h))) * 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 = 1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)));
double tmp;
if (d <= 2e-285) {
tmp = t_0 * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else if (d <= 2.8e-224) {
tmp = (-0.125 * (Math.sqrt(h) / Math.pow(l, 1.5))) * Math.pow((D * (M / Math.sqrt(d))), 2.0);
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l))) tmp = 0 if d <= 2e-285: tmp = t_0 * (math.sqrt((d / h)) * math.sqrt((d / l))) elif d <= 2.8e-224: tmp = (-0.125 * (math.sqrt(h) / math.pow(l, 1.5))) * math.pow((D * (M / math.sqrt(d))), 2.0) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) tmp = 0.0 if (d <= 2e-285) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); elseif (d <= 2.8e-224) tmp = Float64(Float64(-0.125 * Float64(sqrt(h) / (l ^ 1.5))) * (Float64(D * Float64(M / sqrt(d))) ^ 2.0)); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l))); tmp = 0.0; if (d <= 2e-285) tmp = t_0 * (sqrt((d / h)) * sqrt((d / l))); elseif (d <= 2.8e-224) tmp = (-0.125 * (sqrt(h) / (l ^ 1.5))) * ((D * (M / sqrt(d))) ^ 2.0); else tmp = (d / (sqrt(l) * sqrt(h))) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 2e-285], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.8e-224], N[(N[(-0.125 * N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(D * N[(M / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;d \leq 2 \cdot 10^{-285}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;d \leq 2.8 \cdot 10^{-224}:\\
\;\;\;\;\left(-0.125 \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right) \cdot {\left(D \cdot \frac{M}{\sqrt{d}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot t\_0\\
\end{array}
\end{array}
if d < 2.00000000000000015e-285Initial program 69.6%
Simplified67.0%
add-sqr-sqrt67.0%
pow267.0%
sqrt-prod67.1%
sqrt-pow167.9%
metadata-eval67.9%
pow167.9%
frac-times70.4%
associate-/l*67.9%
*-un-lft-identity67.9%
times-frac67.9%
metadata-eval67.9%
Applied egg-rr67.9%
Taylor expanded in h around inf 45.2%
sub-neg45.2%
distribute-rgt-in45.2%
lft-mult-inverse45.2%
distribute-lft-neg-in45.2%
metadata-eval45.2%
associate-/r*46.1%
associate-/l*43.5%
unpow243.5%
unpow243.5%
unpow243.5%
times-frac54.8%
swap-sqr73.1%
unpow273.1%
associate-*r/73.1%
Simplified73.1%
if 2.00000000000000015e-285 < d < 2.7999999999999998e-224Initial program 33.3%
Simplified33.2%
Taylor expanded in M around inf 11.1%
associate-*r/11.1%
associate-*r*11.1%
associate-*r*11.1%
associate-*l/11.5%
associate-*r/11.5%
*-commutative11.5%
associate-*l*11.5%
Simplified22.5%
Taylor expanded in d around 0 24.1%
*-commutative24.1%
associate-*l*24.1%
associate-/l*24.1%
Simplified24.1%
add-sqr-sqrt1.5%
pow21.5%
Applied egg-rr0.0%
unpow20.0%
swap-sqr0.0%
rem-square-sqrt99.8%
*-commutative99.8%
unpow299.8%
Simplified99.8%
if 2.7999999999999998e-224 < d Initial program 64.6%
Simplified63.9%
add-sqr-sqrt63.9%
pow263.9%
sqrt-prod63.9%
sqrt-pow165.2%
metadata-eval65.2%
pow165.2%
frac-times65.9%
associate-/l*65.2%
*-un-lft-identity65.2%
times-frac65.2%
metadata-eval65.2%
Applied egg-rr65.2%
Taylor expanded in h around inf 47.2%
sub-neg47.2%
distribute-rgt-in47.2%
lft-mult-inverse47.2%
distribute-lft-neg-in47.2%
metadata-eval47.2%
associate-/r*48.8%
associate-/l*49.5%
unpow249.5%
unpow249.5%
unpow249.5%
times-frac56.5%
swap-sqr68.6%
unpow268.6%
associate-*r/68.5%
Simplified68.5%
*-commutative68.5%
sqrt-div77.2%
sqrt-div91.0%
frac-times91.2%
add-sqr-sqrt91.3%
Applied egg-rr91.3%
Final simplification83.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l)))))
(t_1 (sqrt (/ d h))))
(if (<= l -5e+174)
(* t_1 (/ (sqrt (- d)) (sqrt (- l))))
(if (<= l -2e-310)
(* t_0 (* t_1 (sqrt (/ d l))))
(* (/ d (* (sqrt l) (sqrt h))) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)));
double t_1 = sqrt((d / h));
double tmp;
if (l <= -5e+174) {
tmp = t_1 * (sqrt(-d) / sqrt(-l));
} else if (l <= -2e-310) {
tmp = t_0 * (t_1 * sqrt((d / l)));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))
t_1 = sqrt((d / h))
if (l <= (-5d+174)) then
tmp = t_1 * (sqrt(-d) / sqrt(-l))
else if (l <= (-2d-310)) then
tmp = t_0 * (t_1 * sqrt((d / l)))
else
tmp = (d / (sqrt(l) * sqrt(h))) * 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 = 1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)));
double t_1 = Math.sqrt((d / h));
double tmp;
if (l <= -5e+174) {
tmp = t_1 * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (l <= -2e-310) {
tmp = t_0 * (t_1 * Math.sqrt((d / l)));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l))) t_1 = math.sqrt((d / h)) tmp = 0 if l <= -5e+174: tmp = t_1 * (math.sqrt(-d) / math.sqrt(-l)) elif l <= -2e-310: tmp = t_0 * (t_1 * math.sqrt((d / l))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -5e+174) tmp = Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (l <= -2e-310) tmp = Float64(t_0 * Float64(t_1 * sqrt(Float64(d / l)))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l))); t_1 = sqrt((d / h)); tmp = 0.0; if (l <= -5e+174) tmp = t_1 * (sqrt(-d) / sqrt(-l)); elseif (l <= -2e-310) tmp = t_0 * (t_1 * sqrt((d / l))); else tmp = (d / (sqrt(l) * sqrt(h))) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5e+174], N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(t$95$0 * N[(t$95$1 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{+174}:\\
\;\;\;\;t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot t\_0\\
\end{array}
\end{array}
if l < -4.9999999999999997e174Initial program 39.3%
Simplified39.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt3.0%
mul-1-neg3.0%
Simplified3.0%
add-sqr-sqrt2.0%
sqrt-unprod40.6%
sqr-neg40.6%
add-sqr-sqrt40.6%
frac-2neg40.6%
sqrt-div57.9%
Applied egg-rr57.9%
if -4.9999999999999997e174 < l < -1.999999999999994e-310Initial program 77.4%
Simplified75.1%
add-sqr-sqrt75.1%
pow275.1%
sqrt-prod75.1%
sqrt-pow176.0%
metadata-eval76.0%
pow176.0%
frac-times78.2%
associate-/l*76.0%
*-un-lft-identity76.0%
times-frac76.0%
metadata-eval76.0%
Applied egg-rr76.0%
Taylor expanded in h around inf 51.8%
sub-neg51.8%
distribute-rgt-in51.8%
lft-mult-inverse51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
associate-/r*53.0%
associate-/l*49.6%
unpow249.6%
unpow249.6%
unpow249.6%
times-frac62.1%
swap-sqr82.0%
unpow282.0%
associate-*r/82.0%
Simplified82.0%
if -1.999999999999994e-310 < l Initial program 62.9%
Simplified61.7%
add-sqr-sqrt61.7%
pow261.7%
sqrt-prod61.6%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
frac-times64.1%
associate-/l*62.8%
*-un-lft-identity62.8%
times-frac62.8%
metadata-eval62.8%
Applied egg-rr62.8%
Taylor expanded in h around inf 44.4%
sub-neg44.4%
distribute-rgt-in44.4%
lft-mult-inverse44.4%
distribute-lft-neg-in44.4%
metadata-eval44.4%
associate-/r*45.8%
associate-/l*46.5%
unpow246.5%
unpow246.5%
unpow246.5%
times-frac54.9%
swap-sqr65.9%
unpow265.9%
associate-*r/65.9%
Simplified65.9%
*-commutative65.9%
sqrt-div74.5%
sqrt-div87.7%
frac-times87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Final simplification83.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l))))))
(if (<= l -1.3e+172)
(* t_0 (/ (sqrt (- d)) (sqrt (- l))))
(if (<= l -2e-310)
(* (sqrt (/ d l)) (* t_0 t_1))
(* (/ d (* (sqrt l) (sqrt h))) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = 1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)));
double tmp;
if (l <= -1.3e+172) {
tmp = t_0 * (sqrt(-d) / sqrt(-l));
} else if (l <= -2e-310) {
tmp = sqrt((d / l)) * (t_0 * t_1);
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * t_1;
}
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 / h))
t_1 = 1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))
if (l <= (-1.3d+172)) then
tmp = t_0 * (sqrt(-d) / sqrt(-l))
else if (l <= (-2d-310)) then
tmp = sqrt((d / l)) * (t_0 * t_1)
else
tmp = (d / (sqrt(l) * sqrt(h))) * t_1
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 / h));
double t_1 = 1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)));
double tmp;
if (l <= -1.3e+172) {
tmp = t_0 * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (l <= -2e-310) {
tmp = Math.sqrt((d / l)) * (t_0 * t_1);
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = 1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l))) tmp = 0 if l <= -1.3e+172: tmp = t_0 * (math.sqrt(-d) / math.sqrt(-l)) elif l <= -2e-310: tmp = math.sqrt((d / l)) * (t_0 * t_1) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * t_1 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) tmp = 0.0 if (l <= -1.3e+172) tmp = Float64(t_0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (l <= -2e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(t_0 * t_1)); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * t_1); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = 1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l))); tmp = 0.0; if (l <= -1.3e+172) tmp = t_0 * (sqrt(-d) / sqrt(-l)); elseif (l <= -2e-310) tmp = sqrt((d / l)) * (t_0 * t_1); else tmp = (d / (sqrt(l) * sqrt(h))) * t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.3e+172], N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := 1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{+172}:\\
\;\;\;\;t\_0 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_0 \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot t\_1\\
\end{array}
\end{array}
if l < -1.3e172Initial program 39.3%
Simplified39.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt3.0%
mul-1-neg3.0%
Simplified3.0%
add-sqr-sqrt2.0%
sqrt-unprod40.6%
sqr-neg40.6%
add-sqr-sqrt40.6%
frac-2neg40.6%
sqrt-div57.9%
Applied egg-rr57.9%
if -1.3e172 < l < -1.999999999999994e-310Initial program 77.4%
Simplified77.3%
associate-*l/83.0%
*-commutative83.0%
associate-*r/83.0%
*-un-lft-identity83.0%
times-frac83.0%
associate-/l/83.0%
*-commutative83.0%
times-frac83.0%
*-un-lft-identity83.0%
*-commutative83.0%
associate-/l*80.8%
*-un-lft-identity80.8%
times-frac80.8%
metadata-eval80.8%
Applied egg-rr80.8%
associate-/l*79.7%
*-commutative79.7%
associate-/l*79.7%
*-commutative79.7%
metadata-eval79.7%
times-frac79.7%
*-rgt-identity79.7%
associate-/l*82.0%
*-commutative82.0%
associate-/l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in D around 0 51.8%
associate-/r*53.0%
associate-/l*49.6%
unpow249.6%
unpow249.6%
unpow249.6%
times-frac62.1%
swap-sqr82.0%
unpow282.0%
associate-*r/82.0%
Simplified82.0%
if -1.999999999999994e-310 < l Initial program 62.9%
Simplified61.7%
add-sqr-sqrt61.7%
pow261.7%
sqrt-prod61.6%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
frac-times64.1%
associate-/l*62.8%
*-un-lft-identity62.8%
times-frac62.8%
metadata-eval62.8%
Applied egg-rr62.8%
Taylor expanded in h around inf 44.4%
sub-neg44.4%
distribute-rgt-in44.4%
lft-mult-inverse44.4%
distribute-lft-neg-in44.4%
metadata-eval44.4%
associate-/r*45.8%
associate-/l*46.5%
unpow246.5%
unpow246.5%
unpow246.5%
times-frac54.9%
swap-sqr65.9%
unpow265.9%
associate-*r/65.9%
Simplified65.9%
*-commutative65.9%
sqrt-div74.5%
sqrt-div87.7%
frac-times87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Final simplification83.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l))))))
(if (<= l -2.9e+72)
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(if (<= l -2e-310)
(* t_0 (sqrt (* (/ d h) (/ d l))))
(* (/ d (* (sqrt l) (sqrt h))) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)));
double tmp;
if (l <= -2.9e+72) {
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
} else if (l <= -2e-310) {
tmp = t_0 * sqrt(((d / h) * (d / l)));
} else {
tmp = (d / (sqrt(l) * sqrt(h))) * 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 = 1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))
if (l <= (-2.9d+72)) then
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l))
else if (l <= (-2d-310)) then
tmp = t_0 * sqrt(((d / h) * (d / l)))
else
tmp = (d / (sqrt(l) * sqrt(h))) * 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 = 1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)));
double tmp;
if (l <= -2.9e+72) {
tmp = Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (l <= -2e-310) {
tmp = t_0 * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = (d / (Math.sqrt(l) * Math.sqrt(h))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l))) tmp = 0 if l <= -2.9e+72: tmp = math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l)) elif l <= -2e-310: tmp = t_0 * math.sqrt(((d / h) * (d / l))) else: tmp = (d / (math.sqrt(l) * math.sqrt(h))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) tmp = 0.0 if (l <= -2.9e+72) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (l <= -2e-310) tmp = Float64(t_0 * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(Float64(d / Float64(sqrt(l) * sqrt(h))) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l))); tmp = 0.0; if (l <= -2.9e+72) tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l)); elseif (l <= -2e-310) tmp = t_0 * sqrt(((d / h) * (d / l))); else tmp = (d / (sqrt(l) * sqrt(h))) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.9e+72], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(t$95$0 * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{+72}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot t\_0\\
\end{array}
\end{array}
if l < -2.90000000000000017e72Initial program 53.8%
Simplified51.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt2.9%
mul-1-neg2.9%
Simplified2.9%
add-sqr-sqrt1.3%
sqrt-unprod46.3%
sqr-neg46.3%
add-sqr-sqrt46.3%
frac-2neg46.3%
sqrt-div57.6%
Applied egg-rr57.6%
if -2.90000000000000017e72 < l < -1.999999999999994e-310Initial program 79.4%
Simplified78.0%
add-sqr-sqrt77.9%
pow277.9%
sqrt-prod78.0%
sqrt-pow178.0%
metadata-eval78.0%
pow178.0%
frac-times79.4%
associate-/l*78.0%
*-un-lft-identity78.0%
times-frac78.0%
metadata-eval78.0%
Applied egg-rr78.0%
Taylor expanded in h around inf 52.2%
sub-neg52.2%
distribute-rgt-in52.2%
lft-mult-inverse52.2%
distribute-lft-neg-in52.2%
metadata-eval52.2%
associate-/r*53.8%
associate-/l*52.3%
unpow252.3%
unpow252.3%
unpow252.3%
times-frac67.0%
swap-sqr85.4%
unpow285.4%
associate-*r/85.4%
Simplified85.4%
*-commutative85.4%
sqrt-unprod72.9%
Applied egg-rr72.9%
if -1.999999999999994e-310 < l Initial program 62.9%
Simplified61.7%
add-sqr-sqrt61.7%
pow261.7%
sqrt-prod61.6%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
frac-times64.1%
associate-/l*62.8%
*-un-lft-identity62.8%
times-frac62.8%
metadata-eval62.8%
Applied egg-rr62.8%
Taylor expanded in h around inf 44.4%
sub-neg44.4%
distribute-rgt-in44.4%
lft-mult-inverse44.4%
distribute-lft-neg-in44.4%
metadata-eval44.4%
associate-/r*45.8%
associate-/l*46.5%
unpow246.5%
unpow246.5%
unpow246.5%
times-frac54.9%
swap-sqr65.9%
unpow265.9%
associate-*r/65.9%
Simplified65.9%
*-commutative65.9%
sqrt-div74.5%
sqrt-div87.7%
frac-times87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Final simplification79.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -8.3e+67)
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(if (<= l 5.6e+28)
(*
(+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l))))
(sqrt (* (/ d h) (/ d l))))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.3e+67) {
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
} else if (l <= 5.6e+28) {
tmp = (1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)))) * sqrt(((d / h) * (d / l)));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-8.3d+67)) then
tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l))
else if (l <= 5.6d+28) then
tmp = (1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))) * sqrt(((d / h) * (d / l)))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -8.3e+67) {
tmp = Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l));
} else if (l <= 5.6e+28) {
tmp = (1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)))) * Math.sqrt(((d / h) * (d / l)));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -8.3e+67: tmp = math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l)) elif l <= 5.6e+28: tmp = (1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l)))) * math.sqrt(((d / h) * (d / l))) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -8.3e+67) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))); elseif (l <= 5.6e+28) tmp = Float64(Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -8.3e+67) tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l)); elseif (l <= 5.6e+28) tmp = (1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l)))) * sqrt(((d / h) * (d / l))); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -8.3e+67], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.6e+28], N[(N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.3 \cdot 10^{+67}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+28}:\\
\;\;\;\;\left(1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -8.299999999999999e67Initial program 53.8%
Simplified51.5%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt2.9%
mul-1-neg2.9%
Simplified2.9%
add-sqr-sqrt1.3%
sqrt-unprod46.3%
sqr-neg46.3%
add-sqr-sqrt46.3%
frac-2neg46.3%
sqrt-div57.6%
Applied egg-rr57.6%
if -8.299999999999999e67 < l < 5.6000000000000003e28Initial program 77.3%
Simplified75.9%
add-sqr-sqrt75.9%
pow275.9%
sqrt-prod75.9%
sqrt-pow176.6%
metadata-eval76.6%
pow176.6%
frac-times77.9%
associate-/l*76.6%
*-un-lft-identity76.6%
times-frac76.6%
metadata-eval76.6%
Applied egg-rr76.6%
Taylor expanded in h around inf 52.2%
sub-neg52.2%
distribute-rgt-in52.2%
lft-mult-inverse52.2%
distribute-lft-neg-in52.2%
metadata-eval52.2%
associate-/r*54.4%
associate-/l*53.7%
unpow253.7%
unpow253.7%
unpow253.7%
times-frac67.5%
swap-sqr82.2%
unpow282.2%
associate-*r/82.3%
Simplified82.3%
*-commutative82.3%
sqrt-unprod69.9%
Applied egg-rr69.9%
if 5.6000000000000003e28 < l Initial program 49.0%
Simplified47.7%
add-sqr-sqrt47.7%
pow247.7%
sqrt-prod47.7%
sqrt-pow148.8%
metadata-eval48.8%
pow148.8%
frac-times50.2%
associate-/l*48.8%
*-un-lft-identity48.8%
times-frac48.8%
metadata-eval48.8%
Applied egg-rr48.8%
Taylor expanded in d around inf 58.2%
associate-/r*59.2%
associate-/r*58.2%
unpow-158.2%
metadata-eval58.2%
pow-sqr58.2%
rem-sqrt-square58.2%
rem-square-sqrt57.9%
fabs-sqr57.9%
rem-square-sqrt58.2%
Simplified58.2%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt6.5%
neg-mul-16.5%
*-commutative6.5%
unpow-16.5%
metadata-eval6.5%
pow-sqr6.5%
rem-sqrt-square6.5%
+-rgt-identity6.5%
metadata-eval6.5%
associate-+l+12.0%
fma-undefine12.0%
+-commutative12.0%
rem-square-sqrt12.0%
fabs-sqr12.0%
rem-square-sqrt12.0%
Simplified6.5%
add-sqr-sqrt3.5%
sqrt-unprod58.2%
add-sqr-sqrt58.0%
sqrt-unprod58.2%
pow-prod-up58.2%
metadata-eval58.2%
inv-pow58.2%
associate-/l/58.1%
add-cbrt-cube34.7%
unpow334.7%
add-sqr-sqrt34.7%
sqrt-unprod34.7%
pow-prod-up34.7%
metadata-eval34.7%
inv-pow34.7%
associate-/l/34.7%
add-cbrt-cube34.7%
unpow334.7%
Applied egg-rr66.3%
Final simplification66.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(+ 1.0 (* h (* -0.125 (/ (pow (/ (* M D) d) 2.0) l))))
(sqrt (* (/ d h) (/ d l))))))
(if (<= d 2e-285)
t_0
(if (<= d 2.55e-133)
(* d (/ (* h (* -0.125 (/ (pow (/ (/ d M) D) -2.0) l))) (sqrt (* l h))))
(if (<= d 1.7e+90) t_0 (* d (/ (pow h -0.5) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (1.0 + (h * (-0.125 * (pow(((M * D) / d), 2.0) / l)))) * sqrt(((d / h) * (d / l)));
double tmp;
if (d <= 2e-285) {
tmp = t_0;
} else if (d <= 2.55e-133) {
tmp = d * ((h * (-0.125 * (pow(((d / M) / D), -2.0) / l))) / sqrt((l * h)));
} else if (d <= 1.7e+90) {
tmp = t_0;
} else {
tmp = d * (pow(h, -0.5) / 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) :: tmp
t_0 = (1.0d0 + (h * ((-0.125d0) * ((((m * d_1) / d) ** 2.0d0) / l)))) * sqrt(((d / h) * (d / l)))
if (d <= 2d-285) then
tmp = t_0
else if (d <= 2.55d-133) then
tmp = d * ((h * ((-0.125d0) * ((((d / m) / d_1) ** (-2.0d0)) / l))) / sqrt((l * h)))
else if (d <= 1.7d+90) then
tmp = t_0
else
tmp = d * ((h ** (-0.5d0)) / 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 = (1.0 + (h * (-0.125 * (Math.pow(((M * D) / d), 2.0) / l)))) * Math.sqrt(((d / h) * (d / l)));
double tmp;
if (d <= 2e-285) {
tmp = t_0;
} else if (d <= 2.55e-133) {
tmp = d * ((h * (-0.125 * (Math.pow(((d / M) / D), -2.0) / l))) / Math.sqrt((l * h)));
} else if (d <= 1.7e+90) {
tmp = t_0;
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (1.0 + (h * (-0.125 * (math.pow(((M * D) / d), 2.0) / l)))) * math.sqrt(((d / h) * (d / l))) tmp = 0 if d <= 2e-285: tmp = t_0 elif d <= 2.55e-133: tmp = d * ((h * (-0.125 * (math.pow(((d / M) / D), -2.0) / l))) / math.sqrt((l * h))) elif d <= 1.7e+90: tmp = t_0 else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(1.0 + Float64(h * Float64(-0.125 * Float64((Float64(Float64(M * D) / d) ^ 2.0) / l)))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))) tmp = 0.0 if (d <= 2e-285) tmp = t_0; elseif (d <= 2.55e-133) tmp = Float64(d * Float64(Float64(h * Float64(-0.125 * Float64((Float64(Float64(d / M) / D) ^ -2.0) / l))) / sqrt(Float64(l * h)))); elseif (d <= 1.7e+90) tmp = t_0; else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (1.0 + (h * (-0.125 * ((((M * D) / d) ^ 2.0) / l)))) * sqrt(((d / h) * (d / l))); tmp = 0.0; if (d <= 2e-285) tmp = t_0; elseif (d <= 2.55e-133) tmp = d * ((h * (-0.125 * ((((d / M) / D) ^ -2.0) / l))) / sqrt((l * h))); elseif (d <= 1.7e+90) tmp = t_0; else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(h * N[(-0.125 * N[(N[Power[N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 2e-285], t$95$0, If[LessEqual[d, 2.55e-133], N[(d * N[(N[(h * N[(-0.125 * N[(N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e+90], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + h \cdot \left(-0.125 \cdot \frac{{\left(\frac{M \cdot D}{d}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{if}\;d \leq 2 \cdot 10^{-285}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 2.55 \cdot 10^{-133}:\\
\;\;\;\;d \cdot \frac{h \cdot \left(-0.125 \cdot \frac{{\left(\frac{\frac{d}{M}}{D}\right)}^{-2}}{\ell}\right)}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{+90}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 2.00000000000000015e-285 or 2.54999999999999995e-133 < d < 1.70000000000000009e90Initial program 75.5%
Simplified73.7%
add-sqr-sqrt73.7%
pow273.7%
sqrt-prod73.7%
sqrt-pow174.7%
metadata-eval74.7%
pow174.7%
frac-times76.5%
associate-/l*74.7%
*-un-lft-identity74.7%
times-frac74.7%
metadata-eval74.7%
Applied egg-rr74.7%
Taylor expanded in h around inf 53.9%
sub-neg53.9%
distribute-rgt-in53.9%
lft-mult-inverse53.9%
distribute-lft-neg-in53.9%
metadata-eval53.9%
associate-/r*55.2%
associate-/l*53.4%
unpow253.4%
unpow253.4%
unpow253.4%
times-frac61.8%
swap-sqr79.1%
unpow279.1%
associate-*r/79.1%
Simplified79.1%
*-commutative79.1%
sqrt-unprod66.0%
Applied egg-rr66.0%
if 2.00000000000000015e-285 < d < 2.54999999999999995e-133Initial program 36.9%
Simplified34.3%
Taylor expanded in M around inf 21.9%
associate-*r/21.9%
associate-*r*22.0%
associate-*r*22.0%
associate-*l/22.1%
associate-*r/22.1%
*-commutative22.1%
associate-*l*22.1%
Simplified32.8%
pow132.8%
associate-*r*32.9%
sqrt-unprod17.1%
associate-*l/19.5%
*-commutative19.5%
Applied egg-rr19.5%
unpow119.5%
associate-*r/16.9%
associate-*l/11.7%
unpow211.7%
associate-/l*8.9%
associate-*r/8.9%
associate-/l*8.9%
Simplified8.9%
pow18.9%
associate-/l/8.9%
*-commutative8.9%
sqrt-div14.4%
sqrt-pow145.8%
metadata-eval45.8%
pow145.8%
*-commutative45.8%
*-commutative45.8%
associate-*r/45.8%
associate-*r/45.9%
Applied egg-rr45.9%
unpow145.9%
*-commutative45.9%
associate-*r/56.3%
associate-*l/53.9%
associate-*l/61.7%
associate-/l*61.7%
Simplified61.7%
if 1.70000000000000009e90 < d Initial program 55.6%
Simplified55.7%
add-sqr-sqrt55.7%
pow255.7%
sqrt-prod55.7%
sqrt-pow157.7%
metadata-eval57.7%
pow157.7%
frac-times57.5%
associate-/l*57.7%
*-un-lft-identity57.7%
times-frac57.7%
metadata-eval57.7%
Applied egg-rr57.7%
Taylor expanded in d around inf 74.8%
associate-/r*75.3%
associate-/r*74.8%
unpow-174.8%
metadata-eval74.8%
pow-sqr74.8%
rem-sqrt-square74.8%
rem-square-sqrt74.4%
fabs-sqr74.4%
rem-square-sqrt74.8%
Simplified74.8%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt5.4%
neg-mul-15.4%
*-commutative5.4%
unpow-15.4%
metadata-eval5.4%
pow-sqr5.4%
rem-sqrt-square5.4%
+-rgt-identity5.4%
metadata-eval5.4%
associate-+l+12.5%
fma-undefine12.5%
+-commutative12.5%
rem-square-sqrt12.5%
fabs-sqr12.5%
rem-square-sqrt12.5%
Simplified5.4%
add-sqr-sqrt0.2%
sqrt-unprod74.8%
add-sqr-sqrt74.6%
sqrt-unprod74.8%
pow-prod-up74.8%
metadata-eval74.8%
inv-pow74.8%
associate-/l/74.7%
add-cbrt-cube34.5%
unpow334.4%
add-sqr-sqrt34.4%
sqrt-unprod34.4%
pow-prod-up34.4%
metadata-eval34.4%
inv-pow34.4%
associate-/l/34.4%
add-cbrt-cube34.4%
unpow334.4%
Applied egg-rr80.3%
Final simplification68.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d 2.7e-282)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 5.2e-29)
(* d (/ (* h (* -0.125 (/ (pow (/ (/ d M) D) -2.0) l))) (sqrt (* l h))))
(* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.7e-282) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 5.2e-29) {
tmp = d * ((h * (-0.125 * (pow(((d / M) / D), -2.0) / l))) / sqrt((l * h)));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 2.7d-282) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (d <= 5.2d-29) then
tmp = d * ((h * ((-0.125d0) * ((((d / m) / d_1) ** (-2.0d0)) / l))) / sqrt((l * h)))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 2.7e-282) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 5.2e-29) {
tmp = d * ((h * (-0.125 * (Math.pow(((d / M) / D), -2.0) / l))) / Math.sqrt((l * h)));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 2.7e-282: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif d <= 5.2e-29: tmp = d * ((h * (-0.125 * (math.pow(((d / M) / D), -2.0) / l))) / math.sqrt((l * h))) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 2.7e-282) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 5.2e-29) tmp = Float64(d * Float64(Float64(h * Float64(-0.125 * Float64((Float64(Float64(d / M) / D) ^ -2.0) / l))) / sqrt(Float64(l * h)))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 2.7e-282) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (d <= 5.2e-29) tmp = d * ((h * (-0.125 * ((((d / M) / D) ^ -2.0) / l))) / sqrt((l * h))); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 2.7e-282], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.2e-29], N[(d * N[(N[(h * N[(-0.125 * N[(N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 2.7 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 5.2 \cdot 10^{-29}:\\
\;\;\;\;d \cdot \frac{h \cdot \left(-0.125 \cdot \frac{{\left(\frac{\frac{d}{M}}{D}\right)}^{-2}}{\ell}\right)}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 2.69999999999999982e-282Initial program 69.0%
Simplified66.4%
Taylor expanded in d around inf 44.5%
if 2.69999999999999982e-282 < d < 5.2000000000000004e-29Initial program 56.1%
Simplified54.5%
Taylor expanded in M around inf 33.4%
associate-*r/33.4%
associate-*r*33.4%
associate-*r*33.4%
associate-*l/33.5%
associate-*r/33.5%
*-commutative33.5%
associate-*l*33.5%
Simplified43.9%
pow143.9%
associate-*r*43.9%
sqrt-unprod33.6%
associate-*l/35.2%
*-commutative35.2%
Applied egg-rr35.2%
unpow135.2%
associate-*r/31.8%
associate-*l/28.5%
unpow228.5%
associate-/l*26.6%
associate-*r/26.6%
associate-/l*26.6%
Simplified26.6%
pow126.6%
associate-/l/28.3%
*-commutative28.3%
sqrt-div31.7%
sqrt-pow152.0%
metadata-eval52.0%
pow152.0%
*-commutative52.0%
*-commutative52.0%
associate-*r/52.0%
associate-*r/52.0%
Applied egg-rr52.0%
unpow152.0%
*-commutative52.0%
associate-*r/58.8%
associate-*l/57.3%
associate-*l/62.3%
associate-/l*60.8%
Simplified60.9%
if 5.2000000000000004e-29 < d Initial program 68.0%
Simplified68.1%
add-sqr-sqrt68.1%
pow268.1%
sqrt-prod68.1%
sqrt-pow170.2%
metadata-eval70.2%
pow170.2%
frac-times70.1%
associate-/l*70.2%
*-un-lft-identity70.2%
times-frac70.2%
metadata-eval70.2%
Applied egg-rr70.2%
Taylor expanded in d around inf 62.0%
associate-/r*62.9%
associate-/r*62.0%
unpow-162.0%
metadata-eval62.0%
pow-sqr62.0%
rem-sqrt-square62.0%
rem-square-sqrt61.6%
fabs-sqr61.6%
rem-square-sqrt62.0%
Simplified62.0%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt6.7%
neg-mul-16.7%
*-commutative6.7%
unpow-16.7%
metadata-eval6.7%
pow-sqr6.7%
rem-sqrt-square6.7%
+-rgt-identity6.7%
metadata-eval6.7%
associate-+l+19.4%
fma-undefine19.4%
+-commutative19.4%
rem-square-sqrt19.4%
fabs-sqr19.4%
rem-square-sqrt19.4%
Simplified6.7%
add-sqr-sqrt0.2%
sqrt-unprod62.0%
add-sqr-sqrt61.8%
sqrt-unprod62.0%
pow-prod-up62.0%
metadata-eval62.0%
inv-pow62.0%
associate-/l/61.9%
add-cbrt-cube29.4%
unpow329.4%
add-sqr-sqrt29.4%
sqrt-unprod29.4%
pow-prod-up29.4%
metadata-eval29.4%
inv-pow29.4%
associate-/l/29.4%
add-cbrt-cube29.4%
unpow329.4%
Applied egg-rr70.0%
(FPCore (d h l M D) :precision binary64 (if (<= d 4.9e-265) (* (sqrt (/ d h)) (sqrt (/ d l))) (* d (/ (pow h -0.5) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 4.9e-265) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 4.9d-265) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 4.9e-265) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 4.9e-265: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 4.9e-265) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 4.9e-265) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 4.9e-265], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.9 \cdot 10^{-265}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < 4.89999999999999999e-265Initial program 68.1%
Simplified65.6%
Taylor expanded in d around inf 43.4%
if 4.89999999999999999e-265 < d Initial program 63.7%
Simplified63.0%
add-sqr-sqrt63.0%
pow263.0%
sqrt-prod63.0%
sqrt-pow164.3%
metadata-eval64.3%
pow164.3%
frac-times64.9%
associate-/l*64.3%
*-un-lft-identity64.3%
times-frac64.3%
metadata-eval64.3%
Applied egg-rr64.3%
Taylor expanded in d around inf 47.4%
associate-/r*47.9%
associate-/r*47.4%
unpow-147.4%
metadata-eval47.4%
pow-sqr47.4%
rem-sqrt-square47.4%
rem-square-sqrt47.2%
fabs-sqr47.2%
rem-square-sqrt47.4%
Simplified47.4%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt9.4%
neg-mul-19.4%
*-commutative9.4%
unpow-19.4%
metadata-eval9.4%
pow-sqr9.4%
rem-sqrt-square9.4%
+-rgt-identity9.4%
metadata-eval9.4%
associate-+l+24.7%
fma-undefine24.7%
+-commutative24.7%
rem-square-sqrt24.7%
fabs-sqr24.7%
rem-square-sqrt24.7%
Simplified9.4%
add-sqr-sqrt1.8%
sqrt-unprod47.4%
add-sqr-sqrt47.3%
sqrt-unprod47.4%
pow-prod-up47.4%
metadata-eval47.4%
inv-pow47.4%
associate-/l/47.4%
add-cbrt-cube24.6%
unpow324.6%
add-sqr-sqrt24.6%
sqrt-unprod24.6%
pow-prod-up24.6%
metadata-eval24.6%
inv-pow24.6%
associate-/l/24.6%
add-cbrt-cube24.6%
unpow324.6%
Applied egg-rr53.5%
(FPCore (d h l M D) :precision binary64 (if (<= l 6e-218) (* (- d) (pow (* l h) -0.5)) (* d (/ (pow h -0.5) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6e-218) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 6d-218) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6e-218) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 6e-218: tmp = -d * math.pow((l * h), -0.5) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6e-218) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 6e-218) tmp = -d * ((l * h) ^ -0.5); else tmp = d * ((h ^ -0.5) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6e-218], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6 \cdot 10^{-218}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 5.9999999999999997e-218Initial program 68.0%
Simplified66.5%
Taylor expanded in d around inf 9.7%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt41.2%
neg-mul-141.2%
unpow-141.2%
metadata-eval41.2%
pow-sqr41.2%
rem-sqrt-square41.4%
rem-square-sqrt41.3%
fabs-sqr41.3%
rem-square-sqrt41.4%
Simplified41.4%
if 5.9999999999999997e-218 < l Initial program 63.3%
Simplified61.8%
add-sqr-sqrt61.8%
pow261.8%
sqrt-prod61.7%
sqrt-pow163.2%
metadata-eval63.2%
pow163.2%
frac-times64.7%
associate-/l*63.2%
*-un-lft-identity63.2%
times-frac63.2%
metadata-eval63.2%
Applied egg-rr63.2%
Taylor expanded in d around inf 50.8%
associate-/r*51.3%
associate-/r*50.8%
unpow-150.8%
metadata-eval50.8%
pow-sqr50.8%
rem-sqrt-square50.8%
rem-square-sqrt50.5%
fabs-sqr50.5%
rem-square-sqrt50.8%
Simplified50.8%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt5.5%
neg-mul-15.5%
*-commutative5.5%
unpow-15.5%
metadata-eval5.5%
pow-sqr5.5%
rem-sqrt-square5.5%
+-rgt-identity5.5%
metadata-eval5.5%
associate-+l+18.0%
fma-undefine18.0%
+-commutative18.0%
rem-square-sqrt18.0%
fabs-sqr18.0%
rem-square-sqrt18.0%
Simplified5.5%
add-sqr-sqrt2.0%
sqrt-unprod50.8%
add-sqr-sqrt50.7%
sqrt-unprod50.8%
pow-prod-up50.8%
metadata-eval50.8%
inv-pow50.8%
associate-/l/50.7%
add-cbrt-cube27.5%
unpow327.5%
add-sqr-sqrt27.5%
sqrt-unprod27.5%
pow-prod-up27.5%
metadata-eval27.5%
inv-pow27.5%
associate-/l/27.4%
add-cbrt-cube27.5%
unpow327.5%
Applied egg-rr56.9%
Final simplification48.8%
(FPCore (d h l M D) :precision binary64 (if (<= l 4e-177) (* (- d) (pow (* l h) -0.5)) (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4e-177) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 4d-177) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4e-177) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 4e-177: tmp = -d * math.pow((l * h), -0.5) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4e-177) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 4e-177) tmp = -d * ((l * h) ^ -0.5); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4e-177], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < 3.99999999999999981e-177Initial program 68.2%
Simplified66.8%
Taylor expanded in d around inf 10.0%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.0%
neg-mul-140.0%
unpow-140.0%
metadata-eval40.0%
pow-sqr40.0%
rem-sqrt-square40.2%
rem-square-sqrt40.1%
fabs-sqr40.1%
rem-square-sqrt40.2%
Simplified40.2%
if 3.99999999999999981e-177 < l Initial program 62.7%
Simplified61.2%
Taylor expanded in d around inf 52.9%
add-cbrt-cube29.1%
pow329.1%
associate-/r*29.0%
Applied egg-rr29.0%
Taylor expanded in h around 0 52.9%
associate-/l/53.6%
Simplified53.6%
Final simplification46.3%
(FPCore (d h l M D) :precision binary64 (if (<= l 4.6e-177) (* (- d) (pow (* l h) -0.5)) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-177) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 4.6d-177) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 4.6e-177) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 4.6e-177: tmp = -d * math.pow((l * h), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 4.6e-177) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 4.6e-177) tmp = -d * ((l * h) ^ -0.5); else tmp = d * sqrt(((1.0 / h) / l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 4.6e-177], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.6 \cdot 10^{-177}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < 4.60000000000000044e-177Initial program 68.2%
Simplified66.8%
Taylor expanded in d around inf 10.0%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.0%
neg-mul-140.0%
unpow-140.0%
metadata-eval40.0%
pow-sqr40.0%
rem-sqrt-square40.2%
rem-square-sqrt40.1%
fabs-sqr40.1%
rem-square-sqrt40.2%
Simplified40.2%
if 4.60000000000000044e-177 < l Initial program 62.7%
Simplified61.1%
add-sqr-sqrt61.1%
pow261.1%
sqrt-prod61.1%
sqrt-pow161.7%
metadata-eval61.7%
pow161.7%
frac-times63.4%
associate-/l*61.7%
*-un-lft-identity61.7%
times-frac61.7%
metadata-eval61.7%
Applied egg-rr61.7%
Taylor expanded in d around inf 52.9%
associate-/r*53.5%
Simplified53.5%
Final simplification46.3%
(FPCore (d h l M D) :precision binary64 (if (<= l 5.8e-176) (* (- d) (pow (* l h) -0.5)) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.8e-176) {
tmp = -d * pow((l * h), -0.5);
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 5.8d-176) then
tmp = -d * ((l * h) ** (-0.5d0))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.8e-176) {
tmp = -d * Math.pow((l * h), -0.5);
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 5.8e-176: tmp = -d * math.pow((l * h), -0.5) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5.8e-176) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 5.8e-176) tmp = -d * ((l * h) ^ -0.5); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5.8e-176], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{-176}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < 5.80000000000000012e-176Initial program 68.2%
Simplified66.8%
Taylor expanded in d around inf 10.0%
Taylor expanded in h around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.0%
neg-mul-140.0%
unpow-140.0%
metadata-eval40.0%
pow-sqr40.0%
rem-sqrt-square40.2%
rem-square-sqrt40.1%
fabs-sqr40.1%
rem-square-sqrt40.2%
Simplified40.2%
if 5.80000000000000012e-176 < l Initial program 62.7%
Simplified61.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt7.2%
mul-1-neg7.2%
Simplified7.2%
sqrt-div5.7%
add-sqr-sqrt3.0%
sqrt-unprod52.5%
sqr-neg52.5%
add-sqr-sqrt52.5%
sqrt-div58.2%
frac-times58.3%
add-sqr-sqrt58.5%
sqrt-prod53.0%
*-commutative53.0%
Applied egg-rr53.0%
Final simplification46.0%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (* l h)))) (if (<= l 3.8e-177) (/ (- d) t_0) (/ d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (l <= 3.8e-177) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (l <= 3.8d-177) then
tmp = -d / t_0
else
tmp = d / t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (l <= 3.8e-177) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if l <= 3.8e-177: tmp = -d / t_0 else: tmp = d / t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (l <= 3.8e-177) tmp = Float64(Float64(-d) / t_0); else tmp = Float64(d / t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (l <= 3.8e-177) tmp = -d / t_0; else tmp = d / t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.8e-177], N[((-d) / t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq 3.8 \cdot 10^{-177}:\\
\;\;\;\;\frac{-d}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\
\end{array}
\end{array}
if l < 3.80000000000000004e-177Initial program 68.2%
Simplified66.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt9.6%
mul-1-neg9.6%
Simplified9.6%
distribute-rgt-neg-out9.6%
sqrt-div4.1%
sqrt-div2.1%
frac-times2.1%
add-sqr-sqrt2.1%
sqrt-prod40.2%
*-commutative40.2%
Applied egg-rr40.2%
distribute-neg-frac240.2%
*-commutative40.2%
Simplified40.2%
if 3.80000000000000004e-177 < l Initial program 62.7%
Simplified61.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt7.2%
mul-1-neg7.2%
Simplified7.2%
sqrt-div5.7%
add-sqr-sqrt3.0%
sqrt-unprod52.5%
sqr-neg52.5%
add-sqr-sqrt52.5%
sqrt-div58.2%
frac-times58.3%
add-sqr-sqrt58.5%
sqrt-prod53.0%
*-commutative53.0%
Applied egg-rr53.0%
Final simplification46.0%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 65.7%
Simplified64.2%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt8.5%
mul-1-neg8.5%
Simplified8.5%
sqrt-div4.8%
add-sqr-sqrt1.4%
sqrt-unprod25.5%
sqr-neg25.5%
add-sqr-sqrt25.5%
sqrt-div29.1%
frac-times29.2%
add-sqr-sqrt29.3%
sqrt-prod29.5%
*-commutative29.5%
Applied egg-rr29.5%
herbie shell --seed 2024156
(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)))))