
(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 18 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 (+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5))))
(t_1 (sqrt (- d))))
(if (<= l -2e-311)
(* (/ t_1 (sqrt (- l))) (* (/ t_1 (sqrt (- h))) t_0))
(* (/ (sqrt d) (sqrt l)) (* t_0 (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5));
double t_1 = sqrt(-d);
double tmp;
if (l <= -2e-311) {
tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0);
} else {
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))
t_1 = sqrt(-d)
if (l <= (-2d-311)) then
tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0)
else
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / sqrt(h)))
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 / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5));
double t_1 = Math.sqrt(-d);
double tmp;
if (l <= -2e-311) {
tmp = (t_1 / Math.sqrt(-l)) * ((t_1 / Math.sqrt(-h)) * t_0);
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)) t_1 = math.sqrt(-d) tmp = 0 if l <= -2e-311: tmp = (t_1 / math.sqrt(-l)) * ((t_1 / math.sqrt(-h)) * t_0) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (t_0 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(t_1 / sqrt(Float64(-l))) * Float64(Float64(t_1 / sqrt(Float64(-h))) * t_0)); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)); t_1 = sqrt(-d); tmp = 0.0; if (l <= -2e-311) tmp = (t_1 / sqrt(-l)) * ((t_1 / sqrt(-h)) * t_0); else tmp = (sqrt(d) / sqrt(l)) * (t_0 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -2e-311], N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{t\_1}{\sqrt{-\ell}} \cdot \left(\frac{t\_1}{\sqrt{-h}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div76.6%
Applied egg-rr76.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr82.9%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
sqrt-div80.2%
Applied egg-rr80.2%
Final simplification81.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= t_0 -2e-128)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(sqrt (* (/ d h) (/ d l))))
(if (<= t_0 2e+274)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* (- d) (pow (* l h) -0.5))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -2e-128) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * sqrt(((d / h) * (d / l)));
} else if (t_0 <= 2e+274) {
tmp = sqrt((d / h)) * sqrt((d / l));
} 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) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
if (t_0 <= (-2d-128)) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * sqrt(((d / h) * (d / l)))
else if (t_0 <= 2d+274) then
tmp = sqrt((d / h)) * sqrt((d / l))
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 t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -2e-128) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * Math.sqrt(((d / h) * (d / l)));
} else if (t_0 <= 2e+274) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = -d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))) tmp = 0 if t_0 <= -2e-128: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * math.sqrt(((d / h) * (d / l))) elif t_0 <= 2e+274: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = -d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= -2e-128) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / h) * Float64(d / l)))); elseif (t_0 <= 2e+274) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); tmp = 0.0; if (t_0 <= -2e-128) tmp = (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * sqrt(((d / h) * (d / l))); elseif (t_0 <= 2e+274) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = -d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-128], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+274], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-128}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.00000000000000011e-128Initial program 85.6%
Simplified87.8%
associate-*r/88.7%
*-commutative88.7%
div-inv88.7%
metadata-eval88.7%
Applied egg-rr88.7%
pow188.7%
sqrt-unprod77.4%
Applied egg-rr77.4%
unpow177.4%
Simplified77.4%
if -2.00000000000000011e-128 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 92.1%
Simplified91.0%
Taylor expanded in d around inf 91.1%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification67.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= t_0 -2e-128)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* (pow (* D (/ M (* d 2.0))) 2.0) (/ (* h -0.5) l))))
(if (<= t_0 2e+274)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* (- d) (pow (* l h) -0.5))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -2e-128) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / l)));
} else if (t_0 <= 2e+274) {
tmp = sqrt((d / h)) * sqrt((d / l));
} 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) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))
if (t_0 <= (-2d-128)) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + (((d_1 * (m / (d * 2.0d0))) ** 2.0d0) * ((h * (-0.5d0)) / l)))
else if (t_0 <= 2d+274) then
tmp = sqrt((d / h)) * sqrt((d / l))
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 t_0 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= -2e-128) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (Math.pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / l)));
} else if (t_0 <= 2e+274) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = -d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0)))) tmp = 0 if t_0 <= -2e-128: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (math.pow((D * (M / (d * 2.0))), 2.0) * ((h * -0.5) / l))) elif t_0 <= 2e+274: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = -d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= -2e-128) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64((Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0) * Float64(Float64(h * -0.5) / l)))); elseif (t_0 <= 2e+274) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0)))); tmp = 0.0; if (t_0 <= -2e-128) tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((D * (M / (d * 2.0))) ^ 2.0) * ((h * -0.5) / l))); elseif (t_0 <= 2e+274) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = -d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+274], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h \cdot -0.5}{\ell}\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.00000000000000011e-128Initial program 85.6%
Simplified87.8%
pow187.8%
associate-*r*87.8%
sqrt-unprod76.5%
associate-*r*76.5%
Applied egg-rr76.5%
unpow176.5%
*-commutative76.5%
*-commutative76.5%
associate-*r/77.4%
Simplified77.4%
fma-undefine77.4%
metadata-eval77.4%
div-inv77.4%
associate-*l/76.5%
associate-*r/77.5%
associate-/l/77.5%
*-commutative77.5%
Applied egg-rr77.5%
if -2.00000000000000011e-128 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 92.1%
Simplified91.0%
Taylor expanded in d around inf 91.1%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification67.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= t_0 0.0)
(* (- d) (pow (+ -1.0 (fma h l 1.0)) -0.5))
(if (<= t_0 2e+274)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* (- d) (pow (* l h) -0.5))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= 0.0) {
tmp = -d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else if (t_0 <= 2e+274) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = -d * pow((l * h), -0.5);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(-d) * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); elseif (t_0 <= 2e+274) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[((-d) * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+274], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left(-d\right) \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0Initial program 80.9%
metadata-eval80.9%
associate-*l*80.9%
frac-times82.8%
add-sqr-sqrt82.7%
pow282.7%
Applied egg-rr88.3%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt16.1%
neg-mul-116.1%
unpow-116.1%
metadata-eval16.1%
pow-sqr16.1%
rem-sqrt-square15.1%
rem-square-sqrt15.1%
fabs-sqr15.1%
rem-square-sqrt15.1%
Simplified15.1%
expm1-log1p-u15.0%
expm1-undefine29.1%
Applied egg-rr29.1%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
log1p-undefine29.1%
rem-exp-log29.2%
+-commutative29.2%
fma-define29.2%
Simplified29.2%
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 99.1%
Simplified97.9%
Taylor expanded in d around inf 98.0%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification50.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))))
(if (<= t_0 0.0)
(* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
(if (<= t_0 2e+274)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* (- d) (pow (* l h) -0.5))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
double tmp;
if (t_0 <= 0.0) {
tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
} else if (t_0 <= 2e+274) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = -d * pow((l * h), -0.5);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5)); elseif (t_0 <= 2e+274) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+274], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0Initial program 80.9%
metadata-eval80.9%
associate-*l*80.9%
frac-times82.8%
add-sqr-sqrt82.7%
pow282.7%
Applied egg-rr88.3%
Taylor expanded in d around inf 18.1%
unpow-118.1%
metadata-eval18.1%
pow-sqr18.1%
rem-sqrt-square17.2%
rem-square-sqrt17.1%
fabs-sqr17.1%
rem-square-sqrt17.2%
Simplified17.2%
expm1-log1p-u15.0%
expm1-undefine29.1%
Applied egg-rr28.2%
sub-neg29.1%
metadata-eval29.1%
+-commutative29.1%
log1p-undefine29.1%
rem-exp-log29.2%
+-commutative29.2%
fma-define29.2%
Simplified28.3%
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 99.1%
Simplified97.9%
Taylor expanded in d around inf 98.0%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification50.1%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
2e+274)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0))))
(* (- d) (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 2.0)));
} 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 (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+274) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m * 0.5d0)) * sqrt((h / l))) ** 2.0d0)))
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 (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * Math.pow((((D / d) * (M * 0.5)) * Math.sqrt((h / l))), 2.0)));
} else {
tmp = -d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * math.pow((((D / d) * (M * 0.5)) * math.sqrt((h / l))), 2.0))) else: tmp = -d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * 0.5)) * sqrt(Float64(h / l))) ^ 2.0)))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((((D / d) * (M * 0.5)) * sqrt((h / l))) ^ 2.0))); else tmp = -d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+274], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 88.9%
Simplified89.4%
add-sqr-sqrt89.4%
pow289.4%
sqrt-prod89.4%
sqrt-pow192.5%
metadata-eval92.5%
pow192.5%
*-commutative92.5%
div-inv92.5%
metadata-eval92.5%
Applied egg-rr92.5%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification73.5%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
2e+274)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(sqrt (/ d h))))
(* (- d) (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * 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 (((((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)) * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+274) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * 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 (((Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * 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 ((math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * 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 (Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * sqrt((d / h))); else tmp = -d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+274], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(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] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 88.9%
Simplified90.0%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification71.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (* M (/ 0.5 d))))
(t_1 (* (pow (/ d h) 0.5) (pow (/ d l) 0.5))))
(if (<=
(* t_1 (- 1.0 (* (/ h l) (* 0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
2e+274)
(* t_1 (- 1.0 (* (/ h l) (* 0.5 (* t_0 t_0)))))
(* (- d) (pow (* l h) -0.5)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M * (0.5 / d));
double t_1 = pow((d / h), 0.5) * pow((d / l), 0.5);
double tmp;
if ((t_1 * (1.0 - ((h / l) * (0.5 * pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = t_1 * (1.0 - ((h / l) * (0.5 * (t_0 * t_0))));
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d_1 * (m * (0.5d0 / d))
t_1 = ((d / h) ** 0.5d0) * ((d / l) ** 0.5d0)
if ((t_1 * (1.0d0 - ((h / l) * (0.5d0 * (((d_1 * m) / (d * 2.0d0)) ** 2.0d0))))) <= 2d+274) then
tmp = t_1 * (1.0d0 - ((h / l) * (0.5d0 * (t_0 * t_0))))
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 t_0 = D * (M * (0.5 / d));
double t_1 = Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5);
double tmp;
if ((t_1 * (1.0 - ((h / l) * (0.5 * Math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274) {
tmp = t_1 * (1.0 - ((h / l) * (0.5 * (t_0 * t_0))));
} else {
tmp = -d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = D * (M * (0.5 / d)) t_1 = math.pow((d / h), 0.5) * math.pow((d / l), 0.5) tmp = 0 if (t_1 * (1.0 - ((h / l) * (0.5 * math.pow(((D * M) / (d * 2.0)), 2.0))))) <= 2e+274: tmp = t_1 * (1.0 - ((h / l) * (0.5 * (t_0 * t_0)))) else: tmp = -d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) t_0 = Float64(D * Float64(M * Float64(0.5 / d))) t_1 = Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) tmp = 0.0 if (Float64(t_1 * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = Float64(t_1 * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * Float64(t_0 * t_0))))); else tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = D * (M * (0.5 / d)); t_1 = ((d / h) ^ 0.5) * ((d / l) ^ 0.5); tmp = 0.0; if ((t_1 * (1.0 - ((h / l) * (0.5 * (((D * M) / (d * 2.0)) ^ 2.0))))) <= 2e+274) tmp = t_1 * (1.0 - ((h / l) * (0.5 * (t_0 * t_0)))); else tmp = -d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+274], N[(t$95$1 * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := D \cdot \left(M \cdot \frac{0.5}{d}\right)\\
t_1 := {\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\\
\mathbf{if}\;t\_1 \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \leq 2 \cdot 10^{+274}:\\
\;\;\;\;t\_1 \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot \left(t\_0 \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999984e274Initial program 88.9%
metadata-eval88.9%
associate-*l*88.9%
frac-times89.4%
add-sqr-sqrt89.4%
pow289.4%
Applied egg-rr92.5%
unpow292.5%
metadata-eval92.5%
div-inv92.5%
associate-*l*92.5%
div-inv92.5%
metadata-eval92.5%
metadata-eval92.5%
div-inv92.5%
associate-*l*92.5%
Applied egg-rr92.5%
swap-sqr89.4%
rem-square-sqrt89.4%
associate-*r*89.4%
associate-*r*89.4%
swap-sqr89.4%
associate-*l/88.3%
associate-/l*89.4%
associate-/l*89.4%
associate-*l/88.9%
associate-/l*89.9%
associate-/l*89.9%
rem-square-sqrt90.0%
Simplified90.0%
if 1.99999999999999984e274 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 13.2%
metadata-eval13.2%
associate-*l*13.2%
frac-times13.2%
add-sqr-sqrt13.2%
pow213.2%
Applied egg-rr16.6%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt29.4%
neg-mul-129.4%
unpow-129.4%
metadata-eval29.4%
pow-sqr29.4%
rem-sqrt-square29.4%
rem-square-sqrt29.3%
fabs-sqr29.3%
rem-square-sqrt29.4%
Simplified29.4%
Final simplification71.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-311)
(*
(/ (sqrt (- d)) (sqrt (- l)))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l))))
(*
(/ (sqrt d) (sqrt l))
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-311) {
tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (sqrt(d) / sqrt(l)) * ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / 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 (l <= (-2d-311)) then
tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l)))
else
tmp = (sqrt(d) / sqrt(l)) * ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / 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 (l <= -2e-311) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-311: tmp = (math.sqrt(-d) / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) else: tmp = (math.sqrt(d) / math.sqrt(l)) * ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-311) tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); else tmp = (sqrt(d) / sqrt(l)) * ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-311], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(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] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr73.5%
associate-*l/79.5%
*-commutative79.5%
associate-/l/79.5%
Applied egg-rr79.5%
associate-*r*79.5%
*-commutative79.5%
Simplified79.5%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
sqrt-div80.2%
Applied egg-rr80.2%
Final simplification79.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
(if (<= l -2e-311)
(* (/ (sqrt (- d)) (sqrt (- l))) t_0)
(* (/ (sqrt d) (sqrt l)) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2e-311) {
tmp = (sqrt(-d) / sqrt(-l)) * t_0;
} else {
tmp = (sqrt(d) / sqrt(l)) * 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((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
if (l <= (-2d-311)) then
tmp = (sqrt(-d) / sqrt(-l)) * t_0
else
tmp = (sqrt(d) / sqrt(l)) * 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((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
double tmp;
if (l <= -2e-311) {
tmp = (Math.sqrt(-d) / Math.sqrt(-l)) * t_0;
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l)) tmp = 0 if l <= -2e-311: tmp = (math.sqrt(-d) / math.sqrt(-l)) * t_0 else: tmp = (math.sqrt(d) / math.sqrt(l)) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l)); tmp = 0.0; if (l <= -2e-311) tmp = (sqrt(-d) / sqrt(-l)) * t_0; else tmp = (sqrt(d) / sqrt(l)) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-311], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot t\_0\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr73.5%
associate-*l/79.5%
*-commutative79.5%
associate-/l/79.5%
Applied egg-rr79.5%
associate-*r*79.5%
*-commutative79.5%
Simplified79.5%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification77.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))))
(if (<= l -2e-311)
(*
(* (/ (sqrt (- d)) (sqrt (- l))) t_0)
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(*
(/ (sqrt d) (sqrt l))
(* t_0 (+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double tmp;
if (l <= -2e-311) {
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 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 / h))
if (l <= (-2d-311)) then
tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 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 / h));
double tmp;
if (l <= -2e-311) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) tmp = 0 if l <= -2e-311: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) tmp = 0.0 if (l <= -2e-311) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * t_0) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_0 * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); tmp = 0.0; if (l <= -2e-311) tmp = ((sqrt(-d) / sqrt(-l)) * t_0) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); else tmp = (sqrt(d) / sqrt(l)) * (t_0 * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2e-311], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_0 \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified67.9%
associate-*r/70.3%
*-commutative70.3%
div-inv70.3%
metadata-eval70.3%
Applied egg-rr70.3%
frac-2neg76.6%
sqrt-div82.9%
Applied egg-rr78.0%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification76.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-311)
(*
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5))))
(sqrt (/ d l)))
(*
(/ (sqrt d) (sqrt l))
(*
(sqrt (/ d h))
(+ 1.0 (/ (* (* h -0.5) (pow (* D (/ M (* d 2.0))) 2.0)) l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-311) {
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * sqrt((d / l));
} else {
tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * pow((D * (M / (d * 2.0))), 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-311)) then
tmp = ((sqrt(-d) / sqrt(-h)) * (1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0))))) * sqrt((d / l))
else
tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0d0 + (((h * (-0.5d0)) * ((d_1 * (m / (d * 2.0d0))) ** 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-311) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * Math.sqrt((d / l));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(l)) * (Math.sqrt((d / h)) * (1.0 + (((h * -0.5) * Math.pow((D * (M / (d * 2.0))), 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-311: tmp = ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5)))) * math.sqrt((d / l)) else: tmp = (math.sqrt(d) / math.sqrt(l)) * (math.sqrt((d / h)) * (1.0 + (((h * -0.5) * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-311) tmp = Float64(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)))) * sqrt(Float64(d / l))); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-311) tmp = ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5)))) * sqrt((d / l)); else tmp = (sqrt(d) / sqrt(l)) * (sqrt((d / h)) * (1.0 + (((h * -0.5) * ((D * (M / (d * 2.0))) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-311], N[(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] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\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) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.9999999999999e-311Initial program 68.6%
Simplified68.6%
frac-2neg68.6%
sqrt-div76.6%
Applied egg-rr76.6%
if -1.9999999999999e-311 < l Initial program 63.4%
Simplified65.0%
sqrt-div70.4%
Applied egg-rr70.4%
associate-*l/0.0%
*-commutative0.0%
associate-/l/0.0%
Applied egg-rr75.4%
associate-*r*0.0%
*-commutative0.0%
Simplified75.4%
Final simplification76.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= l 2.85e-235)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))
(* (sqrt (/ d h)) t_0))
(*
(*
(+ 1.0 (* (/ h l) (* (pow (* D (/ (/ M 2.0) d)) 2.0) -0.5)))
(/ (sqrt d) (sqrt h)))
t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (l <= 2.85e-235) {
tmp = (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (sqrt((d / h)) * t_0);
} else {
tmp = ((1.0 + ((h / l) * (pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (sqrt(d) / 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 = sqrt((d / l))
if (l <= 2.85d-235) then
tmp = (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))) * (sqrt((d / h)) * t_0)
else
tmp = ((1.0d0 + ((h / l) * (((d_1 * ((m / 2.0d0) / d)) ** 2.0d0) * (-0.5d0)))) * (sqrt(d) / 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 = Math.sqrt((d / l));
double tmp;
if (l <= 2.85e-235) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (Math.sqrt((d / h)) * t_0);
} else {
tmp = ((1.0 + ((h / l) * (Math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (Math.sqrt(d) / Math.sqrt(h))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) tmp = 0 if l <= 2.85e-235: tmp = (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) * (math.sqrt((d / h)) * t_0) else: tmp = ((1.0 + ((h / l) * (math.pow((D * ((M / 2.0) / d)), 2.0) * -0.5))) * (math.sqrt(d) / math.sqrt(h))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= 2.85e-235) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * t_0)); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) * Float64(sqrt(d) / sqrt(h))) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); tmp = 0.0; if (l <= 2.85e-235) tmp = (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))) * (sqrt((d / h)) * t_0); else tmp = ((1.0 + ((h / l) * (((D * ((M / 2.0) / d)) ^ 2.0) * -0.5))) * (sqrt(d) / sqrt(h))) * t_0; 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, 2.85e-235], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(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] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq 2.85 \cdot 10^{-235}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_0\\
\end{array}
\end{array}
if l < 2.85e-235Initial program 68.3%
Simplified67.6%
associate-*r/70.5%
*-commutative70.5%
div-inv70.5%
metadata-eval70.5%
Applied egg-rr70.5%
if 2.85e-235 < l Initial program 63.2%
Simplified65.0%
sqrt-div81.4%
Applied egg-rr74.2%
Final simplification72.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.65e+213)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= l 1.45e-278)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.65e+213) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (l <= 1.45e-278) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.65d+213)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (l <= 1.45d-278) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.65e+213) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (l <= 1.45e-278) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.65e+213: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif l <= 1.45e-278: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.65e+213) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (l <= 1.45e-278) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.65e+213) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (l <= 1.45e-278) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.65e+213], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e-278], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.65 \cdot 10^{+213}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{-278}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.6499999999999999e213Initial program 73.6%
Simplified73.6%
Taylor expanded in d around inf 74.1%
if -2.6499999999999999e213 < l < 1.45e-278Initial program 68.9%
metadata-eval68.9%
associate-*l*68.9%
frac-times68.1%
add-sqr-sqrt68.1%
pow268.1%
Applied egg-rr70.8%
associate-*r*70.8%
unpow-prod-down70.8%
metadata-eval70.8%
div-inv70.8%
associate-*l/70.9%
associate-*r/71.6%
associate-/l/71.6%
pow271.6%
pow1/271.6%
pow1/271.6%
pow-prod-up71.6%
metadata-eval71.6%
metadata-eval71.6%
Applied egg-rr71.6%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt42.4%
neg-mul-142.4%
Simplified42.4%
if 1.45e-278 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
*-commutative38.8%
unpow-prod-down49.8%
Applied egg-rr49.8%
Final simplification48.5%
(FPCore (d h l M D) :precision binary64 (if (<= l 5.6e-285) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.6e-285) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 5.6d-285) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5.6e-285) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 5.6e-285: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5.6e-285) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 5.6e-285) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5.6e-285], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.6 \cdot 10^{-285}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < 5.59999999999999982e-285Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
associate-*r*71.3%
unpow-prod-down71.3%
metadata-eval71.3%
div-inv71.3%
associate-*l/71.4%
associate-*r/72.0%
associate-/l/72.0%
pow272.0%
pow1/272.0%
pow1/272.0%
pow-prod-up72.0%
metadata-eval72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.4%
neg-mul-141.4%
Simplified41.4%
if 5.59999999999999982e-285 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
*-commutative38.8%
unpow-prod-down49.8%
Applied egg-rr49.8%
Final simplification45.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 3e-279) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3e-279) {
tmp = d * -sqrt(((1.0 / l) / 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 (l <= 3d-279) then
tmp = d * -sqrt(((1.0d0 / l) / 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 (l <= 3e-279) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.pow((l * h), -0.5);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3e-279: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.pow((l * h), -0.5) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3e-279) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / 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 (l <= 3e-279) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * ((l * h) ^ -0.5); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3e-279], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3 \cdot 10^{-279}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\end{array}
\end{array}
if l < 3e-279Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
associate-*r*71.3%
unpow-prod-down71.3%
metadata-eval71.3%
div-inv71.3%
associate-*l/71.4%
associate-*r/72.0%
associate-/l/72.0%
pow272.0%
pow1/272.0%
pow1/272.0%
pow-prod-up72.0%
metadata-eval72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt41.4%
neg-mul-141.4%
Simplified41.4%
if 3e-279 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
Final simplification40.2%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* l h) -0.5))) (if (<= l 4.9e-285) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow((l * h), -0.5);
double tmp;
if (l <= 4.9e-285) {
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 = (l * h) ** (-0.5d0)
if (l <= 4.9d-285) 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.pow((l * h), -0.5);
double tmp;
if (l <= 4.9e-285) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow((l * h), -0.5) tmp = 0 if l <= 4.9e-285: tmp = -d * t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(l * h) ^ -0.5 tmp = 0.0 if (l <= 4.9e-285) 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 = (l * h) ^ -0.5; tmp = 0.0; if (l <= 4.9e-285) 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[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, 4.9e-285], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 4.89999999999999975e-285Initial program 69.7%
metadata-eval69.7%
associate-*l*69.7%
frac-times69.0%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr71.3%
Taylor expanded in l around -inf 0.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt40.8%
neg-mul-140.8%
unpow-140.8%
metadata-eval40.8%
pow-sqr40.9%
rem-sqrt-square40.9%
rem-square-sqrt40.7%
fabs-sqr40.7%
rem-square-sqrt40.9%
Simplified40.9%
if 4.89999999999999975e-285 < l Initial program 61.7%
metadata-eval61.7%
associate-*l*61.7%
frac-times63.3%
add-sqr-sqrt63.3%
pow263.3%
Applied egg-rr67.7%
Taylor expanded in d around inf 38.3%
unpow-138.3%
metadata-eval38.3%
pow-sqr38.3%
rem-sqrt-square38.8%
rem-square-sqrt38.6%
fabs-sqr38.6%
rem-square-sqrt38.8%
Simplified38.8%
Final simplification39.9%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 66.2%
metadata-eval66.2%
associate-*l*66.2%
frac-times66.5%
add-sqr-sqrt66.5%
pow266.5%
Applied egg-rr69.7%
Taylor expanded in d around inf 22.5%
unpow-122.5%
metadata-eval22.5%
pow-sqr22.6%
rem-sqrt-square22.4%
rem-square-sqrt22.3%
fabs-sqr22.3%
rem-square-sqrt22.4%
Simplified22.4%
Final simplification22.4%
herbie shell --seed 2024191
(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)))))