
(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 (sqrt (- d))))
(if (<= l -2e-310)
(*
(/ t_0 (sqrt (- h)))
(*
(/ t_0 (sqrt (- l)))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5)))))
(if (<= l 1.25e+48)
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (/ 1.0 l) (* h (pow (* M (* D (/ 0.5 d))) 2.0))))))
(*
(* (sqrt (/ d h)) (/ (sqrt d) (sqrt l)))
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -2e-310) {
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else if (l <= 1.25e+48) {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * pow((M * (D * (0.5 / d))), 2.0)))));
} else {
tmp = (sqrt((d / h)) * (sqrt(d) / sqrt(l))) * (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 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 <= (-2d-310)) then
tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0d0 + ((h / l) * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0)))))
else if (l <= 1.25d+48) then
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((1.0d0 / l) * (h * ((m * (d_1 * (0.5d0 / d))) ** 2.0d0)))))
else
tmp = (sqrt((d / h)) * (sqrt(d) / sqrt(l))) * (1.0d0 - (0.5d0 * ((((d_1 / d) * (m * 0.5d0)) * sqrt((h / l))) ** 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 <= -2e-310) {
tmp = (t_0 / Math.sqrt(-h)) * ((t_0 / Math.sqrt(-l)) * (1.0 + ((h / l) * (Math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else if (l <= 1.25e+48) {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * Math.pow((M * (D * (0.5 / d))), 2.0)))));
} else {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(d) / Math.sqrt(l))) * (1.0 - (0.5 * Math.pow((((D / d) * (M * 0.5)) * Math.sqrt((h / l))), 2.0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -2e-310: tmp = (t_0 / math.sqrt(-h)) * ((t_0 / math.sqrt(-l)) * (1.0 + ((h / l) * (math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5)))) elif l <= 1.25e+48: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * math.pow((M * (D * (0.5 / d))), 2.0))))) else: tmp = (math.sqrt((d / h)) * (math.sqrt(d) / math.sqrt(l))) * (1.0 - (0.5 * math.pow((((D / d) * (M * 0.5)) * math.sqrt((h / l))), 2.0))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))))); elseif (l <= 1.25e+48) tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(1.0 / l) * Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)))))); else tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * 0.5)) * sqrt(Float64(h / l))) ^ 2.0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -2e-310) tmp = (t_0 / sqrt(-h)) * ((t_0 / sqrt(-l)) * (1.0 + ((h / l) * ((((M / 2.0) * (D / d)) ^ 2.0) * -0.5)))); elseif (l <= 1.25e+48) tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * ((M * (D * (0.5 / d))) ^ 2.0))))); else tmp = (sqrt((d / h)) * (sqrt(d) / sqrt(l))) * (1.0 - (0.5 * ((((D / d) * (M * 0.5)) * sqrt((h / l))) ^ 2.0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(t$95$0 / N[Sqrt[(-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[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.25e+48], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\frac{t_0}{\sqrt{-\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+48}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{1}{\ell} \cdot \left(h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 71.0%
Simplified70.3%
frac-2neg70.3%
sqrt-div78.9%
Applied egg-rr78.9%
frac-2neg78.9%
sqrt-div85.3%
Applied egg-rr85.3%
if -1.999999999999994e-310 < l < 1.24999999999999993e48Initial program 63.3%
Simplified61.9%
associate-*r/70.1%
clear-num70.1%
frac-times71.5%
*-commutative71.5%
frac-times70.2%
add-sqr-sqrt50.2%
add-sqr-sqrt70.2%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-/r/70.2%
*-commutative70.2%
associate-*l*70.2%
Simplified70.2%
*-commutative70.2%
associate-*r*70.2%
expm1-log1p-u70.0%
expm1-udef65.5%
associate-*r*65.5%
*-commutative65.5%
associate-*r/65.5%
Applied egg-rr65.5%
expm1-def70.0%
expm1-log1p70.2%
associate-/l*70.2%
associate-/r/70.2%
Simplified70.2%
sqrt-div82.0%
div-inv82.0%
Applied egg-rr82.0%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
if 1.24999999999999993e48 < l Initial program 65.9%
Simplified65.9%
add-sqr-sqrt65.9%
pow265.9%
sqrt-prod65.9%
frac-times65.8%
*-commutative65.8%
frac-times65.9%
unpow265.9%
sqrt-prod46.8%
add-sqr-sqrt75.5%
div-inv75.5%
metadata-eval75.5%
Applied egg-rr75.5%
sqrt-div82.2%
div-inv82.2%
Applied egg-rr82.2%
associate-*r/82.2%
*-rgt-identity82.2%
Simplified82.2%
Final simplification83.7%
(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 (/ (* M D) (* d 2.0)) 2.0)))))
INFINITY)
(*
(- 1.0 (* 0.5 (pow (* (* (/ D d) (* M 0.5)) (sqrt (/ h l))) 2.0)))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(* d (sqrt (/ 1.0 (* l h))))))
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(((M * D) / (d * 2.0)), 2.0))))) <= ((double) INFINITY)) {
tmp = (1.0 - (0.5 * pow((((D / d) * (M * 0.5)) * sqrt((h / l))), 2.0))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = d * sqrt((1.0 / (l * h)));
}
return tmp;
}
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(((M * D) / (d * 2.0)), 2.0))))) <= Double.POSITIVE_INFINITY) {
tmp = (1.0 - (0.5 * Math.pow((((D / d) * (M * 0.5)) * Math.sqrt((h / l))), 2.0))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = d * Math.sqrt((1.0 / (l * h)));
}
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(((M * D) / (d * 2.0)), 2.0))))) <= math.inf: tmp = (1.0 - (0.5 * math.pow((((D / d) * (M * 0.5)) * math.sqrt((h / l))), 2.0))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = d * math.sqrt((1.0 / (l * h))) 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(M * D) / Float64(d * 2.0)) ^ 2.0))))) <= Inf) tmp = Float64(Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(D / d) * Float64(M * 0.5)) * sqrt(Float64(h / l))) ^ 2.0))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); 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 * (((M * D) / (d * 2.0)) ^ 2.0))))) <= Inf) tmp = (1.0 - (0.5 * ((((D / d) * (M * 0.5)) * sqrt((h / l))) ^ 2.0))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = d * sqrt((1.0 / (l * h))); 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[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(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] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $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{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right) \leq \infty:\\
\;\;\;\;\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) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < +inf.0Initial program 86.1%
Simplified85.6%
add-sqr-sqrt85.6%
pow285.6%
sqrt-prod85.6%
frac-times86.1%
*-commutative86.1%
frac-times85.2%
unpow285.2%
sqrt-prod55.9%
add-sqr-sqrt88.9%
div-inv88.9%
metadata-eval88.9%
Applied egg-rr88.9%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 0.0%
Simplified0.1%
Taylor expanded in d around inf 24.1%
Final simplification74.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ D d) (* M 0.5)))
(t_1 (sqrt (/ d h)))
(t_2 (sqrt (- d)))
(t_3 (sqrt (/ d l))))
(if (<= h -2.95e+223)
(*
(/ t_2 (sqrt (- h)))
(* (+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5))) t_3))
(if (<= h -2e-310)
(*
(* (/ t_2 (sqrt (- l))) t_1)
(- 1.0 (* 0.5 (/ (* h (pow t_0 2.0)) l))))
(if (<= h 3.5e+40)
(*
(* t_1 (/ (sqrt d) (sqrt l)))
(- 1.0 (* 0.5 (pow (* t_0 (sqrt (/ h l))) 2.0))))
(*
(* (/ (sqrt d) (sqrt h)) t_3)
(-
1.0
(* 0.5 (* (/ 1.0 l) (* h (pow (* M (* D (/ 0.5 d))) 2.0)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (D / d) * (M * 0.5);
double t_1 = sqrt((d / h));
double t_2 = sqrt(-d);
double t_3 = sqrt((d / l));
double tmp;
if (h <= -2.95e+223) {
tmp = (t_2 / sqrt(-h)) * ((1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_3);
} else if (h <= -2e-310) {
tmp = ((t_2 / sqrt(-l)) * t_1) * (1.0 - (0.5 * ((h * pow(t_0, 2.0)) / l)));
} else if (h <= 3.5e+40) {
tmp = (t_1 * (sqrt(d) / sqrt(l))) * (1.0 - (0.5 * pow((t_0 * sqrt((h / l))), 2.0)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_3) * (1.0 - (0.5 * ((1.0 / l) * (h * pow((M * (D * (0.5 / 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (d_1 / d) * (m * 0.5d0)
t_1 = sqrt((d / h))
t_2 = sqrt(-d)
t_3 = sqrt((d / l))
if (h <= (-2.95d+223)) then
tmp = (t_2 / sqrt(-h)) * ((1.0d0 + ((h / l) * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0)))) * t_3)
else if (h <= (-2d-310)) then
tmp = ((t_2 / sqrt(-l)) * t_1) * (1.0d0 - (0.5d0 * ((h * (t_0 ** 2.0d0)) / l)))
else if (h <= 3.5d+40) then
tmp = (t_1 * (sqrt(d) / sqrt(l))) * (1.0d0 - (0.5d0 * ((t_0 * sqrt((h / l))) ** 2.0d0)))
else
tmp = ((sqrt(d) / sqrt(h)) * t_3) * (1.0d0 - (0.5d0 * ((1.0d0 / l) * (h * ((m * (d_1 * (0.5d0 / d))) ** 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 = (D / d) * (M * 0.5);
double t_1 = Math.sqrt((d / h));
double t_2 = Math.sqrt(-d);
double t_3 = Math.sqrt((d / l));
double tmp;
if (h <= -2.95e+223) {
tmp = (t_2 / Math.sqrt(-h)) * ((1.0 + ((h / l) * (Math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_3);
} else if (h <= -2e-310) {
tmp = ((t_2 / Math.sqrt(-l)) * t_1) * (1.0 - (0.5 * ((h * Math.pow(t_0, 2.0)) / l)));
} else if (h <= 3.5e+40) {
tmp = (t_1 * (Math.sqrt(d) / Math.sqrt(l))) * (1.0 - (0.5 * Math.pow((t_0 * Math.sqrt((h / l))), 2.0)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * t_3) * (1.0 - (0.5 * ((1.0 / l) * (h * Math.pow((M * (D * (0.5 / d))), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (D / d) * (M * 0.5) t_1 = math.sqrt((d / h)) t_2 = math.sqrt(-d) t_3 = math.sqrt((d / l)) tmp = 0 if h <= -2.95e+223: tmp = (t_2 / math.sqrt(-h)) * ((1.0 + ((h / l) * (math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_3) elif h <= -2e-310: tmp = ((t_2 / math.sqrt(-l)) * t_1) * (1.0 - (0.5 * ((h * math.pow(t_0, 2.0)) / l))) elif h <= 3.5e+40: tmp = (t_1 * (math.sqrt(d) / math.sqrt(l))) * (1.0 - (0.5 * math.pow((t_0 * math.sqrt((h / l))), 2.0))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * t_3) * (1.0 - (0.5 * ((1.0 / l) * (h * math.pow((M * (D * (0.5 / d))), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(D / d) * Float64(M * 0.5)) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(-d)) t_3 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -2.95e+223) tmp = Float64(Float64(t_2 / sqrt(Float64(-h))) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))) * t_3)); elseif (h <= -2e-310) tmp = Float64(Float64(Float64(t_2 / sqrt(Float64(-l))) * t_1) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (t_0 ^ 2.0)) / l)))); elseif (h <= 3.5e+40) tmp = Float64(Float64(t_1 * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 - Float64(0.5 * (Float64(t_0 * sqrt(Float64(h / l))) ^ 2.0)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_3) * Float64(1.0 - Float64(0.5 * Float64(Float64(1.0 / l) * Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (D / d) * (M * 0.5); t_1 = sqrt((d / h)); t_2 = sqrt(-d); t_3 = sqrt((d / l)); tmp = 0.0; if (h <= -2.95e+223) tmp = (t_2 / sqrt(-h)) * ((1.0 + ((h / l) * ((((M / 2.0) * (D / d)) ^ 2.0) * -0.5))) * t_3); elseif (h <= -2e-310) tmp = ((t_2 / sqrt(-l)) * t_1) * (1.0 - (0.5 * ((h * (t_0 ^ 2.0)) / l))); elseif (h <= 3.5e+40) tmp = (t_1 * (sqrt(d) / sqrt(l))) * (1.0 - (0.5 * ((t_0 * sqrt((h / l))) ^ 2.0))); else tmp = ((sqrt(d) / sqrt(h)) * t_3) * (1.0 - (0.5 * ((1.0 / l) * (h * ((M * (D * (0.5 / d))) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -2.95e+223], N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.5e+40], N[(N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(t$95$0 * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{d} \cdot \left(M \cdot 0.5\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{-d}\\
t_3 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -2.95 \cdot 10^{+223}:\\
\;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot t_3\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t_2}{\sqrt{-\ell}} \cdot t_1\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {t_0}^{2}}{\ell}\right)\\
\mathbf{elif}\;h \leq 3.5 \cdot 10^{+40}:\\
\;\;\;\;\left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(t_0 \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t_3\right) \cdot \left(1 - 0.5 \cdot \left(\frac{1}{\ell} \cdot \left(h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < -2.95000000000000011e223Initial program 28.9%
Simplified28.9%
frac-2neg28.9%
sqrt-div71.8%
Applied egg-rr71.8%
if -2.95000000000000011e223 < h < -1.999999999999994e-310Initial program 79.5%
Simplified79.5%
associate-*r/81.6%
frac-times81.6%
*-commutative81.6%
frac-times80.7%
add-sqr-sqrt50.6%
add-sqr-sqrt80.7%
div-inv80.7%
metadata-eval80.7%
Applied egg-rr80.7%
frac-2neg80.3%
sqrt-div87.1%
Applied egg-rr88.5%
if -1.999999999999994e-310 < h < 3.4999999999999999e40Initial program 70.9%
Simplified71.0%
add-sqr-sqrt71.0%
pow271.0%
sqrt-prod71.0%
frac-times70.9%
*-commutative70.9%
frac-times69.7%
unpow269.7%
sqrt-prod51.5%
add-sqr-sqrt77.3%
div-inv77.3%
metadata-eval77.3%
Applied egg-rr77.3%
sqrt-div83.7%
div-inv83.6%
Applied egg-rr83.6%
associate-*r/83.7%
*-rgt-identity83.7%
Simplified83.7%
if 3.4999999999999999e40 < h Initial program 56.9%
Simplified55.1%
associate-*r/65.1%
clear-num65.1%
frac-times66.8%
*-commutative66.8%
frac-times66.7%
add-sqr-sqrt45.5%
add-sqr-sqrt66.7%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
associate-/r/66.7%
*-commutative66.7%
associate-*l*66.7%
Simplified66.7%
*-commutative66.7%
associate-*r*66.7%
expm1-log1p-u66.0%
expm1-udef60.4%
associate-*r*60.4%
*-commutative60.4%
associate-*r/60.4%
Applied egg-rr60.4%
expm1-def66.0%
expm1-log1p66.7%
associate-/l*66.7%
associate-/r/66.7%
Simplified66.7%
sqrt-div78.3%
div-inv78.3%
Applied egg-rr78.3%
associate-*r/78.3%
*-rgt-identity78.3%
Simplified78.3%
Final simplification83.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(t_1 (sqrt (- d)))
(t_2 (sqrt (/ d l))))
(if (<= h -4.6e+223)
(* t_0 (* (/ t_1 (sqrt (- h))) t_2))
(if (<= h -2e-310)
(* (* (/ t_1 (sqrt (- l))) (sqrt (/ d h))) t_0)
(*
(* (/ (sqrt d) (sqrt h)) t_2)
(-
1.0
(* 0.5 (* (/ 1.0 l) (* h (pow (* M (* D (/ 0.5 d))) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l));
double t_1 = sqrt(-d);
double t_2 = sqrt((d / l));
double tmp;
if (h <= -4.6e+223) {
tmp = t_0 * ((t_1 / sqrt(-h)) * t_2);
} else if (h <= -2e-310) {
tmp = ((t_1 / sqrt(-l)) * sqrt((d / h))) * t_0;
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_2) * (1.0 - (0.5 * ((1.0 / l) * (h * pow((M * (D * (0.5 / 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))
t_1 = sqrt(-d)
t_2 = sqrt((d / l))
if (h <= (-4.6d+223)) then
tmp = t_0 * ((t_1 / sqrt(-h)) * t_2)
else if (h <= (-2d-310)) then
tmp = ((t_1 / sqrt(-l)) * sqrt((d / h))) * t_0
else
tmp = ((sqrt(d) / sqrt(h)) * t_2) * (1.0d0 - (0.5d0 * ((1.0d0 / l) * (h * ((m * (d_1 * (0.5d0 / d))) ** 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 = 1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l));
double t_1 = Math.sqrt(-d);
double t_2 = Math.sqrt((d / l));
double tmp;
if (h <= -4.6e+223) {
tmp = t_0 * ((t_1 / Math.sqrt(-h)) * t_2);
} else if (h <= -2e-310) {
tmp = ((t_1 / Math.sqrt(-l)) * Math.sqrt((d / h))) * t_0;
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * t_2) * (1.0 - (0.5 * ((1.0 / l) * (h * Math.pow((M * (D * (0.5 / d))), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l)) t_1 = math.sqrt(-d) t_2 = math.sqrt((d / l)) tmp = 0 if h <= -4.6e+223: tmp = t_0 * ((t_1 / math.sqrt(-h)) * t_2) elif h <= -2e-310: tmp = ((t_1 / math.sqrt(-l)) * math.sqrt((d / h))) * t_0 else: tmp = ((math.sqrt(d) / math.sqrt(h)) * t_2) * (1.0 - (0.5 * ((1.0 / l) * (h * math.pow((M * (D * (0.5 / d))), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) t_1 = sqrt(Float64(-d)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -4.6e+223) tmp = Float64(t_0 * Float64(Float64(t_1 / sqrt(Float64(-h))) * t_2)); elseif (h <= -2e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * t_0); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_2) * Float64(1.0 - Float64(0.5 * Float64(Float64(1.0 / l) * Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l)); t_1 = sqrt(-d); t_2 = sqrt((d / l)); tmp = 0.0; if (h <= -4.6e+223) tmp = t_0 * ((t_1 / sqrt(-h)) * t_2); elseif (h <= -2e-310) tmp = ((t_1 / sqrt(-l)) * sqrt((d / h))) * t_0; else tmp = ((sqrt(d) / sqrt(h)) * t_2) * (1.0 - (0.5 * ((1.0 / l) * (h * ((M * (D * (0.5 / d))) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -4.6e+223], N[(t$95$0 * N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\\
t_1 := \sqrt{-d}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -4.6 \cdot 10^{+223}:\\
\;\;\;\;t_0 \cdot \left(\frac{t_1}{\sqrt{-h}} \cdot t_2\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t_1}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t_2\right) \cdot \left(1 - 0.5 \cdot \left(\frac{1}{\ell} \cdot \left(h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < -4.60000000000000009e223Initial program 30.3%
Simplified30.3%
associate-*r/30.4%
frac-times30.4%
*-commutative30.4%
frac-times30.4%
add-sqr-sqrt15.5%
add-sqr-sqrt30.4%
div-inv30.4%
metadata-eval30.4%
Applied egg-rr30.4%
frac-2neg30.3%
sqrt-div70.4%
Applied egg-rr60.3%
if -4.60000000000000009e223 < h < -1.999999999999994e-310Initial program 78.8%
Simplified78.8%
associate-*r/80.8%
frac-times80.8%
*-commutative80.8%
frac-times79.9%
add-sqr-sqrt50.1%
add-sqr-sqrt79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
frac-2neg80.5%
sqrt-div87.3%
Applied egg-rr87.7%
if -1.999999999999994e-310 < h Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
clear-num68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
associate-/r/68.3%
*-commutative68.3%
associate-*l*68.3%
Simplified68.3%
*-commutative68.3%
associate-*r*68.3%
expm1-log1p-u68.0%
expm1-udef65.4%
associate-*r*65.4%
*-commutative65.4%
associate-*r/65.4%
Applied egg-rr65.4%
expm1-def68.0%
expm1-log1p68.3%
associate-/l*68.3%
associate-/r/68.3%
Simplified68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification79.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))) (t_1 (sqrt (/ d l))))
(if (<= h -3.8e+222)
(*
(/ t_0 (sqrt (- h)))
(* (+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5))) t_1))
(if (<= h -2e-310)
(*
(* (/ t_0 (sqrt (- l))) (sqrt (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(*
(* (/ (sqrt d) (sqrt h)) t_1)
(-
1.0
(* 0.5 (* (/ 1.0 l) (* h (pow (* M (* D (/ 0.5 d))) 2.0))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = sqrt((d / l));
double tmp;
if (h <= -3.8e+222) {
tmp = (t_0 / sqrt(-h)) * ((1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_1);
} else if (h <= -2e-310) {
tmp = ((t_0 / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0 - (0.5 * ((1.0 / l) * (h * pow((M * (D * (0.5 / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(-d)
t_1 = sqrt((d / l))
if (h <= (-3.8d+222)) then
tmp = (t_0 / sqrt(-h)) * ((1.0d0 + ((h / l) * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0)))) * t_1)
else if (h <= (-2d-310)) then
tmp = ((t_0 / sqrt(-l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0d0 - (0.5d0 * ((1.0d0 / l) * (h * ((m * (d_1 * (0.5d0 / d))) ** 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 t_1 = Math.sqrt((d / l));
double tmp;
if (h <= -3.8e+222) {
tmp = (t_0 / Math.sqrt(-h)) * ((1.0 + ((h / l) * (Math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_1);
} else if (h <= -2e-310) {
tmp = ((t_0 / Math.sqrt(-l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * t_1) * (1.0 - (0.5 * ((1.0 / l) * (h * Math.pow((M * (D * (0.5 / d))), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = math.sqrt((d / l)) tmp = 0 if h <= -3.8e+222: tmp = (t_0 / math.sqrt(-h)) * ((1.0 + ((h / l) * (math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))) * t_1) elif h <= -2e-310: tmp = ((t_0 / math.sqrt(-l)) * math.sqrt((d / h))) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * t_1) * (1.0 - (0.5 * ((1.0 / l) * (h * math.pow((M * (D * (0.5 / d))), 2.0))))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -3.8e+222) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))) * t_1)); elseif (h <= -2e-310) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * Float64(1.0 - Float64(0.5 * Float64(Float64(1.0 / l) * Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = sqrt((d / l)); tmp = 0.0; if (h <= -3.8e+222) tmp = (t_0 / sqrt(-h)) * ((1.0 + ((h / l) * ((((M / 2.0) * (D / d)) ^ 2.0) * -0.5))) * t_1); elseif (h <= -2e-310) tmp = ((t_0 / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); else tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0 - (0.5 * ((1.0 / l) * (h * ((M * (D * (0.5 / d))) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -3.8e+222], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $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[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -3.8 \cdot 10^{+222}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot -0.5\right)\right) \cdot t_1\right)\\
\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t_0}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\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}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t_1\right) \cdot \left(1 - 0.5 \cdot \left(\frac{1}{\ell} \cdot \left(h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if h < -3.80000000000000018e222Initial program 28.9%
Simplified28.9%
frac-2neg28.9%
sqrt-div71.8%
Applied egg-rr71.8%
if -3.80000000000000018e222 < h < -1.999999999999994e-310Initial program 79.5%
Simplified79.5%
associate-*r/81.6%
frac-times81.6%
*-commutative81.6%
frac-times80.7%
add-sqr-sqrt50.6%
add-sqr-sqrt80.7%
div-inv80.7%
metadata-eval80.7%
Applied egg-rr80.7%
frac-2neg80.3%
sqrt-div87.1%
Applied egg-rr88.5%
if -1.999999999999994e-310 < h Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
clear-num68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
associate-/r/68.3%
*-commutative68.3%
associate-*l*68.3%
Simplified68.3%
*-commutative68.3%
associate-*r*68.3%
expm1-log1p-u68.0%
expm1-udef65.4%
associate-*r*65.4%
*-commutative65.4%
associate-*r/65.4%
Applied egg-rr65.4%
expm1-def68.0%
expm1-log1p68.3%
associate-/l*68.3%
associate-/r/68.3%
Simplified68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification80.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h)))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / 2.0d0) * (m / d)) ** 2.0d0))))
else
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h))) * (1.0 - (0.5 * ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0))))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-310) tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0)))); else tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\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)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 71.0%
Simplified71.0%
frac-2neg78.9%
sqrt-div85.3%
Applied egg-rr76.8%
if -1.999999999999994e-310 < l Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification76.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l)))))
(if (<= l -2e-310)
(* (* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h))) t_0)
(* (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l))) t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l));
double tmp;
if (l <= -2e-310) {
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * t_0;
} else {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / 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 = 1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l))
if (l <= (-2d-310)) then
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * t_0
else
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / 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 = 1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l));
double tmp;
if (l <= -2e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h))) * t_0;
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l)) tmp = 0 if l <= -2e-310: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h))) * t_0 else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l))) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * t_0); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l)); tmp = 0.0; if (l <= -2e-310) tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * t_0; else tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[l, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t_0\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 71.0%
Simplified71.0%
associate-*r/72.7%
frac-times72.7%
*-commutative72.7%
frac-times72.0%
add-sqr-sqrt44.6%
add-sqr-sqrt72.0%
div-inv72.0%
metadata-eval72.0%
Applied egg-rr72.0%
frac-2neg78.9%
sqrt-div85.3%
Applied egg-rr80.0%
if -1.999999999999994e-310 < l Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification77.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(+ 1.0 (* 0.5 (* (* h (pow (* M (* (/ D d) 0.5)) 2.0)) (/ -1.0 l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 + (0.5 * ((h * pow((M * ((D / d) * 0.5)), 2.0)) * (-1.0 / l))));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2d-310)) then
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 + (0.5d0 * ((h * ((m * ((d_1 / d) * 0.5d0)) ** 2.0d0)) * ((-1.0d0) / l))))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 + (0.5 * ((h * Math.pow((M * ((D / d) * 0.5)), 2.0)) * (-1.0 / l))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h))) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 + (0.5 * ((h * math.pow((M * ((D / d) * 0.5)), 2.0)) * (-1.0 / l)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 + Float64(0.5 * Float64(Float64(h * (Float64(M * Float64(Float64(D / d) * 0.5)) ^ 2.0)) * Float64(-1.0 / l))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-310) tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); else tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 + (0.5 * ((h * ((M * ((D / d) * 0.5)) ^ 2.0)) * (-1.0 / l)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $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[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(N[(h * N[Power[N[(M * N[(N[(D / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\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}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + 0.5 \cdot \left(\left(h \cdot {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2}\right) \cdot \frac{-1}{\ell}\right)\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 71.0%
Simplified71.0%
associate-*r/72.7%
frac-times72.7%
*-commutative72.7%
frac-times72.0%
add-sqr-sqrt44.6%
add-sqr-sqrt72.0%
div-inv72.0%
metadata-eval72.0%
Applied egg-rr72.0%
frac-2neg78.9%
sqrt-div85.3%
Applied egg-rr80.0%
if -1.999999999999994e-310 < l Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
clear-num68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
associate-/r/68.3%
*-commutative68.3%
associate-*l*68.3%
Simplified68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification77.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2e-310)
(*
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h)))
(- 1.0 (* 0.5 (/ (* h (pow (* (/ D d) (* M 0.5)) 2.0)) l))))
(*
(* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (* (/ 1.0 l) (* h (pow (* M (* D (/ 0.5 d))) 2.0))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2e-310) {
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * pow((M * (D * (0.5 / 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-310)) then
tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0d0 - (0.5d0 * ((h * (((d_1 / d) * (m * 0.5d0)) ** 2.0d0)) / l)))
else
tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((1.0d0 / l) * (h * ((m * (d_1 * (0.5d0 / 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-310) {
tmp = ((Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h))) * (1.0 - (0.5 * ((h * Math.pow(((D / d) * (M * 0.5)), 2.0)) / l)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * Math.pow((M * (D * (0.5 / d))), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2e-310: tmp = ((math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h))) * (1.0 - (0.5 * ((h * math.pow(((D / d) * (M * 0.5)), 2.0)) / l))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * math.pow((M * (D * (0.5 / d))), 2.0))))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0)) / l)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(1.0 / l) * Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)))))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2e-310) tmp = ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))) * (1.0 - (0.5 * ((h * (((D / d) * (M * 0.5)) ^ 2.0)) / l))); else tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - (0.5 * ((1.0 / l) * (h * ((M * (D * (0.5 / d))) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $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[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(1.0 / l), $MachinePrecision] * N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\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}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{1}{\ell} \cdot \left(h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 71.0%
Simplified71.0%
associate-*r/72.7%
frac-times72.7%
*-commutative72.7%
frac-times72.0%
add-sqr-sqrt44.6%
add-sqr-sqrt72.0%
div-inv72.0%
metadata-eval72.0%
Applied egg-rr72.0%
frac-2neg78.9%
sqrt-div85.3%
Applied egg-rr80.0%
if -1.999999999999994e-310 < l Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
clear-num68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
associate-/r/68.3%
*-commutative68.3%
associate-*l*68.3%
Simplified68.3%
*-commutative68.3%
associate-*r*68.3%
expm1-log1p-u68.0%
expm1-udef65.4%
associate-*r*65.4%
*-commutative65.4%
associate-*r/65.4%
Applied egg-rr65.4%
expm1-def68.0%
expm1-log1p68.3%
associate-/l*68.3%
associate-/r/68.3%
Simplified68.3%
sqrt-div75.8%
div-inv75.8%
Applied egg-rr75.8%
associate-*r/75.8%
*-rgt-identity75.8%
Simplified75.8%
Final simplification77.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ D d) (* M 0.5))) (t_1 (sqrt (/ d l))))
(if (<= h 1.7e+44)
(*
(- 1.0 (* 0.5 (pow (* t_0 (sqrt (/ h l))) 2.0)))
(* t_1 (sqrt (/ d h))))
(*
(* (/ (sqrt d) (sqrt h)) t_1)
(- 1.0 (* 0.5 (/ (* h (pow t_0 2.0)) l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (D / d) * (M * 0.5);
double t_1 = sqrt((d / l));
double tmp;
if (h <= 1.7e+44) {
tmp = (1.0 - (0.5 * pow((t_0 * sqrt((h / l))), 2.0))) * (t_1 * sqrt((d / h)));
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0 - (0.5 * ((h * pow(t_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) :: t_1
real(8) :: tmp
t_0 = (d_1 / d) * (m * 0.5d0)
t_1 = sqrt((d / l))
if (h <= 1.7d+44) then
tmp = (1.0d0 - (0.5d0 * ((t_0 * sqrt((h / l))) ** 2.0d0))) * (t_1 * sqrt((d / h)))
else
tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0d0 - (0.5d0 * ((h * (t_0 ** 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 = (D / d) * (M * 0.5);
double t_1 = Math.sqrt((d / l));
double tmp;
if (h <= 1.7e+44) {
tmp = (1.0 - (0.5 * Math.pow((t_0 * Math.sqrt((h / l))), 2.0))) * (t_1 * Math.sqrt((d / h)));
} else {
tmp = ((Math.sqrt(d) / Math.sqrt(h)) * t_1) * (1.0 - (0.5 * ((h * Math.pow(t_0, 2.0)) / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (D / d) * (M * 0.5) t_1 = math.sqrt((d / l)) tmp = 0 if h <= 1.7e+44: tmp = (1.0 - (0.5 * math.pow((t_0 * math.sqrt((h / l))), 2.0))) * (t_1 * math.sqrt((d / h))) else: tmp = ((math.sqrt(d) / math.sqrt(h)) * t_1) * (1.0 - (0.5 * ((h * math.pow(t_0, 2.0)) / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(D / d) * Float64(M * 0.5)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= 1.7e+44) tmp = Float64(Float64(1.0 - Float64(0.5 * (Float64(t_0 * sqrt(Float64(h / l))) ^ 2.0))) * Float64(t_1 * sqrt(Float64(d / h)))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (t_0 ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (D / d) * (M * 0.5); t_1 = sqrt((d / l)); tmp = 0.0; if (h <= 1.7e+44) tmp = (1.0 - (0.5 * ((t_0 * sqrt((h / l))) ^ 2.0))) * (t_1 * sqrt((d / h))); else tmp = ((sqrt(d) / sqrt(h)) * t_1) * (1.0 - (0.5 * ((h * (t_0 ^ 2.0)) / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, 1.7e+44], N[(N[(1.0 - N[(0.5 * N[Power[N[(t$95$0 * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{d} \cdot \left(M \cdot 0.5\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq 1.7 \cdot 10^{+44}:\\
\;\;\;\;\left(1 - 0.5 \cdot {\left(t_0 \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \cdot \left(t_1 \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t_1\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {t_0}^{2}}{\ell}\right)\\
\end{array}
\end{array}
if h < 1.7e44Initial program 71.1%
Simplified71.1%
add-sqr-sqrt71.1%
pow271.1%
sqrt-prod71.1%
frac-times71.1%
*-commutative71.1%
frac-times70.2%
unpow270.2%
sqrt-prod47.2%
add-sqr-sqrt74.4%
div-inv74.4%
metadata-eval74.4%
Applied egg-rr74.4%
if 1.7e44 < h Initial program 56.2%
Simplified54.4%
associate-*r/64.5%
frac-times66.3%
*-commutative66.3%
frac-times66.1%
add-sqr-sqrt44.7%
add-sqr-sqrt66.1%
div-inv66.1%
metadata-eval66.1%
Applied egg-rr66.1%
sqrt-div78.0%
div-inv78.0%
Applied egg-rr77.9%
associate-*r/78.0%
*-rgt-identity78.0%
Simplified77.9%
Final simplification75.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l 5e-307)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* h (/ -0.5 (/ l (pow (* D (/ M (* d 2.0))) 2.0)))))))
(*
(+ 1.0 (* (pow (* M (* (/ D d) 0.5)) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5e-307) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + (h * (-0.5 / (l / pow((D * (M / (d * 2.0))), 2.0))))));
} else {
tmp = (1.0 + (pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 5d-307) then
tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 + (h * ((-0.5d0) / (l / ((d_1 * (m / (d * 2.0d0))) ** 2.0d0))))))
else
tmp = (1.0d0 + (((m * ((d_1 / d) * 0.5d0)) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(h) * sqrt(l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 5e-307) {
tmp = Math.sqrt((d / h)) * (Math.sqrt((d / l)) * (1.0 + (h * (-0.5 / (l / Math.pow((D * (M / (d * 2.0))), 2.0))))));
} else {
tmp = (1.0 + (Math.pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 5e-307: tmp = math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 + (h * (-0.5 / (l / math.pow((D * (M / (d * 2.0))), 2.0)))))) else: tmp = (1.0 + (math.pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 5e-307) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(h * Float64(-0.5 / Float64(l / (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0))))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(Float64(D / d) * 0.5)) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 5e-307) tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + (h * (-0.5 / (l / ((D * (M / (d * 2.0))) ^ 2.0)))))); else tmp = (1.0 + (((M * ((D / d) * 0.5)) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 5e-307], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(-0.5 / N[(l / N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(N[(D / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5 \cdot 10^{-307}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + h \cdot \frac{-0.5}{\frac{\ell}{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 5.00000000000000014e-307Initial program 70.5%
Simplified69.7%
*-commutative69.7%
clear-num69.7%
un-div-inv69.7%
*-commutative69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
associate-/r/72.4%
*-commutative72.4%
associate-/l*72.3%
associate-*r/72.4%
associate-/l*72.3%
associate-/l*72.3%
metadata-eval72.3%
associate-/l*72.3%
associate-*l/72.3%
/-rgt-identity72.3%
associate-/r/72.4%
associate-/r*72.4%
*-commutative72.4%
associate-/l/72.4%
Simplified72.4%
if 5.00000000000000014e-307 < l Initial program 64.9%
Simplified64.1%
Applied egg-rr64.4%
distribute-rgt1-in73.6%
+-commutative73.6%
associate-*l*73.6%
Simplified73.6%
Final simplification73.0%
(FPCore (d h l M D)
:precision binary64
(if (<= d -8.8e-284)
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (/ (pow (* M (/ (* D 0.5) d)) 2.0) (/ l h)))))
(*
(+ 1.0 (* (pow (* M (* (/ D d) 0.5)) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.8e-284) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (pow((M * ((D * 0.5) / d)), 2.0) / (l / h))));
} else {
tmp = (1.0 + (pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-8.8d-284)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (((m * ((d_1 * 0.5d0) / d)) ** 2.0d0) / (l / h))))
else
tmp = (1.0d0 + (((m * ((d_1 / d) * 0.5d0)) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(h) * sqrt(l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -8.8e-284) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (Math.pow((M * ((D * 0.5) / d)), 2.0) / (l / h))));
} else {
tmp = (1.0 + (Math.pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -8.8e-284: tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (math.pow((M * ((D * 0.5) / d)), 2.0) / (l / h)))) else: tmp = (1.0 + (math.pow((M * ((D / d) * 0.5)), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -8.8e-284) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64((Float64(M * Float64(Float64(D * 0.5) / d)) ^ 2.0) / Float64(l / h))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(Float64(D / d) * 0.5)) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -8.8e-284) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (((M * ((D * 0.5) / d)) ^ 2.0) / (l / h)))); else tmp = (1.0 + (((M * ((D / d) * 0.5)) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -8.8e-284], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[Power[N[(M * N[(N[(D * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(N[(D / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -8.8 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \frac{{\left(M \cdot \frac{D \cdot 0.5}{d}\right)}^{2}}{\frac{\ell}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -8.8000000000000002e-284Initial program 71.7%
Simplified71.7%
associate-*r/73.5%
clear-num73.5%
frac-times73.5%
*-commutative73.5%
frac-times72.7%
add-sqr-sqrt45.2%
add-sqr-sqrt72.7%
div-inv72.7%
metadata-eval72.7%
Applied egg-rr72.7%
associate-/r/72.7%
*-commutative72.7%
associate-*l*72.7%
Simplified72.7%
Applied egg-rr18.2%
expm1-def31.2%
expm1-log1p61.5%
*-commutative61.5%
*-commutative61.5%
Simplified61.5%
if -8.8000000000000002e-284 < d Initial program 64.0%
Simplified63.2%
Applied egg-rr62.0%
distribute-rgt1-in70.9%
+-commutative70.9%
associate-*l*70.9%
Simplified70.9%
Final simplification66.4%
(FPCore (d h l M D)
:precision binary64
(if (or (<= d 1.35e-42) (and (not (<= d 5.9e+80)) (<= d 1.35e+197)))
(*
(sqrt (* (/ d l) (/ d h)))
(+ 1.0 (* -0.5 (/ (pow (* M (/ (* D 0.5) d)) 2.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 ((d <= 1.35e-42) || (!(d <= 5.9e+80) && (d <= 1.35e+197))) {
tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (pow((M * ((D * 0.5) / d)), 2.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 ((d <= 1.35d-42) .or. (.not. (d <= 5.9d+80)) .and. (d <= 1.35d+197)) then
tmp = sqrt(((d / l) * (d / h))) * (1.0d0 + ((-0.5d0) * (((m * ((d_1 * 0.5d0) / d)) ** 2.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 ((d <= 1.35e-42) || (!(d <= 5.9e+80) && (d <= 1.35e+197))) {
tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (Math.pow((M * ((D * 0.5) / d)), 2.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 (d <= 1.35e-42) or (not (d <= 5.9e+80) and (d <= 1.35e+197)): tmp = math.sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (math.pow((M * ((D * 0.5) / d)), 2.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 ((d <= 1.35e-42) || (!(d <= 5.9e+80) && (d <= 1.35e+197))) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 + Float64(-0.5 * Float64((Float64(M * Float64(Float64(D * 0.5) / d)) ^ 2.0) / Float64(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 ((d <= 1.35e-42) || (~((d <= 5.9e+80)) && (d <= 1.35e+197))) tmp = sqrt(((d / l) * (d / h))) * (1.0 + (-0.5 * (((M * ((D * 0.5) / d)) ^ 2.0) / (l / h)))); else tmp = d * ((l ^ -0.5) * (h ^ -0.5)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[Or[LessEqual[d, 1.35e-42], And[N[Not[LessEqual[d, 5.9e+80]], $MachinePrecision], LessEqual[d, 1.35e+197]]], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[Power[N[(M * N[(N[(D * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $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}\;d \leq 1.35 \cdot 10^{-42} \lor \neg \left(d \leq 5.9 \cdot 10^{+80}\right) \land d \leq 1.35 \cdot 10^{+197}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \frac{{\left(M \cdot \frac{D \cdot 0.5}{d}\right)}^{2}}{\frac{\ell}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if d < 1.35e-42 or 5.89999999999999973e80 < d < 1.35e197Initial program 67.4%
Simplified67.4%
associate-*r/69.8%
clear-num69.8%
frac-times69.8%
*-commutative69.8%
frac-times68.9%
add-sqr-sqrt43.3%
add-sqr-sqrt68.9%
div-inv68.9%
metadata-eval68.9%
Applied egg-rr68.9%
associate-/r/68.9%
*-commutative68.9%
associate-*l*68.9%
Simplified68.9%
Applied egg-rr15.5%
expm1-def26.1%
expm1-log1p54.5%
*-commutative54.5%
*-commutative54.5%
Simplified54.5%
if 1.35e-42 < d < 5.89999999999999973e80 or 1.35e197 < d Initial program 68.6%
Simplified66.6%
associate-*r/73.3%
clear-num73.3%
frac-times75.3%
*-commutative75.3%
frac-times75.4%
add-sqr-sqrt54.4%
add-sqr-sqrt75.4%
div-inv75.4%
metadata-eval75.4%
Applied egg-rr75.4%
associate-/r/75.4%
*-commutative75.4%
associate-*l*75.4%
Simplified75.4%
Taylor expanded in d around inf 67.3%
unpow-167.3%
metadata-eval67.3%
pow-sqr67.3%
rem-sqrt-square67.3%
rem-square-sqrt67.1%
fabs-sqr67.1%
rem-square-sqrt67.3%
Simplified67.3%
*-commutative67.3%
unpow-prod-down76.9%
Applied egg-rr76.9%
Final simplification58.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.65e-135)
(* (- d) (pow (* l h) -0.5))
(if (<= l 6e-308)
(* d (cbrt (pow (* l h) -1.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 (l <= -2.65e-135) {
tmp = -d * pow((l * h), -0.5);
} else if (l <= 6e-308) {
tmp = d * cbrt(pow((l * h), -1.5));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.65e-135) {
tmp = -d * Math.pow((l * h), -0.5);
} else if (l <= 6e-308) {
tmp = d * Math.cbrt(Math.pow((l * h), -1.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 (l <= -2.65e-135) tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5)); elseif (l <= 6e-308) tmp = Float64(d * cbrt((Float64(l * h) ^ -1.5))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.65e-135], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e-308], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $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^{-135}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{-308}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\ell \cdot h\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.65e-135Initial program 72.0%
Simplified72.0%
add-sqr-sqrt72.0%
pow272.0%
sqrt-prod72.0%
frac-times72.0%
*-commutative72.0%
frac-times70.8%
unpow270.8%
sqrt-prod44.1%
add-sqr-sqrt74.5%
div-inv74.5%
metadata-eval74.5%
Applied egg-rr74.5%
clear-num73.2%
sqrt-div73.2%
metadata-eval73.2%
Applied egg-rr73.2%
Taylor expanded in d around -inf 53.1%
mul-1-neg53.1%
*-commutative53.1%
distribute-rgt-neg-in53.1%
unpow-153.1%
metadata-eval53.1%
pow-sqr53.2%
rem-sqrt-square53.2%
rem-square-sqrt53.0%
fabs-sqr53.0%
rem-square-sqrt53.2%
Simplified53.2%
if -2.65e-135 < l < 6.00000000000000044e-308Initial program 69.2%
Simplified69.2%
associate-*r/74.0%
clear-num74.0%
frac-times74.1%
*-commutative74.1%
frac-times74.1%
add-sqr-sqrt45.2%
add-sqr-sqrt74.1%
div-inv74.1%
metadata-eval74.1%
Applied egg-rr74.1%
associate-/r/74.1%
*-commutative74.1%
associate-*l*74.1%
Simplified74.1%
Taylor expanded in d around inf 24.4%
unpow-124.4%
metadata-eval24.4%
pow-sqr24.4%
rem-sqrt-square22.3%
rem-square-sqrt22.3%
fabs-sqr22.3%
rem-square-sqrt22.3%
Simplified22.3%
add-cbrt-cube32.9%
pow332.9%
pow-pow32.9%
metadata-eval32.9%
Applied egg-rr32.9%
if 6.00000000000000044e-308 < l Initial program 64.4%
Simplified63.6%
associate-*r/68.2%
clear-num68.2%
frac-times69.0%
*-commutative69.0%
frac-times68.3%
add-sqr-sqrt46.1%
add-sqr-sqrt68.3%
div-inv68.3%
metadata-eval68.3%
Applied egg-rr68.3%
associate-/r/68.3%
*-commutative68.3%
associate-*l*68.3%
Simplified68.3%
Taylor expanded in d around inf 44.6%
unpow-144.6%
metadata-eval44.6%
pow-sqr44.6%
rem-sqrt-square44.6%
rem-square-sqrt44.4%
fabs-sqr44.4%
rem-square-sqrt44.6%
Simplified44.6%
*-commutative44.6%
unpow-prod-down50.3%
Applied egg-rr50.3%
Final simplification48.1%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (pow (* l h) -0.5))) (if (<= d -1.9e-270) (* (- 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 <= -1.9e-270) {
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 <= (-1.9d-270)) 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 <= -1.9e-270) {
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 <= -1.9e-270: 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 <= -1.9e-270) 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 <= -1.9e-270) 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, -1.9e-270], 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 -1.9 \cdot 10^{-270}:\\
\;\;\;\;\left(-d\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t_0\\
\end{array}
\end{array}
if d < -1.90000000000000021e-270Initial program 71.5%
Simplified71.5%
add-sqr-sqrt71.4%
pow271.4%
sqrt-prod71.4%
frac-times71.4%
*-commutative71.4%
frac-times70.7%
unpow270.7%
sqrt-prod44.6%
add-sqr-sqrt73.2%
div-inv73.2%
metadata-eval73.2%
Applied egg-rr73.2%
clear-num72.3%
sqrt-div72.3%
metadata-eval72.3%
Applied egg-rr72.3%
Taylor expanded in d around -inf 43.9%
mul-1-neg43.9%
*-commutative43.9%
distribute-rgt-neg-in43.9%
unpow-143.9%
metadata-eval43.9%
pow-sqr43.9%
rem-sqrt-square43.9%
rem-square-sqrt43.8%
fabs-sqr43.8%
rem-square-sqrt43.9%
Simplified43.9%
if -1.90000000000000021e-270 < d Initial program 64.2%
Simplified63.5%
associate-*r/67.9%
clear-num67.9%
frac-times68.7%
*-commutative68.7%
frac-times68.0%
add-sqr-sqrt45.9%
add-sqr-sqrt68.0%
div-inv68.0%
metadata-eval68.0%
Applied egg-rr68.0%
associate-/r/68.0%
*-commutative68.0%
associate-*l*68.0%
Simplified68.0%
Taylor expanded in d around inf 43.7%
unpow-143.7%
metadata-eval43.7%
pow-sqr43.8%
rem-sqrt-square43.8%
rem-square-sqrt43.6%
fabs-sqr43.6%
rem-square-sqrt43.8%
Simplified43.8%
Final simplification43.8%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* l h)))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.0 / (l * h)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt((1.0d0 / (l * h)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (l * h)));
}
def code(d, h, l, M, D): return d * math.sqrt((1.0 / (l * h)))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt((1.0 / (l * h))); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Initial program 67.6%
Simplified67.2%
Taylor expanded in d around inf 29.9%
Final simplification29.9%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 l) h))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt(((1.0 / l) / h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d * sqrt(((1.0d0 / l) / h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt(((1.0 / l) / h));
}
def code(d, h, l, M, D): return d * math.sqrt(((1.0 / l) / h))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt(((1.0 / l) / h)); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\end{array}
Initial program 67.6%
Simplified67.2%
Taylor expanded in d around inf 29.9%
*-commutative29.9%
associate-/r*29.9%
Simplified29.9%
Final simplification29.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 67.6%
Simplified67.2%
associate-*r/70.4%
clear-num70.4%
frac-times70.8%
*-commutative70.8%
frac-times70.1%
add-sqr-sqrt45.3%
add-sqr-sqrt70.1%
div-inv70.1%
metadata-eval70.1%
Applied egg-rr70.1%
associate-/r/70.1%
*-commutative70.1%
associate-*l*70.1%
Simplified70.1%
Taylor expanded in d around inf 29.9%
unpow-129.9%
metadata-eval29.9%
pow-sqr29.9%
rem-sqrt-square29.5%
rem-square-sqrt29.4%
fabs-sqr29.4%
rem-square-sqrt29.5%
Simplified29.5%
Final simplification29.5%
herbie shell --seed 2023322
(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)))))