
(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 20 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
(if (<= l -4e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (/ (* (* h (pow (/ (* (* M 0.5) D) d) 2.0)) -0.5) l))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + (((h * pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l)));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-4d-310)) then
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0d0 + (((h * ((((m * 0.5d0) * d_1) / d) ** 2.0d0)) * (-0.5d0)) / l)))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -4e-310) {
tmp = Math.sqrt((d / l)) * ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + (((h * Math.pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l)));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4e-310: tmp = math.sqrt((d / l)) * ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + (((h * math.pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(Float64(h * (Float64(Float64(Float64(M * 0.5) * D) / d) ^ 2.0)) * -0.5) / l)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -4e-310) tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + (((h * ((((M * 0.5) * D) / d) ^ 2.0)) * -0.5) / l))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(h * N[Power[N[(N[(N[(M * 0.5), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{\left(h \cdot {\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d}\right)}^{2}\right) \cdot -0.5}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 63.9%
Simplified64.4%
associate-*r*64.4%
*-commutative64.4%
associate-*r/67.6%
associate-*l/67.6%
div-inv67.6%
associate-*l*67.6%
metadata-eval67.6%
Applied egg-rr67.6%
associate-*r*67.6%
metadata-eval67.6%
div-inv67.6%
associate-*r/67.1%
div-inv67.1%
metadata-eval67.1%
Applied egg-rr67.1%
frac-2neg67.1%
sqrt-div79.6%
Applied egg-rr79.6%
if -3.999999999999988e-310 < l Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
+-commutative85.6%
associate-*l/88.2%
associate-/l*89.8%
associate-*r/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification84.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-4d-310)) then
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -4e-310) {
tmp = Math.sqrt((d / l)) * ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4e-310: tmp = math.sqrt((d / l)) * ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0))))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -4e-310) tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0))))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-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[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \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}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 63.9%
Simplified64.4%
frac-2neg67.1%
sqrt-div79.6%
Applied egg-rr75.6%
if -3.999999999999988e-310 < l Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
+-commutative85.6%
associate-*l/88.2%
associate-/l*89.8%
associate-*r/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification82.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (/ (* -0.5 (* h (pow (* M (* 0.5 (/ D d))) 2.0))) l))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((-0.5 * (h * pow((M * (0.5 * (D / d))), 2.0))) / l)));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-4d-310)) then
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0d0 + (((-0.5d0) * (h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))) / l)))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -4e-310) {
tmp = Math.sqrt((d / l)) * ((Math.sqrt(-d) / Math.sqrt(-h)) * (1.0 + ((-0.5 * (h * Math.pow((M * (0.5 * (D / d))), 2.0))) / l)));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4e-310: tmp = math.sqrt((d / l)) * ((math.sqrt(-d) / math.sqrt(-h)) * (1.0 + ((-0.5 * (h * math.pow((M * (0.5 * (D / d))), 2.0))) / l))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4e-310) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(-0.5 * Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))) / l)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -4e-310) tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((-0.5 * (h * ((M * (0.5 * (D / d))) ^ 2.0))) / l))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4e-310], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(-0.5 * N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + \frac{-0.5 \cdot \left(h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 63.9%
Simplified64.4%
associate-*r*64.4%
*-commutative64.4%
associate-*r/67.6%
associate-*l/67.6%
div-inv67.6%
associate-*l*67.6%
metadata-eval67.6%
Applied egg-rr67.6%
frac-2neg67.1%
sqrt-div79.6%
Applied egg-rr80.1%
if -3.999999999999988e-310 < l Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
+-commutative85.6%
associate-*l/88.2%
associate-/l*89.8%
associate-*r/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification84.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.15e+208)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1.9e-243)
(*
(sqrt (* (/ d l) (/ d h)))
(fma (* h (pow (* (* M 0.5) (/ D d)) 2.0)) (/ -0.5 l) 1.0))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ -1.0 (* l (/ -1.0 (/ -1.0 h))))))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.15e+208) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1.9e-243) {
tmp = sqrt(((d / l) * (d / h))) * fma((h * pow(((M * 0.5) * (D / d)), 2.0)), (-0.5 / l), 1.0);
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p((-1.0 + (l * (-1.0 / (-1.0 / h)))))));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (sqrt(h) * sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.15e+208) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1.9e-243) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * fma(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)), Float64(-0.5 / l), 1.0)); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(-1.0 + Float64(l * Float64(-1.0 / Float64(-1.0 / h)))))))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * Float64(d / Float64(sqrt(h) * sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.15e+208], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.9e-243], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(-1.0 + N[(l * N[(-1.0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -2.15 \cdot 10^{+208}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1.9 \cdot 10^{-243}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \mathsf{fma}\left(h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}, \frac{-0.5}{\ell}, 1\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(-1 + \ell \cdot \frac{-1}{\frac{-1}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.15000000000000021e208Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -2.15000000000000021e208 < d < -1.8999999999999999e-243Initial program 70.3%
Simplified70.0%
associate-*r*70.0%
*-commutative70.0%
associate-*r/72.2%
associate-*l/72.2%
div-inv72.2%
associate-*l*72.2%
metadata-eval72.2%
Applied egg-rr72.2%
associate-*r*72.2%
metadata-eval72.2%
div-inv72.2%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
pow172.6%
associate-*r*72.5%
pow1/272.5%
pow1/272.5%
pow-prod-down59.6%
+-commutative59.6%
associate-/l*59.6%
fma-define59.6%
*-commutative59.6%
associate-/l*59.3%
Applied egg-rr59.3%
unpow159.3%
unpow1/259.3%
Simplified59.3%
if -1.8999999999999999e-243 < d < -4.999999999999985e-310Initial program 47.2%
Taylor expanded in d around inf 8.6%
expm1-log1p-u8.6%
expm1-undefine8.6%
inv-pow8.6%
sqrt-pow18.6%
metadata-eval8.6%
Applied egg-rr8.6%
Taylor expanded in h around -inf 2.1%
log1p-expm1-u54.6%
expm1-undefine54.6%
exp-sum54.6%
add-exp-log54.6%
mul-1-neg54.6%
mul-1-neg54.6%
exp-neg54.6%
add-exp-log54.6%
Applied egg-rr54.6%
if -4.999999999999985e-310 < d Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
+-commutative85.6%
associate-*l/88.2%
associate-/l*89.8%
associate-*r/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification75.5%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.85e+208)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -2.5e-243)
(*
(sqrt (* d (/ (/ d h) l)))
(fma (* h (pow (* D (* 0.5 (/ M d))) 2.0)) (/ -0.5 l) 1.0))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ -1.0 (* l (/ -1.0 (/ -1.0 h))))))))
(*
d
(/
(fma h (* (/ -0.5 l) (pow (* 0.5 (* D (/ M d))) 2.0)) 1.0)
(sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.85e+208) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -2.5e-243) {
tmp = sqrt((d * ((d / h) / l))) * fma((h * pow((D * (0.5 * (M / d))), 2.0)), (-0.5 / l), 1.0);
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p((-1.0 + (l * (-1.0 / (-1.0 / h)))))));
} else {
tmp = d * (fma(h, ((-0.5 / l) * pow((0.5 * (D * (M / d))), 2.0)), 1.0) / sqrt((l * h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.85e+208) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -2.5e-243) tmp = Float64(sqrt(Float64(d * Float64(Float64(d / h) / l))) * fma(Float64(h * (Float64(D * Float64(0.5 * Float64(M / d))) ^ 2.0)), Float64(-0.5 / l), 1.0)); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(-1.0 + Float64(l * Float64(-1.0 / Float64(-1.0 / h)))))))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.5 / l) * (Float64(0.5 * Float64(D * Float64(M / d))) ^ 2.0)), 1.0) / sqrt(Float64(l * h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.85e+208], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -2.5e-243], N[(N[Sqrt[N[(d * N[(N[(d / h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[Power[N[(D * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(-1.0 + N[(l * N[(-1.0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.5 / l), $MachinePrecision] * N[Power[N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.85 \cdot 10^{+208}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -2.5 \cdot 10^{-243}:\\
\;\;\;\;\sqrt{d \cdot \frac{\frac{d}{h}}{\ell}} \cdot \mathsf{fma}\left(h \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}, \frac{-0.5}{\ell}, 1\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(-1 + \ell \cdot \frac{-1}{\frac{-1}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.5}{\ell} \cdot {\left(0.5 \cdot \left(D \cdot \frac{M}{d}\right)\right)}^{2}, 1\right)}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.84999999999999994e208Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -1.84999999999999994e208 < d < -2.5e-243Initial program 70.3%
Simplified70.0%
associate-*r*70.0%
*-commutative70.0%
associate-*r/72.2%
associate-*l/72.2%
div-inv72.2%
associate-*l*72.2%
metadata-eval72.2%
Applied egg-rr72.2%
associate-*r*72.2%
metadata-eval72.2%
div-inv72.2%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
pow172.6%
associate-*r*72.5%
pow1/272.5%
pow1/272.5%
pow-prod-down59.6%
+-commutative59.6%
associate-/l*59.6%
fma-define59.6%
*-commutative59.6%
associate-/l*59.3%
Applied egg-rr59.3%
unpow159.3%
unpow1/259.3%
associate-*l/53.4%
associate-/l*57.7%
*-commutative57.7%
associate-*l*57.7%
associate-/l*58.0%
*-commutative58.0%
*-commutative58.0%
associate-/l*56.7%
associate-*l*56.7%
Simplified56.7%
if -2.5e-243 < d < -4.999999999999985e-310Initial program 47.2%
Taylor expanded in d around inf 8.6%
expm1-log1p-u8.6%
expm1-undefine8.6%
inv-pow8.6%
sqrt-pow18.6%
metadata-eval8.6%
Applied egg-rr8.6%
Taylor expanded in h around -inf 2.1%
log1p-expm1-u54.6%
expm1-undefine54.6%
exp-sum54.6%
add-exp-log54.6%
mul-1-neg54.6%
mul-1-neg54.6%
exp-neg54.6%
add-exp-log54.6%
Applied egg-rr54.6%
if -4.999999999999985e-310 < d Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
fma-define85.6%
associate-*r*85.6%
associate-*r/85.2%
associate-*l/84.1%
associate-/r/85.6%
associate-/l*85.6%
associate-/r/85.6%
Simplified85.6%
associate-*r/89.1%
associate-*r*87.5%
sqrt-unprod75.4%
Applied egg-rr75.4%
*-commutative75.4%
associate-/l*74.5%
Simplified78.7%
Final simplification69.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.85e+208)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -8.5e-244)
(*
(sqrt (* (/ d l) (/ d h)))
(fma (* h (pow (* (* M 0.5) (/ D d)) 2.0)) (/ -0.5 l) 1.0))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ -1.0 (* l (/ -1.0 (/ -1.0 h))))))))
(*
d
(/
(fma h (* (/ -0.5 l) (pow (* 0.5 (* D (/ M d))) 2.0)) 1.0)
(sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.85e+208) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -8.5e-244) {
tmp = sqrt(((d / l) * (d / h))) * fma((h * pow(((M * 0.5) * (D / d)), 2.0)), (-0.5 / l), 1.0);
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p((-1.0 + (l * (-1.0 / (-1.0 / h)))))));
} else {
tmp = d * (fma(h, ((-0.5 / l) * pow((0.5 * (D * (M / d))), 2.0)), 1.0) / sqrt((l * h)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.85e+208) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -8.5e-244) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * fma(Float64(h * (Float64(Float64(M * 0.5) * Float64(D / d)) ^ 2.0)), Float64(-0.5 / l), 1.0)); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(-1.0 + Float64(l * Float64(-1.0 / Float64(-1.0 / h)))))))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.5 / l) * (Float64(0.5 * Float64(D * Float64(M / d))) ^ 2.0)), 1.0) / sqrt(Float64(l * h)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.85e+208], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -8.5e-244], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[Power[N[(N[(M * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-0.5 / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(-1.0 + N[(l * N[(-1.0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.5 / l), $MachinePrecision] * N[Power[N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.85 \cdot 10^{+208}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -8.5 \cdot 10^{-244}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \mathsf{fma}\left(h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}, \frac{-0.5}{\ell}, 1\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(-1 + \ell \cdot \frac{-1}{\frac{-1}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.5}{\ell} \cdot {\left(0.5 \cdot \left(D \cdot \frac{M}{d}\right)\right)}^{2}, 1\right)}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.84999999999999994e208Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -1.84999999999999994e208 < d < -8.4999999999999999e-244Initial program 70.3%
Simplified70.0%
associate-*r*70.0%
*-commutative70.0%
associate-*r/72.2%
associate-*l/72.2%
div-inv72.2%
associate-*l*72.2%
metadata-eval72.2%
Applied egg-rr72.2%
associate-*r*72.2%
metadata-eval72.2%
div-inv72.2%
associate-*r/72.6%
div-inv72.6%
metadata-eval72.6%
Applied egg-rr72.6%
pow172.6%
associate-*r*72.5%
pow1/272.5%
pow1/272.5%
pow-prod-down59.6%
+-commutative59.6%
associate-/l*59.6%
fma-define59.6%
*-commutative59.6%
associate-/l*59.3%
Applied egg-rr59.3%
unpow159.3%
unpow1/259.3%
Simplified59.3%
if -8.4999999999999999e-244 < d < -4.999999999999985e-310Initial program 47.2%
Taylor expanded in d around inf 8.6%
expm1-log1p-u8.6%
expm1-undefine8.6%
inv-pow8.6%
sqrt-pow18.6%
metadata-eval8.6%
Applied egg-rr8.6%
Taylor expanded in h around -inf 2.1%
log1p-expm1-u54.6%
expm1-undefine54.6%
exp-sum54.6%
add-exp-log54.6%
mul-1-neg54.6%
mul-1-neg54.6%
exp-neg54.6%
add-exp-log54.6%
Applied egg-rr54.6%
if -4.999999999999985e-310 < d Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
fma-define85.6%
associate-*r*85.6%
associate-*r/85.2%
associate-*l/84.1%
associate-/r/85.6%
associate-/l*85.6%
associate-/r/85.6%
Simplified85.6%
associate-*r/89.1%
associate-*r*87.5%
sqrt-unprod75.4%
Applied egg-rr75.4%
*-commutative75.4%
associate-/l*74.5%
Simplified78.7%
Final simplification70.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.1e+209)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1.1e-282)
(*
(sqrt (/ d l))
(*
(+ 1.0 (* (/ h l) (* -0.5 (pow (* (/ D d) (/ M 2.0)) 2.0))))
(sqrt (/ d h))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.1e+209) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * pow(((D / d) * (M / 2.0)), 2.0)))) * sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-2.1d+209)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-1.1d-282)) then
tmp = sqrt((d / l)) * ((1.0d0 + ((h / l) * ((-0.5d0) * (((d_1 / d) * (m / 2.0d0)) ** 2.0d0)))) * sqrt((d / h)))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -2.1e+209) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * Math.pow(((D / d) * (M / 2.0)), 2.0)))) * Math.sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.1e+209: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -1.1e-282: tmp = math.sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * math.pow(((D / d) * (M / 2.0)), 2.0)))) * math.sqrt((d / h))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.1e+209) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1.1e-282) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0)))) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -2.1e+209) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -1.1e-282) tmp = sqrt((d / l)) * ((1.0 + ((h / l) * (-0.5 * (((D / d) * (M / 2.0)) ^ 2.0)))) * sqrt((d / h))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.1e+209], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.1e-282], N[(N[Sqrt[N[(d / l), $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 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -2.1 \cdot 10^{+209}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1.1 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \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}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.1e209Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -2.1e209 < d < -1.09999999999999991e-282Initial program 69.8%
Simplified69.4%
if -1.09999999999999991e-282 < d Initial program 60.8%
Applied egg-rr73.1%
distribute-rgt1-in82.8%
+-commutative82.8%
associate-*l/85.3%
associate-/l*86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification79.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4e+209)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1.1e-282)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ D (* d (/ 2.0 M))) 2.0))))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e+209) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((D / (d * (2.0 / M))), 2.0)))));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-4d+209)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-1.1d-282)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((d_1 / (d * (2.0d0 / m))) ** 2.0d0)))))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -4e+209) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((D / (d * (2.0 / M))), 2.0)))));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4e+209: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -1.1e-282: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((D / (d * (2.0 / M))), 2.0))))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4e+209) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1.1e-282) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D / Float64(d * Float64(2.0 / M))) ^ 2.0)))))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -4e+209) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -1.1e-282) tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((D / (d * (2.0 / M))) ^ 2.0))))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4e+209], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.1e-282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D / N[(d * N[(2.0 / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -4 \cdot 10^{+209}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1.1 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D}{d \cdot \frac{2}{M}}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.0000000000000003e209Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -4.0000000000000003e209 < d < -1.09999999999999991e-282Initial program 69.8%
Simplified69.4%
clear-num69.4%
frac-times69.4%
*-un-lft-identity69.4%
Applied egg-rr69.4%
if -1.09999999999999991e-282 < d Initial program 60.8%
Applied egg-rr73.1%
distribute-rgt1-in82.8%
+-commutative82.8%
associate-*l/85.3%
associate-/l*86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification79.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5.3e+209)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1.1e-282)
(*
(sqrt (/ d l))
(*
(+ 1.0 (/ (* -0.5 (* h (pow (* M (* 0.5 (/ D d))) 2.0))) l))
(sqrt (/ d h))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5.3e+209) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = sqrt((d / l)) * ((1.0 + ((-0.5 * (h * pow((M * (0.5 * (D / d))), 2.0))) / l)) * sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-5.3d+209)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-1.1d-282)) then
tmp = sqrt((d / l)) * ((1.0d0 + (((-0.5d0) * (h * ((m * (0.5d0 * (d_1 / d))) ** 2.0d0))) / l)) * sqrt((d / h)))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -5.3e+209) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = Math.sqrt((d / l)) * ((1.0 + ((-0.5 * (h * Math.pow((M * (0.5 * (D / d))), 2.0))) / l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -5.3e+209: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -1.1e-282: tmp = math.sqrt((d / l)) * ((1.0 + ((-0.5 * (h * math.pow((M * (0.5 * (D / d))), 2.0))) / l)) * math.sqrt((d / h))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5.3e+209) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1.1e-282) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(-0.5 * Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0))) / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -5.3e+209) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -1.1e-282) tmp = sqrt((d / l)) * ((1.0 + ((-0.5 * (h * ((M * (0.5 * (D / d))) ^ 2.0))) / l)) * sqrt((d / h))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.3e+209], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.1e-282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(-0.5 * N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -5.3 \cdot 10^{+209}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1.1 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{-0.5 \cdot \left(h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -5.29999999999999995e209Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -5.29999999999999995e209 < d < -1.09999999999999991e-282Initial program 69.8%
Simplified69.4%
associate-*r*69.4%
*-commutative69.4%
associate-*r/71.4%
associate-*l/71.4%
div-inv71.4%
associate-*l*71.4%
metadata-eval71.4%
Applied egg-rr71.4%
if -1.09999999999999991e-282 < d Initial program 60.8%
Applied egg-rr73.1%
distribute-rgt1-in82.8%
+-commutative82.8%
associate-*l/85.3%
associate-/l*86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification80.2%
(FPCore (d h l M D)
:precision binary64
(if (<= d -2.25e+209)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -1.1e-282)
(*
(sqrt (/ d l))
(*
(+ 1.0 (/ (* (* h (pow (/ (* (* M 0.5) D) d) 2.0)) -0.5) l))
(sqrt (/ d h))))
(*
(+ 1.0 (* h (/ (* -0.5 (pow (* M (/ (* 0.5 D) d)) 2.0)) l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.25e+209) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = sqrt((d / l)) * ((1.0 + (((h * pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l)) * sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (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 <= (-2.25d+209)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-1.1d-282)) then
tmp = sqrt((d / l)) * ((1.0d0 + (((h * ((((m * 0.5d0) * d_1) / d) ** 2.0d0)) * (-0.5d0)) / l)) * sqrt((d / h)))
else
tmp = (1.0d0 + (h * (((-0.5d0) * ((m * ((0.5d0 * d_1) / d)) ** 2.0d0)) / l))) * (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 <= -2.25e+209) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -1.1e-282) {
tmp = Math.sqrt((d / l)) * ((1.0 + (((h * Math.pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 + (h * ((-0.5 * Math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (Math.sqrt(h) * Math.sqrt(l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.25e+209: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -1.1e-282: tmp = math.sqrt((d / l)) * ((1.0 + (((h * math.pow((((M * 0.5) * D) / d), 2.0)) * -0.5) / l)) * math.sqrt((d / h))) else: tmp = (1.0 + (h * ((-0.5 * math.pow((M * ((0.5 * D) / d)), 2.0)) / l))) * (d / (math.sqrt(h) * math.sqrt(l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.25e+209) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -1.1e-282) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(1.0 + Float64(Float64(Float64(h * (Float64(Float64(Float64(M * 0.5) * D) / d) ^ 2.0)) * -0.5) / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 + Float64(h * Float64(Float64(-0.5 * (Float64(M * Float64(Float64(0.5 * D) / d)) ^ 2.0)) / l))) * 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 <= -2.25e+209) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -1.1e-282) tmp = sqrt((d / l)) * ((1.0 + (((h * ((((M * 0.5) * D) / d) ^ 2.0)) * -0.5) / l)) * sqrt((d / h))); else tmp = (1.0 + (h * ((-0.5 * ((M * ((0.5 * D) / d)) ^ 2.0)) / l))) * (d / (sqrt(h) * sqrt(l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.25e+209], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.1e-282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(N[(h * N[Power[N[(N[(N[(M * 0.5), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(h * N[(N[(-0.5 * N[Power[N[(M * N[(N[(0.5 * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -2.25 \cdot 10^{+209}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -1.1 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + \frac{\left(h \cdot {\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d}\right)}^{2}\right) \cdot -0.5}{\ell}\right) \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + h \cdot \frac{-0.5 \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.2500000000000002e209Initial program 44.7%
Simplified49.5%
associate-*r*49.5%
*-commutative49.5%
associate-*r/60.1%
associate-*l/60.1%
div-inv60.1%
associate-*l*60.1%
metadata-eval60.1%
Applied egg-rr60.1%
associate-*r*60.1%
metadata-eval60.1%
div-inv60.1%
associate-*r/55.4%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
clear-num55.4%
sqrt-div55.4%
metadata-eval55.4%
Applied egg-rr55.4%
Taylor expanded in d around -inf 85.7%
mul-1-neg85.7%
*-commutative85.7%
associate-/r*87.8%
Simplified87.8%
if -2.2500000000000002e209 < d < -1.09999999999999991e-282Initial program 69.8%
Simplified69.4%
associate-*r*69.4%
*-commutative69.4%
associate-*r/71.4%
associate-*l/71.4%
div-inv71.4%
associate-*l*71.4%
metadata-eval71.4%
Applied egg-rr71.4%
associate-*r*71.4%
metadata-eval71.4%
div-inv71.4%
associate-*r/71.7%
div-inv71.7%
metadata-eval71.7%
Applied egg-rr71.7%
if -1.09999999999999991e-282 < d Initial program 60.8%
Applied egg-rr73.1%
distribute-rgt1-in82.8%
+-commutative82.8%
associate-*l/85.3%
associate-/l*86.8%
associate-*r/86.8%
*-commutative86.8%
Simplified86.8%
Final simplification80.3%
(FPCore (d h l M D)
:precision binary64
(if (<= h -2.8e+75)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= h -0.00155)
(/ d (log (exp (sqrt (* l h)))))
(if (<= h -5e-311)
(* (- d) (sqrt (/ 1.0 (* l h))))
(if (<= h 4e+27)
(/ d (* (sqrt h) (sqrt l)))
(* -0.125 (* (pow (* M D) 2.0) (/ (sqrt (/ h (pow l 3.0))) d))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e+75) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (h <= -0.00155) {
tmp = d / log(exp(sqrt((l * h))));
} else if (h <= -5e-311) {
tmp = -d * sqrt((1.0 / (l * h)));
} else if (h <= 4e+27) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = -0.125 * (pow((M * D), 2.0) * (sqrt((h / pow(l, 3.0))) / d));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-2.8d+75)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (h <= (-0.00155d0)) then
tmp = d / log(exp(sqrt((l * h))))
else if (h <= (-5d-311)) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else if (h <= 4d+27) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = (-0.125d0) * (((m * d_1) ** 2.0d0) * (sqrt((h / (l ** 3.0d0))) / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e+75) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (h <= -0.00155) {
tmp = d / Math.log(Math.exp(Math.sqrt((l * h))));
} else if (h <= -5e-311) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else if (h <= 4e+27) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = -0.125 * (Math.pow((M * D), 2.0) * (Math.sqrt((h / Math.pow(l, 3.0))) / d));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -2.8e+75: tmp = d * -math.sqrt(((1.0 / l) / h)) elif h <= -0.00155: tmp = d / math.log(math.exp(math.sqrt((l * h)))) elif h <= -5e-311: tmp = -d * math.sqrt((1.0 / (l * h))) elif h <= 4e+27: tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = -0.125 * (math.pow((M * D), 2.0) * (math.sqrt((h / math.pow(l, 3.0))) / d)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.8e+75) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (h <= -0.00155) tmp = Float64(d / log(exp(sqrt(Float64(l * h))))); elseif (h <= -5e-311) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); elseif (h <= 4e+27) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(-0.125 * Float64((Float64(M * D) ^ 2.0) * Float64(sqrt(Float64(h / (l ^ 3.0))) / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -2.8e+75) tmp = d * -sqrt(((1.0 / l) / h)); elseif (h <= -0.00155) tmp = d / log(exp(sqrt((l * h)))); elseif (h <= -5e-311) tmp = -d * sqrt((1.0 / (l * h))); elseif (h <= 4e+27) tmp = d / (sqrt(h) * sqrt(l)); else tmp = -0.125 * (((M * D) ^ 2.0) * (sqrt((h / (l ^ 3.0))) / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e+75], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[h, -0.00155], N[(d / N[Log[N[Exp[N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-311], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4e+27], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.8 \cdot 10^{+75}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;h \leq -0.00155:\\
\;\;\;\;\frac{d}{\log \left(e^{\sqrt{\ell \cdot h}}\right)}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{elif}\;h \leq 4 \cdot 10^{+27}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left({\left(M \cdot D\right)}^{2} \cdot \frac{\sqrt{\frac{h}{{\ell}^{3}}}}{d}\right)\\
\end{array}
\end{array}
if h < -2.80000000000000012e75Initial program 44.3%
Simplified44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r/53.6%
associate-*l/53.6%
div-inv53.6%
associate-*l*53.6%
metadata-eval53.6%
Applied egg-rr53.6%
associate-*r*53.6%
metadata-eval53.6%
div-inv53.6%
associate-*r/53.6%
div-inv53.6%
metadata-eval53.6%
Applied egg-rr53.6%
clear-num53.5%
sqrt-div53.5%
metadata-eval53.5%
Applied egg-rr53.5%
Taylor expanded in d around -inf 30.7%
mul-1-neg30.7%
*-commutative30.7%
associate-/r*31.6%
Simplified31.6%
if -2.80000000000000012e75 < h < -0.00154999999999999995Initial program 71.4%
Simplified69.5%
associate-*r/69.5%
div-inv69.5%
associate-*l*69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in d around inf 4.4%
*-commutative4.4%
associate-/r*4.4%
unpow1/24.4%
associate-/r*4.4%
rem-exp-log4.4%
exp-neg4.4%
exp-prod4.4%
*-commutative4.4%
distribute-rgt-neg-out4.4%
log-pow4.4%
unpow1/24.4%
rec-exp4.4%
rem-exp-log4.4%
associate-*l/4.4%
*-lft-identity4.4%
remove-double-neg4.4%
remove-double-neg4.4%
Simplified4.4%
add-log-exp47.5%
*-commutative47.5%
Applied egg-rr47.5%
if -0.00154999999999999995 < h < -5.00000000000023e-311Initial program 75.1%
Simplified76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*r/76.4%
associate-*l/76.4%
div-inv76.4%
associate-*l*76.4%
metadata-eval76.4%
Applied egg-rr76.4%
associate-*r*76.4%
metadata-eval76.4%
div-inv76.4%
associate-*r/75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
Applied egg-rr75.0%
Taylor expanded in d around -inf 56.8%
mul-1-neg56.8%
*-commutative56.8%
*-commutative56.8%
distribute-rgt-neg-in56.8%
*-commutative56.8%
Simplified56.8%
if -5.00000000000023e-311 < h < 4.0000000000000001e27Initial program 68.2%
Taylor expanded in d around inf 63.2%
sqrt-div63.1%
metadata-eval63.1%
sqrt-unprod71.2%
div-inv71.3%
associate-/r*67.1%
Applied egg-rr67.1%
associate-/l/71.3%
*-commutative71.3%
Simplified71.3%
if 4.0000000000000001e27 < h Initial program 55.9%
Simplified56.0%
associate-*r*56.0%
*-commutative56.0%
associate-*r/56.0%
associate-*l/56.0%
div-inv56.0%
associate-*l*56.0%
metadata-eval56.0%
Applied egg-rr56.0%
associate-*r*56.0%
metadata-eval56.0%
div-inv56.0%
associate-*r/56.0%
div-inv56.0%
metadata-eval56.0%
Applied egg-rr56.0%
Taylor expanded in d around 0 54.3%
associate-*l/52.5%
unpow252.5%
unpow252.5%
swap-sqr56.6%
unpow256.6%
associate-/l*56.7%
Simplified56.7%
Final simplification55.3%
(FPCore (d h l M D)
:precision binary64
(if (<= h -4.2e+75)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= h -0.00155)
(/ d (log (exp (sqrt (* l h)))))
(if (<= h -5e-311)
(* (- d) (sqrt (/ 1.0 (* l h))))
(if (<= h 7.8e+31)
(/ d (* (sqrt h) (sqrt l)))
(* (/ (pow (* M D) 2.0) d) (* (sqrt (/ h (pow l 3.0))) -0.125)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.2e+75) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (h <= -0.00155) {
tmp = d / log(exp(sqrt((l * h))));
} else if (h <= -5e-311) {
tmp = -d * sqrt((1.0 / (l * h)));
} else if (h <= 7.8e+31) {
tmp = d / (sqrt(h) * sqrt(l));
} else {
tmp = (pow((M * D), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * -0.125);
}
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 <= (-4.2d+75)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (h <= (-0.00155d0)) then
tmp = d / log(exp(sqrt((l * h))))
else if (h <= (-5d-311)) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else if (h <= 7.8d+31) then
tmp = d / (sqrt(h) * sqrt(l))
else
tmp = (((m * d_1) ** 2.0d0) / d) * (sqrt((h / (l ** 3.0d0))) * (-0.125d0))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -4.2e+75) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (h <= -0.00155) {
tmp = d / Math.log(Math.exp(Math.sqrt((l * h))));
} else if (h <= -5e-311) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else if (h <= 7.8e+31) {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
} else {
tmp = (Math.pow((M * D), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * -0.125);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -4.2e+75: tmp = d * -math.sqrt(((1.0 / l) / h)) elif h <= -0.00155: tmp = d / math.log(math.exp(math.sqrt((l * h)))) elif h <= -5e-311: tmp = -d * math.sqrt((1.0 / (l * h))) elif h <= 7.8e+31: tmp = d / (math.sqrt(h) * math.sqrt(l)) else: tmp = (math.pow((M * D), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * -0.125) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -4.2e+75) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (h <= -0.00155) tmp = Float64(d / log(exp(sqrt(Float64(l * h))))); elseif (h <= -5e-311) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); elseif (h <= 7.8e+31) tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); else tmp = Float64(Float64((Float64(M * D) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * -0.125)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -4.2e+75) tmp = d * -sqrt(((1.0 / l) / h)); elseif (h <= -0.00155) tmp = d / log(exp(sqrt((l * h)))); elseif (h <= -5e-311) tmp = -d * sqrt((1.0 / (l * h))); elseif (h <= 7.8e+31) tmp = d / (sqrt(h) * sqrt(l)); else tmp = (((M * D) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * -0.125); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4.2e+75], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[h, -0.00155], N[(d / N[Log[N[Exp[N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-311], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7.8e+31], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.2 \cdot 10^{+75}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;h \leq -0.00155:\\
\;\;\;\;\frac{d}{\log \left(e^{\sqrt{\ell \cdot h}}\right)}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{elif}\;h \leq 7.8 \cdot 10^{+31}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)\\
\end{array}
\end{array}
if h < -4.19999999999999997e75Initial program 44.3%
Simplified44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r/53.6%
associate-*l/53.6%
div-inv53.6%
associate-*l*53.6%
metadata-eval53.6%
Applied egg-rr53.6%
associate-*r*53.6%
metadata-eval53.6%
div-inv53.6%
associate-*r/53.6%
div-inv53.6%
metadata-eval53.6%
Applied egg-rr53.6%
clear-num53.5%
sqrt-div53.5%
metadata-eval53.5%
Applied egg-rr53.5%
Taylor expanded in d around -inf 30.7%
mul-1-neg30.7%
*-commutative30.7%
associate-/r*31.6%
Simplified31.6%
if -4.19999999999999997e75 < h < -0.00154999999999999995Initial program 71.4%
Simplified69.5%
associate-*r/69.5%
div-inv69.5%
associate-*l*69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in d around inf 4.4%
*-commutative4.4%
associate-/r*4.4%
unpow1/24.4%
associate-/r*4.4%
rem-exp-log4.4%
exp-neg4.4%
exp-prod4.4%
*-commutative4.4%
distribute-rgt-neg-out4.4%
log-pow4.4%
unpow1/24.4%
rec-exp4.4%
rem-exp-log4.4%
associate-*l/4.4%
*-lft-identity4.4%
remove-double-neg4.4%
remove-double-neg4.4%
Simplified4.4%
add-log-exp47.5%
*-commutative47.5%
Applied egg-rr47.5%
if -0.00154999999999999995 < h < -5.00000000000023e-311Initial program 75.1%
Simplified76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*r/76.4%
associate-*l/76.4%
div-inv76.4%
associate-*l*76.4%
metadata-eval76.4%
Applied egg-rr76.4%
associate-*r*76.4%
metadata-eval76.4%
div-inv76.4%
associate-*r/75.1%
div-inv75.1%
metadata-eval75.1%
Applied egg-rr75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
Applied egg-rr75.0%
Taylor expanded in d around -inf 56.8%
mul-1-neg56.8%
*-commutative56.8%
*-commutative56.8%
distribute-rgt-neg-in56.8%
*-commutative56.8%
Simplified56.8%
if -5.00000000000023e-311 < h < 7.79999999999999999e31Initial program 68.2%
Taylor expanded in d around inf 63.2%
sqrt-div63.1%
metadata-eval63.1%
sqrt-unprod71.2%
div-inv71.3%
associate-/r*67.1%
Applied egg-rr67.1%
associate-/l/71.3%
*-commutative71.3%
Simplified71.3%
if 7.79999999999999999e31 < h Initial program 55.9%
Taylor expanded in d around 0 54.3%
*-commutative54.3%
associate-*l*54.3%
associate-/l*54.4%
Simplified54.4%
Taylor expanded in D around 0 54.3%
unpow254.3%
unpow254.3%
swap-sqr58.4%
unpow258.4%
Simplified58.4%
Final simplification55.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= d -9.5e-199)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -5e-310)
(/ d (log (exp t_0)))
(*
d
(/ (fma h (* (/ -0.5 l) (pow (* 0.5 (* D (/ M d))) 2.0)) 1.0) t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (d <= -9.5e-199) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -5e-310) {
tmp = d / log(exp(t_0));
} else {
tmp = d * (fma(h, ((-0.5 / l) * pow((0.5 * (D * (M / d))), 2.0)), 1.0) / t_0);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (d <= -9.5e-199) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -5e-310) tmp = Float64(d / log(exp(t_0))); else tmp = Float64(d * Float64(fma(h, Float64(Float64(-0.5 / l) * (Float64(0.5 * Float64(D * Float64(M / d))) ^ 2.0)), 1.0) / t_0)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -9.5e-199], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d / N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[(-0.5 / l), $MachinePrecision] * N[Power[N[(0.5 * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;d \leq -9.5 \cdot 10^{-199}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\log \left(e^{t\_0}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, \frac{-0.5}{\ell} \cdot {\left(0.5 \cdot \left(D \cdot \frac{M}{d}\right)\right)}^{2}, 1\right)}{t\_0}\\
\end{array}
\end{array}
if d < -9.5000000000000005e-199Initial program 65.5%
Simplified66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r/70.2%
associate-*l/70.2%
div-inv70.2%
associate-*l*70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-*r*70.2%
metadata-eval70.2%
div-inv70.2%
associate-*r/69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
clear-num69.6%
sqrt-div69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in d around -inf 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-/r*50.3%
Simplified50.3%
if -9.5000000000000005e-199 < d < -4.999999999999985e-310Initial program 57.7%
Simplified57.7%
associate-*r/57.6%
div-inv57.6%
associate-*l*57.6%
metadata-eval57.6%
Applied egg-rr57.6%
Taylor expanded in d around inf 12.9%
*-commutative12.9%
associate-/r*12.9%
unpow1/212.9%
associate-/r*12.9%
rem-exp-log12.9%
exp-neg12.9%
exp-prod9.4%
*-commutative9.4%
distribute-rgt-neg-out9.4%
log-pow9.4%
unpow1/29.4%
rec-exp9.4%
rem-exp-log9.4%
associate-*l/9.4%
*-lft-identity9.4%
remove-double-neg9.4%
remove-double-neg9.4%
Simplified9.4%
add-log-exp51.4%
*-commutative51.4%
Applied egg-rr51.4%
if -4.999999999999985e-310 < d Initial program 62.8%
Applied egg-rr75.5%
distribute-rgt1-in85.6%
fma-define85.6%
associate-*r*85.6%
associate-*r/85.2%
associate-*l/84.1%
associate-/r/85.6%
associate-/l*85.6%
associate-/r/85.6%
Simplified85.6%
associate-*r/89.1%
associate-*r*87.5%
sqrt-unprod75.4%
Applied egg-rr75.4%
*-commutative75.4%
associate-/l*74.5%
Simplified78.7%
Final simplification63.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.2e-198)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -5e-310)
(/ d (log (exp (sqrt (* l h)))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.2e-198) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -5e-310) {
tmp = d / log(exp(sqrt((l * h))));
} else {
tmp = 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 <= (-6.2d-198)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else if (d <= (-5d-310)) then
tmp = d / log(exp(sqrt((l * h))))
else
tmp = 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 <= -6.2e-198) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -5e-310) {
tmp = d / Math.log(Math.exp(Math.sqrt((l * h))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -6.2e-198: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -5e-310: tmp = d / math.log(math.exp(math.sqrt((l * h)))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.2e-198) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -5e-310) tmp = Float64(d / log(exp(sqrt(Float64(l * h))))); else tmp = 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 <= -6.2e-198) tmp = d * -sqrt(((1.0 / l) / h)); elseif (d <= -5e-310) tmp = d / log(exp(sqrt((l * h)))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.2e-198], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d / N[Log[N[Exp[N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.2 \cdot 10^{-198}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\log \left(e^{\sqrt{\ell \cdot h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.1999999999999997e-198Initial program 65.5%
Simplified66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r/70.2%
associate-*l/70.2%
div-inv70.2%
associate-*l*70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-*r*70.2%
metadata-eval70.2%
div-inv70.2%
associate-*r/69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
clear-num69.6%
sqrt-div69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in d around -inf 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-/r*50.3%
Simplified50.3%
if -6.1999999999999997e-198 < d < -4.999999999999985e-310Initial program 57.7%
Simplified57.7%
associate-*r/57.6%
div-inv57.6%
associate-*l*57.6%
metadata-eval57.6%
Applied egg-rr57.6%
Taylor expanded in d around inf 12.9%
*-commutative12.9%
associate-/r*12.9%
unpow1/212.9%
associate-/r*12.9%
rem-exp-log12.9%
exp-neg12.9%
exp-prod9.4%
*-commutative9.4%
distribute-rgt-neg-out9.4%
log-pow9.4%
unpow1/29.4%
rec-exp9.4%
rem-exp-log9.4%
associate-*l/9.4%
*-lft-identity9.4%
remove-double-neg9.4%
remove-double-neg9.4%
Simplified9.4%
add-log-exp51.4%
*-commutative51.4%
Applied egg-rr51.4%
if -4.999999999999985e-310 < d Initial program 62.8%
Taylor expanded in d around inf 43.8%
sqrt-div43.7%
metadata-eval43.7%
sqrt-unprod49.8%
div-inv49.9%
associate-/r*47.5%
Applied egg-rr47.5%
associate-/l/49.9%
*-commutative49.9%
Simplified49.9%
Final simplification50.2%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.1e-197)
(* d (- (sqrt (/ (/ 1.0 l) h))))
(if (<= d -5e-310)
(* d (exp (* -0.5 (log1p (+ -1.0 (* l (/ -1.0 (/ -1.0 h))))))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.1e-197) {
tmp = d * -sqrt(((1.0 / l) / h));
} else if (d <= -5e-310) {
tmp = d * exp((-0.5 * log1p((-1.0 + (l * (-1.0 / (-1.0 / h)))))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.1e-197) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else if (d <= -5e-310) {
tmp = d * Math.exp((-0.5 * Math.log1p((-1.0 + (l * (-1.0 / (-1.0 / h)))))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.1e-197: tmp = d * -math.sqrt(((1.0 / l) / h)) elif d <= -5e-310: tmp = d * math.exp((-0.5 * math.log1p((-1.0 + (l * (-1.0 / (-1.0 / h))))))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.1e-197) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); elseif (d <= -5e-310) tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(-1.0 + Float64(l * Float64(-1.0 / Float64(-1.0 / h)))))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.1e-197], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(-1.0 + N[(l * N[(-1.0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.1 \cdot 10^{-197}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(-1 + \ell \cdot \frac{-1}{\frac{-1}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.1e-197Initial program 65.5%
Simplified66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r/70.2%
associate-*l/70.2%
div-inv70.2%
associate-*l*70.2%
metadata-eval70.2%
Applied egg-rr70.2%
associate-*r*70.2%
metadata-eval70.2%
div-inv70.2%
associate-*r/69.6%
div-inv69.6%
metadata-eval69.6%
Applied egg-rr69.6%
clear-num69.6%
sqrt-div69.5%
metadata-eval69.5%
Applied egg-rr69.5%
Taylor expanded in d around -inf 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-/r*50.3%
Simplified50.3%
if -1.1e-197 < d < -4.999999999999985e-310Initial program 57.7%
Taylor expanded in d around inf 12.9%
expm1-log1p-u12.9%
expm1-undefine12.9%
inv-pow12.9%
sqrt-pow19.5%
metadata-eval9.5%
Applied egg-rr9.5%
Taylor expanded in h around -inf 6.1%
log1p-expm1-u51.3%
expm1-undefine51.3%
exp-sum51.3%
add-exp-log51.3%
mul-1-neg51.3%
mul-1-neg51.3%
exp-neg51.3%
add-exp-log51.3%
Applied egg-rr51.3%
if -4.999999999999985e-310 < d Initial program 62.8%
Taylor expanded in d around inf 43.8%
sqrt-div43.7%
metadata-eval43.7%
sqrt-unprod49.8%
div-inv49.9%
associate-/r*47.5%
Applied egg-rr47.5%
associate-/l/49.9%
*-commutative49.9%
Simplified49.9%
Final simplification50.2%
(FPCore (d h l M D) :precision binary64 (if (<= d 1.1e-289) (* d (- (sqrt (/ (/ 1.0 l) h)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 1.1e-289) {
tmp = d * -sqrt(((1.0 / l) / h));
} else {
tmp = 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 <= 1.1d-289) then
tmp = d * -sqrt(((1.0d0 / l) / h))
else
tmp = 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 <= 1.1e-289) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 1.1e-289: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 1.1e-289) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h)))); else tmp = 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 <= 1.1e-289) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.1e-289], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.1 \cdot 10^{-289}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < 1.1e-289Initial program 62.8%
Simplified63.3%
associate-*r*63.3%
*-commutative63.3%
associate-*r/66.4%
associate-*l/66.4%
div-inv66.4%
associate-*l*66.4%
metadata-eval66.4%
Applied egg-rr66.4%
associate-*r*66.4%
metadata-eval66.4%
div-inv66.4%
associate-*r/66.0%
div-inv66.0%
metadata-eval66.0%
Applied egg-rr66.0%
clear-num66.0%
sqrt-div65.9%
metadata-eval65.9%
Applied egg-rr65.9%
Taylor expanded in d around -inf 41.7%
mul-1-neg41.7%
*-commutative41.7%
associate-/r*42.0%
Simplified42.0%
if 1.1e-289 < d Initial program 64.1%
Taylor expanded in d around inf 45.2%
sqrt-div45.1%
metadata-eval45.1%
sqrt-unprod51.4%
div-inv51.5%
associate-/r*49.1%
Applied egg-rr49.1%
associate-/l/51.5%
*-commutative51.5%
Simplified51.5%
Final simplification46.3%
(FPCore (d h l M D) :precision binary64 (if (<= d -2.7e-241) (* d (- (sqrt (/ (/ 1.0 l) h)))) (* d (sqrt (/ 1.0 (* l h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.7e-241) {
tmp = d * -sqrt(((1.0 / l) / h));
} 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 <= (-2.7d-241)) then
tmp = d * -sqrt(((1.0d0 / l) / h))
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 <= -2.7e-241) {
tmp = d * -Math.sqrt(((1.0 / l) / h));
} else {
tmp = d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.7e-241: tmp = d * -math.sqrt(((1.0 / l) / h)) else: tmp = d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.7e-241) tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / 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 <= -2.7e-241) tmp = d * -sqrt(((1.0 / l) / h)); else tmp = d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.7e-241], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $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}\;d \leq -2.7 \cdot 10^{-241}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -2.6999999999999999e-241Initial program 65.6%
Simplified66.2%
associate-*r*66.2%
*-commutative66.2%
associate-*r/69.9%
associate-*l/69.9%
div-inv69.9%
associate-*l*69.9%
metadata-eval69.9%
Applied egg-rr69.9%
associate-*r*69.9%
metadata-eval69.9%
div-inv69.9%
associate-*r/69.3%
div-inv69.3%
metadata-eval69.3%
Applied egg-rr69.3%
clear-num69.3%
sqrt-div69.3%
metadata-eval69.3%
Applied egg-rr69.3%
Taylor expanded in d around -inf 48.3%
mul-1-neg48.3%
*-commutative48.3%
associate-/r*48.7%
Simplified48.7%
if -2.6999999999999999e-241 < d Initial program 61.4%
Taylor expanded in d around inf 39.6%
Final simplification43.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(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 63.4%
Taylor expanded in d around inf 25.1%
Final simplification25.1%
(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 63.4%
Simplified63.6%
associate-*r/65.4%
div-inv65.4%
associate-*l*65.4%
metadata-eval65.4%
Applied egg-rr65.4%
Taylor expanded in d around inf 25.1%
unpow-125.1%
metadata-eval25.1%
pow-sqr25.1%
rem-sqrt-square24.7%
rem-square-sqrt24.6%
fabs-sqr24.6%
rem-square-sqrt24.7%
Simplified24.7%
Final simplification24.7%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 63.4%
Simplified63.6%
associate-*r/65.4%
div-inv65.4%
associate-*l*65.4%
metadata-eval65.4%
Applied egg-rr65.4%
Taylor expanded in d around inf 25.1%
*-commutative25.1%
associate-/r*25.1%
unpow1/225.1%
associate-/r*25.1%
rem-exp-log24.2%
exp-neg24.2%
exp-prod23.8%
*-commutative23.8%
distribute-rgt-neg-out23.8%
log-pow23.8%
unpow1/223.8%
rec-exp23.8%
rem-exp-log24.7%
associate-*l/24.7%
*-lft-identity24.7%
remove-double-neg24.7%
remove-double-neg24.7%
Simplified24.7%
Final simplification24.7%
herbie shell --seed 2024046
(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)))))