
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -3.5e+36)
(*
(sqrt (/ d h))
(*
(/ t_0 (sqrt (- l)))
(+ 1.0 (* (/ h l) (* (pow (/ M (* d (/ 2.0 D))) 2.0) -0.5)))))
(if (<= l -1e-309)
(*
(* (/ t_0 (sqrt (- h))) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l))))
(*
(/ (sqrt d) (sqrt h))
(*
(/ (sqrt d) (sqrt l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -3.5e+36) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = ((t_0 / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-d)
if (l <= (-3.5d+36)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0d0 + ((h / l) * (((m / (d * (2.0d0 / d_1))) ** 2.0d0) * (-0.5d0)))))
else if (l <= (-1d-309)) then
tmp = ((t_0 / sqrt(-h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (0.5d0 * ((h * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)) / l)))
else
tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double tmp;
if (l <= -3.5e+36) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * (1.0 + ((h / l) * (Math.pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = ((t_0 / Math.sqrt(-h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l)));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * ((Math.sqrt(d) / Math.sqrt(l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -3.5e+36: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * (1.0 + ((h / l) * (math.pow((M / (d * (2.0 / D))), 2.0) * -0.5)))) elif l <= -1e-309: tmp = ((t_0 / math.sqrt(-h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * ((math.sqrt(d) / math.sqrt(l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -3.5e+36) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(M / Float64(d * Float64(2.0 / D))) ^ 2.0) * -0.5))))); elseif (l <= -1e-309) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l)))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(Float64(sqrt(d) / sqrt(l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -3.5e+36) tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (((M / (d * (2.0 / D))) ^ 2.0) * -0.5)))); elseif (l <= -1e-309) tmp = ((t_0 / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l))); else tmp = (sqrt(d) / sqrt(h)) * ((sqrt(d) / sqrt(l)) * (1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -3.5e+36], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M / N[(d * N[(2.0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -3.5 \cdot 10^{+36}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_0}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{d \cdot \frac{2}{D}}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(\frac{t_0}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if l < -3.4999999999999998e36Initial program 62.5%
Simplified66.0%
frac-times62.5%
*-commutative62.5%
frac-times66.0%
clear-num66.0%
frac-times66.0%
*-un-lft-identity66.0%
Applied egg-rr66.0%
frac-2neg66.0%
sqrt-div73.7%
Applied egg-rr73.7%
if -3.4999999999999998e36 < l < -1.000000000000002e-309Initial program 80.0%
Simplified78.8%
associate-*r/82.9%
frac-times84.1%
*-commutative84.1%
frac-times83.3%
div-inv83.3%
metadata-eval83.3%
Applied egg-rr83.3%
clear-num83.3%
sqrt-div84.7%
metadata-eval84.7%
Applied egg-rr84.7%
frac-2neg84.7%
sqrt-div92.7%
Applied egg-rr92.7%
if -1.000000000000002e-309 < l Initial program 70.4%
Simplified71.1%
sqrt-div75.7%
Applied egg-rr75.7%
sqrt-div85.4%
Applied egg-rr85.4%
Final simplification85.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= l -4.5e+36)
(*
(sqrt (/ d h))
(*
(/ t_0 (sqrt (- l)))
(+ 1.0 (* (/ h l) (* (pow (/ M (* d (/ 2.0 D))) 2.0) -0.5)))))
(if (<= l -1e-309)
(*
(* (/ t_0 (sqrt (- h))) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (* 0.5 (/ (* h t_1) l))))
(* (/ d (* (sqrt h) (sqrt l))) (- 1.0 (* (/ h l) (* 0.5 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -4.5e+36) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = ((t_0 / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * t_1) / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * 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)
t_1 = ((m * 0.5d0) * (d_1 / d)) ** 2.0d0
if (l <= (-4.5d+36)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0d0 + ((h / l) * (((m / (d * (2.0d0 / d_1))) ** 2.0d0) * (-0.5d0)))))
else if (l <= (-1d-309)) then
tmp = ((t_0 / sqrt(-h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (0.5d0 * ((h * t_1) / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * 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);
double t_1 = Math.pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -4.5e+36) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * (1.0 + ((h / l) * (Math.pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = ((t_0 / Math.sqrt(-h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * t_1) / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = math.pow(((M * 0.5) * (D / d)), 2.0) tmp = 0 if l <= -4.5e+36: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * (1.0 + ((h / l) * (math.pow((M / (d * (2.0 / D))), 2.0) * -0.5)))) elif l <= -1e-309: tmp = ((t_0 / math.sqrt(-h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (0.5 * ((h * t_1) / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (l <= -4.5e+36) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(M / Float64(d * Float64(2.0 / D))) ^ 2.0) * -0.5))))); elseif (l <= -1e-309) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_1) / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = ((M * 0.5) * (D / d)) ^ 2.0; tmp = 0.0; if (l <= -4.5e+36) tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (((M / (d * (2.0 / D))) ^ 2.0) * -0.5)))); elseif (l <= -1e-309) tmp = ((t_0 / sqrt(-h)) * (1.0 / sqrt((l / d)))) * (1.0 - (0.5 * ((h * t_1) / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -4.5e+36], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M / N[(d * N[(2.0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * t$95$1), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_0}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{d \cdot \frac{2}{D}}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(\frac{t_0}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_1}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot t_1\right)\right)\\
\end{array}
\end{array}
if l < -4.49999999999999997e36Initial program 62.5%
Simplified66.0%
frac-times62.5%
*-commutative62.5%
frac-times66.0%
clear-num66.0%
frac-times66.0%
*-un-lft-identity66.0%
Applied egg-rr66.0%
frac-2neg66.0%
sqrt-div73.7%
Applied egg-rr73.7%
if -4.49999999999999997e36 < l < -1.000000000000002e-309Initial program 80.0%
Simplified78.8%
associate-*r/82.9%
frac-times84.1%
*-commutative84.1%
frac-times83.3%
div-inv83.3%
metadata-eval83.3%
Applied egg-rr83.3%
clear-num83.3%
sqrt-div84.7%
metadata-eval84.7%
Applied egg-rr84.7%
frac-2neg84.7%
sqrt-div92.7%
Applied egg-rr92.7%
if -1.000000000000002e-309 < l Initial program 70.4%
Simplified71.1%
Applied egg-rr82.3%
Final simplification83.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= l -1.8e+115)
(*
(sqrt (/ d h))
(*
(/ t_0 (sqrt (- l)))
(+ 1.0 (* (/ h l) (* (pow (/ M (* d (/ 2.0 D))) 2.0) -0.5)))))
(if (<= l -1e-309)
(*
(- 1.0 (* 0.5 (/ (* h t_1) l)))
(* (/ t_0 (sqrt (- h))) (sqrt (/ d l))))
(* (/ d (* (sqrt h) (sqrt l))) (- 1.0 (* (/ h l) (* 0.5 t_1))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -1.8e+115) {
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = (1.0 - (0.5 * ((h * t_1) / l))) * ((t_0 / sqrt(-h)) * sqrt((d / l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * 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)
t_1 = ((m * 0.5d0) * (d_1 / d)) ** 2.0d0
if (l <= (-1.8d+115)) then
tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0d0 + ((h / l) * (((m / (d * (2.0d0 / d_1))) ** 2.0d0) * (-0.5d0)))))
else if (l <= (-1d-309)) then
tmp = (1.0d0 - (0.5d0 * ((h * t_1) / l))) * ((t_0 / sqrt(-h)) * sqrt((d / l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * 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);
double t_1 = Math.pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -1.8e+115) {
tmp = Math.sqrt((d / h)) * ((t_0 / Math.sqrt(-l)) * (1.0 + ((h / l) * (Math.pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else if (l <= -1e-309) {
tmp = (1.0 - (0.5 * ((h * t_1) / l))) * ((t_0 / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = math.pow(((M * 0.5) * (D / d)), 2.0) tmp = 0 if l <= -1.8e+115: tmp = math.sqrt((d / h)) * ((t_0 / math.sqrt(-l)) * (1.0 + ((h / l) * (math.pow((M / (d * (2.0 / D))), 2.0) * -0.5)))) elif l <= -1e-309: tmp = (1.0 - (0.5 * ((h * t_1) / l))) * ((t_0 / math.sqrt(-h)) * math.sqrt((d / l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (l <= -1.8e+115) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(M / Float64(d * Float64(2.0 / D))) ^ 2.0) * -0.5))))); elseif (l <= -1e-309) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_1) / l))) * Float64(Float64(t_0 / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * t_1)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = ((M * 0.5) * (D / d)) ^ 2.0; tmp = 0.0; if (l <= -1.8e+115) tmp = sqrt((d / h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (((M / (d * (2.0 / D))) ^ 2.0) * -0.5)))); elseif (l <= -1e-309) tmp = (1.0 - (0.5 * ((h * t_1) / l))) * ((t_0 / sqrt(-h)) * sqrt((d / l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_1))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -1.8e+115], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M / N[(d * N[(2.0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-309], N[(N[(1.0 - N[(0.5 * N[(N[(h * t$95$1), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+115}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_0}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{d \cdot \frac{2}{D}}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t_1}{\ell}\right) \cdot \left(\frac{t_0}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot t_1\right)\right)\\
\end{array}
\end{array}
if l < -1.8e115Initial program 58.2%
Simplified63.0%
frac-times58.2%
*-commutative58.2%
frac-times63.1%
clear-num63.1%
frac-times63.0%
*-un-lft-identity63.0%
Applied egg-rr63.0%
frac-2neg63.0%
sqrt-div73.3%
Applied egg-rr73.3%
if -1.8e115 < l < -1.000000000000002e-309Initial program 78.9%
Simplified77.9%
associate-*r/81.2%
frac-times82.2%
*-commutative82.2%
frac-times81.5%
div-inv81.5%
metadata-eval81.5%
Applied egg-rr81.5%
frac-2neg81.7%
sqrt-div89.4%
Applied egg-rr89.2%
if -1.000000000000002e-309 < l Initial program 70.4%
Simplified71.1%
Applied egg-rr82.3%
Final simplification83.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(sqrt (/ d h))
(*
(/ (sqrt (- d)) (sqrt (- l)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-5d-310)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5e-310: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0))))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -5e-310) tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0))))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 72.8%
Simplified74.3%
frac-2neg74.2%
sqrt-div79.6%
Applied egg-rr79.6%
if -4.999999999999985e-310 < d Initial program 70.4%
Simplified71.1%
Applied egg-rr82.3%
Final simplification81.0%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-310)
(*
(sqrt (/ d h))
(*
(/ (sqrt (- d)) (sqrt (- l)))
(+ 1.0 (* (/ h l) (* (pow (/ M (* d (/ 2.0 D))) 2.0) -0.5)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h / l) * (pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-5d-310)) then
tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0d0 + ((h / l) * (((m / (d * (2.0d0 / d_1))) ** 2.0d0) * (-0.5d0)))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-310) {
tmp = Math.sqrt((d / h)) * ((Math.sqrt(-d) / Math.sqrt(-l)) * (1.0 + ((h / l) * (Math.pow((M / (d * (2.0 / D))), 2.0) * -0.5))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5e-310: tmp = math.sqrt((d / h)) * ((math.sqrt(-d) / math.sqrt(-l)) * (1.0 + ((h / l) * (math.pow((M / (d * (2.0 / D))), 2.0) * -0.5)))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(M / Float64(d * Float64(2.0 / D))) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -5e-310) tmp = sqrt((d / h)) * ((sqrt(-d) / sqrt(-l)) * (1.0 + ((h / l) * (((M / (d * (2.0 / D))) ^ 2.0) * -0.5)))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(M / N[(d * N[(2.0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{d \cdot \frac{2}{D}}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -4.999999999999985e-310Initial program 72.8%
Simplified74.3%
frac-times72.8%
*-commutative72.8%
frac-times73.6%
clear-num73.6%
frac-times74.2%
*-un-lft-identity74.2%
Applied egg-rr74.2%
frac-2neg74.2%
sqrt-div79.6%
Applied egg-rr79.6%
if -4.999999999999985e-310 < d Initial program 70.4%
Simplified71.1%
Applied egg-rr82.3%
Final simplification80.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (pow (* (* M 0.5) (/ D d)) 2.0)))
(if (<= l -1e-309)
(*
(- 1.0 (* 0.5 (/ (* h t_0) l)))
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))))
(* (/ d (* (sqrt h) (sqrt l))) (- 1.0 (* (/ h l) (* 0.5 t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = pow(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -1e-309) {
tmp = (1.0 - (0.5 * ((h * t_0) / l))) * (sqrt((d / h)) * (sqrt(-d) / sqrt(-l)));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_0)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = ((m * 0.5d0) * (d_1 / d)) ** 2.0d0
if (l <= (-1d-309)) then
tmp = (1.0d0 - (0.5d0 * ((h * t_0) / l))) * (sqrt((d / h)) * (sqrt(-d) / sqrt(-l)))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * 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(((M * 0.5) * (D / d)), 2.0);
double tmp;
if (l <= -1e-309) {
tmp = (1.0 - (0.5 * ((h * t_0) / l))) * (Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l)));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.pow(((M * 0.5) * (D / d)), 2.0) tmp = 0 if l <= -1e-309: tmp = (1.0 - (0.5 * ((h * t_0) / l))) * (math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0 tmp = 0.0 if (l <= -1e-309) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * t_0) / l))) * Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * 0.5) * (D / d)) ^ 2.0; tmp = 0.0; if (l <= -1e-309) tmp = (1.0 - (0.5 * ((h * t_0) / l))) * (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, -1e-309], N[(N[(1.0 - N[(0.5 * N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot t_0\right)\right)\\
\end{array}
\end{array}
if l < -1.000000000000002e-309Initial program 72.8%
Simplified73.5%
associate-*r/73.7%
frac-times74.4%
*-commutative74.4%
frac-times73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
frac-2neg74.2%
sqrt-div79.6%
Applied egg-rr80.7%
if -1.000000000000002e-309 < l Initial program 70.4%
Simplified71.1%
Applied egg-rr82.3%
Final simplification81.5%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1e-309)
(*
(sqrt (/ d h))
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))
(sqrt (/ d l))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = sqrt((d / h)) * ((1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))) * sqrt((d / l)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-309)) then
tmp = sqrt((d / h)) * ((1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))) * sqrt((d / l)))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = Math.sqrt((d / h)) * ((1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))) * Math.sqrt((d / l)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1e-309: tmp = math.sqrt((d / h)) * ((1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0)))) * math.sqrt((d / l))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow((D * (0.5 * (M / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1e-309) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1e-309) tmp = sqrt((d / h)) * ((1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0)))) * sqrt((d / l))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * ((D * (0.5 * (M / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1e-309], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 72.8%
Simplified74.3%
if -1.000000000000002e-309 < h Initial program 70.4%
Simplified71.1%
Applied egg-rr33.8%
expm1-def45.8%
expm1-log1p82.3%
associate-/r*82.2%
*-commutative82.2%
associate-*r/81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l/82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
Final simplification78.3%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1e-309)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (/ (* d 2.0) M)) 2.0))))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1d-309)) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / ((d * 2.0d0) / m)) ** 2.0d0)))))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1e-309) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / ((d * 2.0) / M)), 2.0)))));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1e-309: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / ((d * 2.0) / M)), 2.0))))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow((D * (0.5 * (M / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1e-309) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(Float64(d * 2.0) / M)) ^ 2.0)))))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1e-309) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (-0.5 * ((D / ((d * 2.0) / M)) ^ 2.0))))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * ((D * (0.5 * (M / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1e-309], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(N[(d * 2.0), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{\frac{d \cdot 2}{M}}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 72.8%
Simplified74.3%
clear-num74.3%
frac-times73.6%
*-un-lft-identity73.6%
associate-*l/73.5%
*-commutative73.5%
Applied egg-rr73.5%
if -1.000000000000002e-309 < h Initial program 70.4%
Simplified71.1%
Applied egg-rr33.8%
expm1-def45.8%
expm1-log1p82.3%
associate-/r*82.2%
*-commutative82.2%
associate-*r/81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l/82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
Final simplification77.9%
(FPCore (d h l M D)
:precision binary64
(if (<= h 9e-253)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* (* M 0.5) (/ D d)) 2.0)) l)))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (1.0 - (0.5 * ((h * pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 9d-253) then
tmp = (1.0d0 - (0.5d0 * ((h * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0)) / l))) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (1.0 - (0.5 * ((h * Math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 9e-253: tmp = (1.0 - (0.5 * ((h * math.pow(((M * 0.5) * (D / d)), 2.0)) / l))) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow((D * (0.5 * (M / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 9e-253) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 9e-253) tmp = (1.0 - (0.5 * ((h * (((M * 0.5) * (D / d)) ^ 2.0)) / l))) * (sqrt((d / h)) * sqrt((d / l))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * ((D * (0.5 * (M / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 9e-253], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 9 \cdot 10^{-253}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < 9.00000000000000057e-253Initial program 72.8%
Simplified73.5%
associate-*r/74.4%
frac-times75.0%
*-commutative75.0%
frac-times74.6%
div-inv74.6%
metadata-eval74.6%
Applied egg-rr74.6%
if 9.00000000000000057e-253 < h Initial program 70.2%
Simplified71.0%
Applied egg-rr33.6%
expm1-def45.0%
expm1-log1p83.2%
associate-/r*83.0%
*-commutative83.0%
associate-*r/82.3%
associate-*l*82.3%
*-commutative82.3%
associate-*l/83.1%
*-commutative83.1%
associate-*l*83.1%
Simplified83.1%
Final simplification78.5%
(FPCore (d h l M D)
:precision binary64
(if (<= h 9e-253)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(+ 1.0 (* -0.5 (* h (/ (pow (* 0.5 (* M (/ D d))) 2.0) l)))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.5 * (h * (pow((0.5 * (M * (D / d))), 2.0) / l))));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 9d-253) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 + ((-0.5d0) * (h * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) / l))))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 + (-0.5 * (h * (Math.pow((0.5 * (M * (D / d))), 2.0) / l))));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 9e-253: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 + (-0.5 * (h * (math.pow((0.5 * (M * (D / d))), 2.0) / l)))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow((D * (0.5 * (M / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 9e-253) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) / l))))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 9e-253) tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.5 * (h * (((0.5 * (M * (D / d))) ^ 2.0) / l)))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * ((D * (0.5 * (M / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 9e-253], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 9 \cdot 10^{-253}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < 9.00000000000000057e-253Initial program 72.8%
Simplified73.5%
associate-*r/74.4%
frac-times75.0%
*-commutative75.0%
frac-times74.6%
div-inv74.6%
metadata-eval74.6%
Applied egg-rr74.6%
clear-num73.8%
sqrt-div74.6%
metadata-eval74.6%
Applied egg-rr74.6%
expm1-log1p-u40.8%
expm1-udef26.6%
Applied egg-rr25.8%
expm1-def39.9%
expm1-log1p74.1%
associate-/r/76.0%
associate-*l*76.0%
Simplified76.0%
if 9.00000000000000057e-253 < h Initial program 70.2%
Simplified71.0%
Applied egg-rr33.6%
expm1-def45.0%
expm1-log1p83.2%
associate-/r*83.0%
*-commutative83.0%
associate-*r/82.3%
associate-*l*82.3%
*-commutative82.3%
associate-*l/83.1%
*-commutative83.1%
associate-*l*83.1%
Simplified83.1%
Final simplification79.3%
(FPCore (d h l M D)
:precision binary64
(if (<= h 9e-253)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(+ 1.0 (* -0.5 (* h (/ (pow (* 0.5 (* M (/ D d))) 2.0) l)))))
(*
(/ d (* (sqrt h) (sqrt l)))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (* M 0.5) (/ D d)) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.5 * (h * (pow((0.5 * (M * (D / d))), 2.0) / l))));
} else {
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 9d-253) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 + ((-0.5d0) * (h * (((0.5d0 * (m * (d_1 / d))) ** 2.0d0) / l))))
else
tmp = (d / (sqrt(h) * sqrt(l))) * (1.0d0 - ((h / l) * (0.5d0 * (((m * 0.5d0) * (d_1 / d)) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 9e-253) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 + (-0.5 * (h * (Math.pow((0.5 * (M * (D / d))), 2.0) / l))));
} else {
tmp = (d / (Math.sqrt(h) * Math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * Math.pow(((M * 0.5) * (D / d)), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 9e-253: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 + (-0.5 * (h * (math.pow((0.5 * (M * (D / d))), 2.0) / l)))) else: tmp = (d / (math.sqrt(h) * math.sqrt(l))) * (1.0 - ((h / l) * (0.5 * math.pow(((M * 0.5) * (D / d)), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 9e-253) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 + Float64(-0.5 * Float64(h * Float64((Float64(0.5 * Float64(M * Float64(D / d))) ^ 2.0) / l))))); else tmp = Float64(Float64(d / Float64(sqrt(h) * sqrt(l))) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 9e-253) tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 + (-0.5 * (h * (((0.5 * (M * (D / d))) ^ 2.0) / l)))); else tmp = (d / (sqrt(h) * sqrt(l))) * (1.0 - ((h / l) * (0.5 * (((M * 0.5) * (D / d)) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 9e-253], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(h * N[(N[Power[N[(0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 9 \cdot 10^{-253}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if h < 9.00000000000000057e-253Initial program 72.8%
Simplified73.5%
associate-*r/74.4%
frac-times75.0%
*-commutative75.0%
frac-times74.6%
div-inv74.6%
metadata-eval74.6%
Applied egg-rr74.6%
clear-num73.8%
sqrt-div74.6%
metadata-eval74.6%
Applied egg-rr74.6%
expm1-log1p-u40.8%
expm1-udef26.6%
Applied egg-rr25.8%
expm1-def39.9%
expm1-log1p74.1%
associate-/r/76.0%
associate-*l*76.0%
Simplified76.0%
if 9.00000000000000057e-253 < h Initial program 70.2%
Simplified71.0%
Applied egg-rr83.2%
Final simplification79.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-309)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* -0.5 (/ (pow (* (* M 0.5) (/ D d)) 2.0) (/ l h)))))
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* D (* 0.5 (/ M d))) 2.0)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-309) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (pow(((M * 0.5) * (D / d)), 2.0) / (l / h))));
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-309)) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) * ((((m * 0.5d0) * (d_1 / d)) ** 2.0d0) / (l / h))))
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * ((d_1 * (0.5d0 * (m / d))) ** 2.0d0))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-309) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (Math.pow(((M * 0.5) * (D / d)), 2.0) / (l / h))));
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow((D * (0.5 * (M / d))), 2.0))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-309: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (math.pow(((M * 0.5) * (D / d)), 2.0) / (l / h)))) else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow((D * (0.5 * (M / d))), 2.0)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-309) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) / Float64(l / h))))); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-309) tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * ((((M * 0.5) * (D / d)) ^ 2.0) / (l / h)))); else tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * ((D * (0.5 * (M / d))) ^ 2.0)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-309], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\frac{\ell}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if l < -1.9999999999999988e-309Initial program 72.8%
Simplified73.5%
associate-*r/73.7%
frac-times74.4%
*-commutative74.4%
frac-times73.9%
div-inv73.9%
metadata-eval73.9%
Applied egg-rr73.9%
expm1-log1p-u38.8%
expm1-udef24.9%
Applied egg-rr21.3%
expm1-def31.4%
expm1-log1p65.9%
*-commutative65.9%
Simplified65.9%
if -1.9999999999999988e-309 < l Initial program 70.4%
Simplified71.1%
Applied egg-rr33.8%
expm1-def45.8%
expm1-log1p82.3%
associate-/r*82.2%
*-commutative82.2%
associate-*r/81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l/82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
Final simplification74.2%
(FPCore (d h l M D)
:precision binary64
(if (<= D 4.8e-48)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* -0.5 (/ (pow (* (* M 0.5) (/ D d)) 2.0) (/ l h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (D <= 4.8e-48) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (pow(((M * 0.5) * (D / d)), 2.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 (d_1 <= 4.8d-48) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + ((-0.5d0) * ((((m * 0.5d0) * (d_1 / d)) ** 2.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 (D <= 4.8e-48) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (Math.pow(((M * 0.5) * (D / d)), 2.0) / (l / h))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if D <= 4.8e-48: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * (math.pow(((M * 0.5) * (D / d)), 2.0) / (l / h)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (D <= 4.8e-48) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(-0.5 * Float64((Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0) / Float64(l / h))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (D <= 4.8e-48) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = sqrt(((d / h) * (d / l))) * (1.0 + (-0.5 * ((((M * 0.5) * (D / d)) ^ 2.0) / (l / h)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 4.8e-48], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 4.8 \cdot 10^{-48}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\frac{\ell}{h}}\right)\\
\end{array}
\end{array}
if D < 4.8e-48Initial program 73.4%
Simplified73.9%
Taylor expanded in h around 0 44.6%
if 4.8e-48 < D Initial program 66.5%
Simplified68.0%
associate-*r/66.7%
frac-times66.7%
*-commutative66.7%
frac-times66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
expm1-log1p-u25.3%
expm1-udef19.6%
Applied egg-rr18.3%
expm1-def24.1%
expm1-log1p63.6%
*-commutative63.6%
Simplified63.6%
Final simplification49.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.5e-230)
(* (- d) (sqrt (/ (/ 1.0 l) h)))
(if (<= d 2.1e-117)
(* d (pow (/ (/ 1.0 h) l) 0.5))
(* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.5e-230) {
tmp = -d * sqrt(((1.0 / l) / h));
} else if (d <= 2.1e-117) {
tmp = d * pow(((1.0 / h) / l), 0.5);
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-6.5d-230)) then
tmp = -d * sqrt(((1.0d0 / l) / h))
else if (d <= 2.1d-117) then
tmp = d * (((1.0d0 / h) / l) ** 0.5d0)
else
tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.5e-230) {
tmp = -d * Math.sqrt(((1.0 / l) / h));
} else if (d <= 2.1e-117) {
tmp = d * Math.pow(((1.0 / h) / l), 0.5);
} else {
tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -6.5e-230: tmp = -d * math.sqrt(((1.0 / l) / h)) elif d <= 2.1e-117: tmp = d * math.pow(((1.0 / h) / l), 0.5) else: tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.5e-230) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h))); elseif (d <= 2.1e-117) tmp = Float64(d * (Float64(Float64(1.0 / h) / l) ^ 0.5)); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -6.5e-230) tmp = -d * sqrt(((1.0 / l) / h)); elseif (d <= 2.1e-117) tmp = d * (((1.0 / h) / l) ^ 0.5); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.5e-230], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.1e-117], N[(d * N[Power[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.5 \cdot 10^{-230}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{elif}\;d \leq 2.1 \cdot 10^{-117}:\\
\;\;\;\;d \cdot {\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < -6.5000000000000004e-230Initial program 75.7%
Simplified76.6%
associate-*r/76.8%
frac-times77.6%
*-commutative77.6%
frac-times77.0%
div-inv77.0%
metadata-eval77.0%
Applied egg-rr77.0%
clear-num76.9%
sqrt-div77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in d around -inf 43.7%
mul-1-neg43.7%
associate-/l/44.4%
Simplified44.4%
if -6.5000000000000004e-230 < d < 2.0999999999999999e-117Initial program 40.9%
Simplified40.9%
Taylor expanded in d around inf 25.6%
pow1/225.6%
associate-/r*25.6%
Applied egg-rr25.6%
if 2.0999999999999999e-117 < d Initial program 82.5%
Simplified83.6%
associate-*r/83.9%
frac-times83.9%
*-commutative83.9%
frac-times83.9%
div-inv83.9%
metadata-eval83.9%
Applied egg-rr83.9%
Taylor expanded in d around inf 53.5%
unpow-153.5%
metadata-eval53.5%
pow-sqr53.6%
rem-sqrt-square53.6%
rem-square-sqrt53.3%
fabs-sqr53.3%
rem-square-sqrt53.6%
Simplified53.6%
*-commutative53.6%
unpow-prod-down62.5%
Applied egg-rr62.5%
Final simplification47.5%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ (/ 1.0 l) h)))) (if (<= d -6.3e-229) (* (- d) t_0) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(((1.0 / l) / h));
double tmp;
if (d <= -6.3e-229) {
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(((1.0d0 / l) / h))
if (d <= (-6.3d-229)) 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(((1.0 / l) / h));
double tmp;
if (d <= -6.3e-229) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(((1.0 / l) / h)) tmp = 0 if d <= -6.3e-229: tmp = -d * t_0 else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(Float64(1.0 / l) / h)) tmp = 0.0 if (d <= -6.3e-229) 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(((1.0 / l) / h)); tmp = 0.0; if (d <= -6.3e-229) 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[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -6.3e-229], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{if}\;d \leq -6.3 \cdot 10^{-229}:\\
\;\;\;\;\left(-d\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if d < -6.29999999999999987e-229Initial program 75.7%
Simplified76.6%
associate-*r/76.8%
frac-times77.6%
*-commutative77.6%
frac-times77.0%
div-inv77.0%
metadata-eval77.0%
Applied egg-rr77.0%
clear-num76.9%
sqrt-div77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in d around -inf 43.7%
mul-1-neg43.7%
associate-/l/44.4%
Simplified44.4%
if -6.29999999999999987e-229 < d Initial program 68.4%
Simplified69.0%
Taylor expanded in d around inf 44.0%
*-commutative44.0%
associate-/r*45.0%
Simplified45.0%
Final simplification44.7%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* l h) -0.5))) (if (<= d -5.8e-230) (* (- 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 (d <= -5.8e-230) {
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 (d <= (-5.8d-230)) 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 (d <= -5.8e-230) {
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 d <= -5.8e-230: 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 (d <= -5.8e-230) 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 (d <= -5.8e-230) 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[d, -5.8e-230], 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}\;d \leq -5.8 \cdot 10^{-230}:\\
\;\;\;\;\left(-d\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if d < -5.80000000000000011e-230Initial program 75.7%
Simplified76.6%
associate-*r/76.8%
frac-times77.6%
*-commutative77.6%
frac-times77.0%
div-inv77.0%
metadata-eval77.0%
Applied egg-rr77.0%
clear-num76.9%
sqrt-div77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in d around -inf 43.7%
mul-1-neg43.7%
*-commutative43.7%
distribute-rgt-neg-in43.7%
unpow1/243.7%
rem-exp-log41.3%
exp-neg41.3%
exp-prod41.3%
*-commutative41.3%
distribute-rgt-neg-out41.3%
distribute-lft-neg-in41.3%
metadata-eval41.3%
log-prod0.0%
+-commutative0.0%
+-commutative0.0%
log-prod41.3%
*-commutative41.3%
exp-to-pow43.7%
*-commutative43.7%
Simplified43.7%
if -5.80000000000000011e-230 < d Initial program 68.4%
Simplified69.0%
associate-*r/70.0%
frac-times70.0%
*-commutative70.0%
frac-times70.0%
div-inv70.0%
metadata-eval70.0%
Applied egg-rr70.0%
Taylor expanded in d around inf 44.0%
unpow-144.0%
metadata-eval44.0%
pow-sqr44.0%
rem-sqrt-square44.0%
rem-square-sqrt43.9%
fabs-sqr43.9%
rem-square-sqrt44.0%
Simplified44.0%
Final simplification43.9%
(FPCore (d h l M D) :precision binary64 (if (<= d -6.2e-234) (* (- 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 (d <= -6.2e-234) {
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 (d <= (-6.2d-234)) 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 (d <= -6.2e-234) {
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 d <= -6.2e-234: 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 (d <= -6.2e-234) 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 (d <= -6.2e-234) 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[d, -6.2e-234], 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}\;d \leq -6.2 \cdot 10^{-234}:\\
\;\;\;\;\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 d < -6.2000000000000003e-234Initial program 75.7%
Simplified76.6%
associate-*r/76.8%
frac-times77.6%
*-commutative77.6%
frac-times77.0%
div-inv77.0%
metadata-eval77.0%
Applied egg-rr77.0%
clear-num76.9%
sqrt-div77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in d around -inf 43.7%
mul-1-neg43.7%
*-commutative43.7%
distribute-rgt-neg-in43.7%
unpow1/243.7%
rem-exp-log41.3%
exp-neg41.3%
exp-prod41.3%
*-commutative41.3%
distribute-rgt-neg-out41.3%
distribute-lft-neg-in41.3%
metadata-eval41.3%
log-prod0.0%
+-commutative0.0%
+-commutative0.0%
log-prod41.3%
*-commutative41.3%
exp-to-pow43.7%
*-commutative43.7%
Simplified43.7%
if -6.2000000000000003e-234 < d Initial program 68.4%
Simplified69.0%
Taylor expanded in d around inf 44.0%
*-commutative44.0%
associate-/r*45.0%
Simplified45.0%
Final simplification44.4%
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
return d * pow((l * h), -0.5);
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D): return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D) return Float64(d * (Float64(l * h) ^ -0.5)) end
function tmp = code(d, h, l, M, D) tmp = d * ((l * h) ^ -0.5); end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Initial program 71.6%
Simplified72.3%
associate-*r/73.0%
frac-times73.3%
*-commutative73.3%
frac-times73.1%
div-inv73.1%
metadata-eval73.1%
Applied egg-rr73.1%
Taylor expanded in d around inf 28.3%
unpow-128.3%
metadata-eval28.3%
pow-sqr28.3%
rem-sqrt-square28.3%
rem-square-sqrt28.2%
fabs-sqr28.2%
rem-square-sqrt28.3%
Simplified28.3%
Final simplification28.3%
(FPCore (d h l M D) :precision binary64 0.0)
double code(double d, double h, double l, double M, double D) {
return 0.0;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = 0.0d0
end function
public static double code(double d, double h, double l, double M, double D) {
return 0.0;
}
def code(d, h, l, M, D): return 0.0
function code(d, h, l, M, D) return 0.0 end
function tmp = code(d, h, l, M, D) tmp = 0.0; end
code[d_, h_, l_, M_, D_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 71.6%
Simplified72.3%
Taylor expanded in d around inf 28.3%
expm1-log1p-u22.9%
expm1-udef18.9%
pow1/218.9%
inv-pow18.9%
pow-pow18.9%
metadata-eval18.9%
Applied egg-rr18.9%
Taylor expanded in d around 0 4.2%
Final simplification4.2%
herbie shell --seed 2023334
(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)))))