
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= l -1.5e+206)
(*
(* (sqrt (/ d h)) (/ t_0 (sqrt (- l))))
(- 1.0 (* 0.5 (pow (* (/ (* (* 0.5 M) D) d) (sqrt (/ h l))) 2.0))))
(if (<= l -4e-310)
(*
(/ t_0 (sqrt (- h)))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5)))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (l <= -1.5e+206) {
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * pow(((((0.5 * M) * D) / d) * sqrt((h / l))), 2.0)));
} else if (l <= -4e-310) {
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-d)
if (l <= (-1.5d+206)) then
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0d0 - (0.5d0 * (((((0.5d0 * m) * d_1) / d) * sqrt((h / l))) ** 2.0d0)))
else if (l <= (-4d-310)) then
tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double tmp;
if (l <= -1.5e+206) {
tmp = (Math.sqrt((d / h)) * (t_0 / Math.sqrt(-l))) * (1.0 - (0.5 * Math.pow(((((0.5 * M) * D) / d) * Math.sqrt((h / l))), 2.0)));
} else if (l <= -4e-310) {
tmp = (t_0 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (Math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) tmp = 0 if l <= -1.5e+206: tmp = (math.sqrt((d / h)) * (t_0 / math.sqrt(-l))) * (1.0 - (0.5 * math.pow(((((0.5 * M) * D) / d) * math.sqrt((h / l))), 2.0))) elif l <= -4e-310: tmp = (t_0 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5)))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -1.5e+206) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(Float64(0.5 * M) * D) / d) * sqrt(Float64(h / l))) ^ 2.0)))); elseif (l <= -4e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); tmp = 0.0; if (l <= -1.5e+206) tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * (((((0.5 * M) * D) / d) * sqrt((h / l))) ^ 2.0))); elseif (l <= -4e-310) tmp = (t_0 / sqrt(-h)) * (sqrt((d / l)) * (1.0 + ((h / l) * ((((M / 2.0) * (D / d)) ^ 2.0) * -0.5)))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -1.5e+206], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / 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], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{+206}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_0}{\sqrt{-\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\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{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.5000000000000001e206Initial program 42.8%
Simplified42.8%
add-sqr-sqrt42.8%
pow242.8%
sqrt-prod42.8%
frac-times42.8%
*-commutative42.8%
frac-times42.5%
unpow242.5%
sqrt-prod18.7%
add-sqr-sqrt48.8%
div-inv48.8%
metadata-eval48.8%
Applied egg-rr48.8%
metadata-eval48.8%
div-inv48.8%
associate-*r/49.1%
div-inv49.1%
metadata-eval49.1%
Applied egg-rr49.1%
frac-2neg49.1%
sqrt-div76.7%
Applied egg-rr76.7%
if -1.5000000000000001e206 < l < -3.999999999999988e-310Initial program 68.9%
Simplified68.9%
frac-2neg68.9%
sqrt-div79.8%
Applied egg-rr79.8%
if -3.999999999999988e-310 < l Initial program 59.6%
Simplified60.3%
Applied egg-rr67.8%
distribute-rgt1-in76.9%
+-commutative76.9%
associate-*l*76.9%
Simplified76.9%
Final simplification78.0%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.6e-189)
(*
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
(if (<= h 1.1e-296)
(*
(- 1.0 (* 0.5 (pow (* (/ (* (* 0.5 M) D) d) (sqrt (/ h l))) 2.0)))
(* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.6e-189) {
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0 - (0.5 * ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
} else if (h <= 1.1e-296) {
tmp = (1.0 - (0.5 * pow(((((0.5 * M) * D) / d) * sqrt((h / l))), 2.0))) * (sqrt((d / l)) * (1.0 / sqrt((h / d))));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= (-1.6d-189)) then
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / 2.0d0) * (m / d)) ** 2.0d0))))
else if (h <= 1.1d-296) then
tmp = (1.0d0 - (0.5d0 * (((((0.5d0 * m) * d_1) / d) * sqrt((h / l))) ** 2.0d0))) * (sqrt((d / l)) * (1.0d0 / sqrt((h / d))))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.6e-189) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
} else if (h <= 1.1e-296) {
tmp = (1.0 - (0.5 * Math.pow(((((0.5 * M) * D) / d) * Math.sqrt((h / l))), 2.0))) * (Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d))));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1.6e-189: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l))) * (1.0 - (0.5 * ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) elif h <= 1.1e-296: tmp = (1.0 - (0.5 * math.pow(((((0.5 * M) * D) / d) * math.sqrt((h / l))), 2.0))) * (math.sqrt((d / l)) * (1.0 / math.sqrt((h / d)))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.6e-189) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0))))); elseif (h <= 1.1e-296) tmp = Float64(Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(Float64(0.5 * M) * D) / d) * sqrt(Float64(h / l))) ^ 2.0))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -1.6e-189) tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0 - (0.5 * ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0)))); elseif (h <= 1.1e-296) tmp = (1.0 - (0.5 * (((((0.5 * M) * D) / d) * sqrt((h / l))) ^ 2.0))) * (sqrt((d / l)) * (1.0 / sqrt((h / d)))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.6e-189], 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[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.1e-296], N[(N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.6 \cdot 10^{-189}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\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{elif}\;h \leq 1.1 \cdot 10^{-296}:\\
\;\;\;\;\left(1 - 0.5 \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -1.6e-189Initial program 67.8%
Simplified67.8%
frac-2neg69.7%
sqrt-div77.1%
Applied egg-rr75.0%
if -1.6e-189 < h < 1.10000000000000006e-296Initial program 53.1%
Simplified49.3%
add-sqr-sqrt49.3%
pow249.3%
sqrt-prod49.3%
frac-times53.0%
*-commutative53.0%
frac-times53.0%
unpow253.0%
sqrt-prod23.1%
add-sqr-sqrt64.5%
div-inv64.5%
metadata-eval64.5%
Applied egg-rr64.5%
metadata-eval64.5%
div-inv64.5%
associate-*r/64.6%
div-inv64.6%
metadata-eval64.6%
Applied egg-rr64.6%
clear-num64.6%
sqrt-div70.0%
metadata-eval70.0%
Applied egg-rr70.0%
if 1.10000000000000006e-296 < h Initial program 60.0%
Simplified60.7%
Applied egg-rr68.9%
distribute-rgt1-in77.6%
+-commutative77.6%
associate-*l*77.6%
Simplified77.6%
Final simplification75.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4e-279)
(*
(* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e-279) {
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0 - (0.5 * ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-4d-279)) then
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / 2.0d0) * (m / d)) ** 2.0d0))))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4e-279) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4e-279: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l))) * (1.0 - (0.5 * ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4e-279) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4e-279) tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * (1.0 - (0.5 * ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0)))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4e-279], 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[(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[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4 \cdot 10^{-279}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\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(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -4.00000000000000022e-279Initial program 67.4%
Simplified66.5%
frac-2neg71.0%
sqrt-div77.2%
Applied egg-rr72.4%
if -4.00000000000000022e-279 < d Initial program 58.0%
Simplified58.7%
Applied egg-rr65.9%
distribute-rgt1-in74.8%
+-commutative74.8%
associate-*l*74.8%
Simplified74.8%
Final simplification73.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -4e-310)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(*
(sqrt (/ d l))
(+ 1.0 (* (/ h l) (* (pow (* (/ M 2.0) (/ D d)) 2.0) -0.5)))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4e-310) {
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 + ((h / l) * (pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-4d-310)) then
tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 + ((h / l) * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (-0.5d0)))))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -4e-310) {
tmp = (Math.sqrt(-d) / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 + ((h / l) * (Math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5))));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -4e-310: tmp = (math.sqrt(-d) / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 + ((h / l) * (math.pow(((M / 2.0) * (D / d)), 2.0) * -0.5)))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -4e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * -0.5))))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -4e-310) tmp = (sqrt(-d) / sqrt(-h)) * (sqrt((d / l)) * (1.0 + ((h / l) * ((((M / 2.0) * (D / d)) ^ 2.0) * -0.5)))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / 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], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\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{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 65.1%
Simplified65.0%
frac-2neg65.0%
sqrt-div75.0%
Applied egg-rr75.0%
if -3.999999999999988e-310 < l Initial program 59.6%
Simplified60.3%
Applied egg-rr67.8%
distribute-rgt1-in76.9%
+-commutative76.9%
associate-*l*76.9%
Simplified76.9%
Final simplification76.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h 1.1e-296)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* 0.5 (pow (* (sqrt (/ h l)) (* (* 0.5 M) (/ D d))) 2.0))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.1e-296) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * pow((sqrt((h / l)) * ((0.5 * M) * (D / d))), 2.0)));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 1.1d-296) then
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * ((sqrt((h / l)) * ((0.5d0 * m) * (d_1 / d))) ** 2.0d0)))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.1e-296) {
tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * Math.pow((Math.sqrt((h / l)) * ((0.5 * M) * (D / d))), 2.0)));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 1.1e-296: tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * math.pow((math.sqrt((h / l)) * ((0.5 * M) * (D / d))), 2.0))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 1.1e-296) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * (Float64(sqrt(Float64(h / l)) * Float64(Float64(0.5 * M) * Float64(D / d))) ^ 2.0)))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 1.1e-296) tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * ((sqrt((h / l)) * ((0.5 * M) * (D / d))) ^ 2.0))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.1e-296], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.1 \cdot 10^{-296}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < 1.10000000000000006e-296Initial program 64.4%
Simplified63.6%
add-sqr-sqrt63.5%
pow263.5%
sqrt-prod63.5%
frac-times64.4%
*-commutative64.4%
frac-times64.3%
unpow264.3%
sqrt-prod38.5%
add-sqr-sqrt67.6%
div-inv67.6%
metadata-eval67.6%
Applied egg-rr67.6%
if 1.10000000000000006e-296 < h Initial program 60.0%
Simplified60.7%
Applied egg-rr68.9%
distribute-rgt1-in77.6%
+-commutative77.6%
associate-*l*77.6%
Simplified77.6%
Final simplification73.0%
(FPCore (d h l M D)
:precision binary64
(if (<= h 1.1e-296)
(*
(- 1.0 (* 0.5 (pow (* (/ (* (* 0.5 M) D) d) (sqrt (/ h l))) 2.0)))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.1e-296) {
tmp = (1.0 - (0.5 * pow(((((0.5 * M) * D) / d) * sqrt((h / l))), 2.0))) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 1.1d-296) then
tmp = (1.0d0 - (0.5d0 * (((((0.5d0 * m) * d_1) / d) * sqrt((h / l))) ** 2.0d0))) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 1.1e-296) {
tmp = (1.0 - (0.5 * Math.pow(((((0.5 * M) * D) / d) * Math.sqrt((h / l))), 2.0))) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 1.1e-296: tmp = (1.0 - (0.5 * math.pow(((((0.5 * M) * D) / d) * math.sqrt((h / l))), 2.0))) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 1.1e-296) tmp = Float64(Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(Float64(0.5 * M) * D) / d) * sqrt(Float64(h / l))) ^ 2.0))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 1.1e-296) tmp = (1.0 - (0.5 * (((((0.5 * M) * D) / d) * sqrt((h / l))) ^ 2.0))) * (sqrt((d / h)) * sqrt((d / l))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 1.1e-296], N[(N[(1.0 - N[(0.5 * N[Power[N[(N[(N[(N[(0.5 * M), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.1 \cdot 10^{-296}:\\
\;\;\;\;\left(1 - 0.5 \cdot {\left(\frac{\left(0.5 \cdot M\right) \cdot D}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < 1.10000000000000006e-296Initial program 64.4%
Simplified63.6%
add-sqr-sqrt63.5%
pow263.5%
sqrt-prod63.5%
frac-times64.4%
*-commutative64.4%
frac-times64.3%
unpow264.3%
sqrt-prod38.5%
add-sqr-sqrt67.6%
div-inv67.6%
metadata-eval67.6%
Applied egg-rr67.6%
metadata-eval67.6%
div-inv67.6%
associate-*r/68.5%
div-inv68.5%
metadata-eval68.5%
Applied egg-rr68.5%
if 1.10000000000000006e-296 < h Initial program 60.0%
Simplified60.7%
Applied egg-rr68.9%
distribute-rgt1-in77.6%
+-commutative77.6%
associate-*l*77.6%
Simplified77.6%
Final simplification73.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.15e+94)
(/ (- d) (sqrt (* l h)))
(if (<= l 5.2e-235)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(+ 1.0 (* h (/ -0.5 (/ l (pow (* D (/ M (* d 2.0))) 2.0)))))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.15e+94) {
tmp = -d / sqrt((l * h));
} else if (l <= 5.2e-235) {
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 * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.15d+94)) then
tmp = -d / sqrt((l * h))
else if (l <= 5.2d-235) 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 * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.15e+94) {
tmp = -d / Math.sqrt((l * h));
} else if (l <= 5.2e-235) {
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 * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.15e+94: tmp = -d / math.sqrt((l * h)) elif l <= 5.2e-235: 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 * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.15e+94) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); elseif (l <= 5.2e-235) 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(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.15e+94) tmp = -d / sqrt((l * h)); elseif (l <= 5.2e-235) 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 * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.15e+94], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.2e-235], 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[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+94}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{-235}:\\
\;\;\;\;\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(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.15e94Initial program 46.3%
Simplified46.3%
Applied egg-rr29.8%
Taylor expanded in d around -inf 59.5%
mul-1-neg59.5%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified59.8%
if -1.15e94 < l < 5.2000000000000001e-235Initial program 71.0%
Simplified71.0%
*-commutative71.0%
clear-num70.9%
un-div-inv70.9%
*-commutative70.9%
div-inv70.9%
metadata-eval70.9%
Applied egg-rr70.9%
associate-/r/71.6%
*-commutative71.6%
associate-/l*71.6%
associate-*r/71.5%
associate-/l*71.5%
associate-/l*71.5%
metadata-eval71.5%
associate-/l*71.5%
associate-*l/71.5%
/-rgt-identity71.5%
associate-/r/70.4%
associate-/r*70.4%
*-commutative70.4%
associate-/l/70.4%
Simplified70.4%
if 5.2000000000000001e-235 < l Initial program 60.3%
Simplified61.1%
Applied egg-rr70.6%
distribute-rgt1-in78.2%
+-commutative78.2%
associate-*l*78.2%
Simplified78.2%
Final simplification72.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.15e+94)
(/ (- d) (sqrt (* l h)))
(if (<= l 5e-308)
(*
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0))))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) (* (/ h l) -0.5)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.15e+94) {
tmp = -d / sqrt((l * h));
} else if (l <= 5e-308) {
tmp = (1.0 - (0.5 * ((h / l) * pow(((D / 2.0) * (M / d)), 2.0)))) * (sqrt((d / h)) * sqrt((d / l)));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.15d+94)) then
tmp = -d / sqrt((l * h))
else if (l <= 5d-308) then
tmp = (1.0d0 - (0.5d0 * ((h / l) * (((d_1 / 2.0d0) * (m / d)) ** 2.0d0)))) * (sqrt((d / h)) * sqrt((d / l)))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * ((h / l) * (-0.5d0)))) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.15e+94) {
tmp = -d / Math.sqrt((l * h));
} else if (l <= 5e-308) {
tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0)))) * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.15e+94: tmp = -d / math.sqrt((l * h)) elif l <= 5e-308: tmp = (1.0 - (0.5 * ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0)))) * (math.sqrt((d / h)) * math.sqrt((d / l))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * ((h / l) * -0.5))) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.15e+94) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); elseif (l <= 5e-308) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0)))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * Float64(Float64(h / l) * -0.5))) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.15e+94) tmp = -d / sqrt((l * h)); elseif (l <= 5e-308) tmp = (1.0 - (0.5 * ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0)))) * (sqrt((d / h)) * sqrt((d / l))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * ((h / l) * -0.5))) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.15e+94], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e-308], N[(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] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+94}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{-308}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}\right)\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.15e94Initial program 46.3%
Simplified46.3%
Applied egg-rr29.8%
Taylor expanded in d around -inf 59.5%
mul-1-neg59.5%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified59.8%
if -1.15e94 < l < 4.99999999999999955e-308Initial program 73.7%
Simplified72.4%
if 4.99999999999999955e-308 < l Initial program 59.6%
Simplified60.3%
Applied egg-rr67.8%
distribute-rgt1-in76.9%
+-commutative76.9%
associate-*l*76.9%
Simplified76.9%
Final simplification73.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= l -2.3e+250)
(/ (- d) (sqrt (* l h)))
(if (<= l -4e-310)
(*
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(+ 1.0 (* t_0 (pow (* D (/ (* 0.5 M) d)) 2.0))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) t_0))
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (l <= -2.3e+250) {
tmp = -d / sqrt((l * h));
} else if (l <= -4e-310) {
tmp = (sqrt((d / l)) / sqrt((h / d))) * (1.0 + (t_0 * pow((D * ((0.5 * M) / d)), 2.0)));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (h / l) * (-0.5d0)
if (l <= (-2.3d+250)) then
tmp = -d / sqrt((l * h))
else if (l <= (-4d-310)) then
tmp = (sqrt((d / l)) / sqrt((h / d))) * (1.0d0 + (t_0 * ((d_1 * ((0.5d0 * m) / d)) ** 2.0d0)))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * t_0)) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (l <= -2.3e+250) {
tmp = -d / Math.sqrt((l * h));
} else if (l <= -4e-310) {
tmp = (Math.sqrt((d / l)) / Math.sqrt((h / d))) * (1.0 + (t_0 * Math.pow((D * ((0.5 * M) / d)), 2.0)));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (h / l) * -0.5 tmp = 0 if l <= -2.3e+250: tmp = -d / math.sqrt((l * h)) elif l <= -4e-310: tmp = (math.sqrt((d / l)) / math.sqrt((h / d))) * (1.0 + (t_0 * math.pow((D * ((0.5 * M) / d)), 2.0))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (l <= -2.3e+250) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); elseif (l <= -4e-310) tmp = Float64(Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))) * Float64(1.0 + Float64(t_0 * (Float64(D * Float64(Float64(0.5 * M) / d)) ^ 2.0)))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * t_0)) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h / l) * -0.5; tmp = 0.0; if (l <= -2.3e+250) tmp = -d / sqrt((l * h)); elseif (l <= -4e-310) tmp = (sqrt((d / l)) / sqrt((h / d))) * (1.0 + (t_0 * ((D * ((0.5 * M) / d)) ^ 2.0))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * t_0)) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[l, -2.3e+250], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t$95$0 * N[Power[N[(D * N[(N[(0.5 * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{+250}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}} \cdot \left(1 + t_0 \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot t_0\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.3000000000000001e250Initial program 27.7%
Simplified27.7%
Applied egg-rr27.0%
Taylor expanded in d around -inf 87.1%
mul-1-neg87.1%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified87.5%
if -2.3000000000000001e250 < l < -3.999999999999988e-310Initial program 67.9%
Simplified66.9%
add-sqr-sqrt66.9%
pow266.9%
sqrt-prod66.9%
frac-times67.8%
*-commutative67.8%
frac-times67.8%
unpow267.8%
sqrt-prod40.8%
add-sqr-sqrt69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
metadata-eval69.7%
div-inv69.7%
associate-*r/70.7%
div-inv70.7%
metadata-eval70.7%
Applied egg-rr70.7%
clear-num70.7%
sqrt-div72.0%
metadata-eval72.0%
Applied egg-rr72.0%
expm1-log1p-u38.8%
expm1-udef30.8%
Applied egg-rr30.7%
expm1-def37.1%
expm1-log1p69.2%
associate-*r*69.2%
associate-/r/68.3%
*-commutative68.3%
Simplified68.3%
if -3.999999999999988e-310 < l Initial program 59.6%
Simplified60.3%
Applied egg-rr67.8%
distribute-rgt1-in76.9%
+-commutative76.9%
associate-*l*76.9%
Simplified76.9%
Final simplification73.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= l -5.5e+89)
(/ (- d) t_0)
(if (<= l -1e-308)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* (* 0.5 M) (/ D d)) 2.0))))
(if (<= l 3.35e+204)
(*
(/ d t_0)
(fma (pow (/ (* M D) (* d 2.0)) 2.0) (/ (* h -0.5) l) 1.0))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (l <= -5.5e+89) {
tmp = -d / t_0;
} else if (l <= -1e-308) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((h / l) * -0.5) * pow(((0.5 * M) * (D / d)), 2.0)));
} else if (l <= 3.35e+204) {
tmp = (d / t_0) * fma(pow(((M * D) / (d * 2.0)), 2.0), ((h * -0.5) / l), 1.0);
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (l <= -5.5e+89) tmp = Float64(Float64(-d) / t_0); elseif (l <= -1e-308) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)))); elseif (l <= 3.35e+204) tmp = Float64(Float64(d / t_0) * fma((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0), Float64(Float64(h * -0.5) / l), 1.0)); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5.5e+89], N[((-d) / t$95$0), $MachinePrecision], If[LessEqual[l, -1e-308], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.35e+204], N[(N[(d / t$95$0), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{+89}:\\
\;\;\;\;\frac{-d}{t_0}\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}\right)\\
\mathbf{elif}\;\ell \leq 3.35 \cdot 10^{+204}:\\
\;\;\;\;\frac{d}{t_0} \cdot \mathsf{fma}\left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.49999999999999976e89Initial program 46.3%
Simplified46.3%
Applied egg-rr29.8%
Taylor expanded in d around -inf 59.5%
mul-1-neg59.5%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified59.8%
if -5.49999999999999976e89 < l < -9.9999999999999991e-309Initial program 73.7%
Simplified72.4%
add-sqr-sqrt72.4%
pow272.4%
sqrt-prod72.4%
frac-times73.6%
*-commutative73.6%
frac-times73.6%
unpow273.6%
sqrt-prod44.0%
add-sqr-sqrt75.2%
div-inv75.2%
metadata-eval75.2%
Applied egg-rr75.2%
metadata-eval75.2%
div-inv75.2%
associate-*r/75.2%
div-inv75.2%
metadata-eval75.2%
Applied egg-rr75.2%
expm1-log1p-u32.1%
expm1-udef29.1%
Applied egg-rr24.9%
expm1-def26.7%
expm1-log1p66.5%
associate-*r*66.5%
associate-*r*66.5%
Simplified66.5%
if -9.9999999999999991e-309 < l < 3.35000000000000021e204Initial program 60.2%
Simplified61.0%
Applied egg-rr20.8%
Applied egg-rr69.8%
if 3.35000000000000021e204 < l Initial program 56.9%
Simplified56.9%
Taylor expanded in d around inf 52.6%
associate-/r*54.0%
sqrt-div83.0%
Applied egg-rr83.0%
Final simplification68.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= l -2e+92)
(/ (- d) (sqrt (* l h)))
(if (<= l -4e-310)
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* t_0 (pow (* (* 0.5 M) (/ D d)) 2.0))))
(*
(+ 1.0 (* (pow (* M (* 0.5 (/ D d))) 2.0) t_0))
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (l <= -2e+92) {
tmp = -d / sqrt((l * h));
} else if (l <= -4e-310) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (t_0 * pow(((0.5 * M) * (D / d)), 2.0)));
} else {
tmp = (1.0 + (pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (h / l) * (-0.5d0)
if (l <= (-2d+92)) then
tmp = -d / sqrt((l * h))
else if (l <= (-4d-310)) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + (t_0 * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)))
else
tmp = (1.0d0 + (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) * t_0)) * (d / (sqrt(l) * sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (l <= -2e+92) {
tmp = -d / Math.sqrt((l * h));
} else if (l <= -4e-310) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (t_0 * Math.pow(((0.5 * M) * (D / d)), 2.0)));
} else {
tmp = (1.0 + (Math.pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (Math.sqrt(l) * Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (h / l) * -0.5 tmp = 0 if l <= -2e+92: tmp = -d / math.sqrt((l * h)) elif l <= -4e-310: tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (t_0 * math.pow(((0.5 * M) * (D / d)), 2.0))) else: tmp = (1.0 + (math.pow((M * (0.5 * (D / d))), 2.0) * t_0)) * (d / (math.sqrt(l) * math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (l <= -2e+92) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); elseif (l <= -4e-310) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(t_0 * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)))); else tmp = Float64(Float64(1.0 + Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * t_0)) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (h / l) * -0.5; tmp = 0.0; if (l <= -2e+92) tmp = -d / sqrt((l * h)); elseif (l <= -4e-310) tmp = sqrt(((d / h) * (d / l))) * (1.0 + (t_0 * (((0.5 * M) * (D / d)) ^ 2.0))); else tmp = (1.0 + (((M * (0.5 * (D / d))) ^ 2.0) * t_0)) * (d / (sqrt(l) * sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[l, -2e+92], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(t$95$0 * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{+92}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + t_0 \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot t_0\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.0000000000000001e92Initial program 46.3%
Simplified46.3%
Applied egg-rr29.8%
Taylor expanded in d around -inf 59.5%
mul-1-neg59.5%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified59.8%
if -2.0000000000000001e92 < l < -3.999999999999988e-310Initial program 73.7%
Simplified72.4%
add-sqr-sqrt72.4%
pow272.4%
sqrt-prod72.4%
frac-times73.6%
*-commutative73.6%
frac-times73.6%
unpow273.6%
sqrt-prod44.0%
add-sqr-sqrt75.2%
div-inv75.2%
metadata-eval75.2%
Applied egg-rr75.2%
metadata-eval75.2%
div-inv75.2%
associate-*r/75.2%
div-inv75.2%
metadata-eval75.2%
Applied egg-rr75.2%
expm1-log1p-u32.1%
expm1-udef29.1%
Applied egg-rr24.9%
expm1-def26.7%
expm1-log1p66.5%
associate-*r*66.5%
associate-*r*66.5%
Simplified66.5%
if -3.999999999999988e-310 < l Initial program 59.6%
Simplified60.3%
Applied egg-rr67.8%
distribute-rgt1-in76.9%
+-commutative76.9%
associate-*l*76.9%
Simplified76.9%
Final simplification71.3%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.05e+91)
(/ (- d) (sqrt (* l h)))
(if (or (<= l 8.8e-187) (and (not (<= l 1.85e-134)) (<= l 2.2e+28)))
(*
(sqrt (* (/ d h) (/ d l)))
(+ 1.0 (* (* (/ h l) -0.5) (pow (* (* 0.5 M) (/ D d)) 2.0))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.05e+91) {
tmp = -d / sqrt((l * h));
} else if ((l <= 8.8e-187) || (!(l <= 1.85e-134) && (l <= 2.2e+28))) {
tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((h / l) * -0.5) * pow(((0.5 * M) * (D / d)), 2.0)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.05d+91)) then
tmp = -d / sqrt((l * h))
else if ((l <= 8.8d-187) .or. (.not. (l <= 1.85d-134)) .and. (l <= 2.2d+28)) then
tmp = sqrt(((d / h) * (d / l))) * (1.0d0 + (((h / l) * (-0.5d0)) * (((0.5d0 * m) * (d_1 / d)) ** 2.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.05e+91) {
tmp = -d / Math.sqrt((l * h));
} else if ((l <= 8.8e-187) || (!(l <= 1.85e-134) && (l <= 2.2e+28))) {
tmp = Math.sqrt(((d / h) * (d / l))) * (1.0 + (((h / l) * -0.5) * Math.pow(((0.5 * M) * (D / d)), 2.0)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.05e+91: tmp = -d / math.sqrt((l * h)) elif (l <= 8.8e-187) or (not (l <= 1.85e-134) and (l <= 2.2e+28)): tmp = math.sqrt(((d / h) * (d / l))) * (1.0 + (((h / l) * -0.5) * math.pow(((0.5 * M) * (D / d)), 2.0))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.05e+91) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); elseif ((l <= 8.8e-187) || (!(l <= 1.85e-134) && (l <= 2.2e+28))) tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(Float64(Float64(h / l) * -0.5) * (Float64(Float64(0.5 * M) * Float64(D / d)) ^ 2.0)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.05e+91) tmp = -d / sqrt((l * h)); elseif ((l <= 8.8e-187) || (~((l <= 1.85e-134)) && (l <= 2.2e+28))) tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((h / l) * -0.5) * (((0.5 * M) * (D / d)) ^ 2.0))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.05e+91], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 8.8e-187], And[N[Not[LessEqual[l, 1.85e-134]], $MachinePrecision], LessEqual[l, 2.2e+28]]], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 8.8 \cdot 10^{-187} \lor \neg \left(\ell \leq 1.85 \cdot 10^{-134}\right) \land \ell \leq 2.2 \cdot 10^{+28}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.05000000000000004e91Initial program 46.3%
Simplified46.3%
Applied egg-rr29.8%
Taylor expanded in d around -inf 59.5%
mul-1-neg59.5%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified59.8%
if -1.05000000000000004e91 < l < 8.80000000000000032e-187 or 1.85e-134 < l < 2.19999999999999986e28Initial program 74.9%
Simplified74.2%
add-sqr-sqrt74.1%
pow274.1%
sqrt-prod74.1%
frac-times74.8%
*-commutative74.8%
frac-times74.9%
unpow274.9%
sqrt-prod46.3%
add-sqr-sqrt75.8%
div-inv75.8%
metadata-eval75.8%
Applied egg-rr75.8%
metadata-eval75.8%
div-inv75.8%
associate-*r/75.8%
div-inv75.8%
metadata-eval75.8%
Applied egg-rr75.8%
expm1-log1p-u31.2%
expm1-udef29.5%
Applied egg-rr24.5%
expm1-def25.5%
expm1-log1p67.1%
associate-*r*67.1%
associate-*r*67.1%
Simplified67.1%
if 8.80000000000000032e-187 < l < 1.85e-134 or 2.19999999999999986e28 < l Initial program 48.9%
Simplified50.0%
Applied egg-rr19.6%
Taylor expanded in d around inf 46.9%
rem-exp-log43.5%
unpow-143.5%
metadata-eval43.5%
pow-sqr43.5%
rem-sqrt-square43.5%
sqr-pow43.5%
fabs-sqr43.5%
sqr-pow43.5%
rem-exp-log43.4%
exp-to-pow43.4%
metadata-eval43.4%
distribute-rgt-neg-in43.4%
exp-neg43.4%
log-rec43.4%
exp-to-pow43.4%
unpow1/243.4%
exp-sum43.5%
Simplified47.1%
*-commutative47.1%
sqrt-prod59.7%
Applied egg-rr59.7%
Final simplification63.6%
(FPCore (d h l M D) :precision binary64 (if (<= l 2.3e-307) (/ (- d) (sqrt (* l h))) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.3e-307) {
tmp = -d / sqrt((l * h));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 2.3d-307) then
tmp = -d / sqrt((l * h))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.3e-307) {
tmp = -d / Math.sqrt((l * h));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.3e-307: tmp = -d / math.sqrt((l * h)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.3e-307) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.3e-307) tmp = -d / sqrt((l * h)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.3e-307], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.3 \cdot 10^{-307}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 2.2999999999999999e-307Initial program 64.5%
Simplified63.6%
Applied egg-rr25.5%
Taylor expanded in d around -inf 44.3%
mul-1-neg44.3%
rem-exp-log0.1%
unpow-10.1%
metadata-eval0.1%
pow-sqr0.1%
rem-sqrt-square0.1%
sqr-pow0.1%
fabs-sqr0.1%
sqr-pow0.1%
rem-exp-log0.1%
exp-to-pow0.1%
metadata-eval0.1%
distribute-rgt-neg-in0.1%
exp-neg0.1%
log-rec0.1%
exp-to-pow0.1%
unpow1/20.1%
Simplified45.2%
if 2.2999999999999999e-307 < l Initial program 60.0%
Simplified60.7%
Applied egg-rr21.5%
Taylor expanded in d around inf 44.1%
rem-exp-log41.4%
unpow-141.4%
metadata-eval41.4%
pow-sqr41.4%
rem-sqrt-square41.4%
sqr-pow41.4%
fabs-sqr41.4%
sqr-pow41.4%
rem-exp-log41.2%
exp-to-pow41.2%
metadata-eval41.2%
distribute-rgt-neg-in41.2%
exp-neg41.2%
log-rec41.2%
exp-to-pow41.2%
unpow1/241.2%
exp-sum41.2%
Simplified44.1%
*-commutative44.1%
sqrt-prod52.6%
Applied egg-rr52.6%
Final simplification49.3%
(FPCore (d h l M D) :precision binary64 (if (<= d -1e-194) (/ (- d) (sqrt (* l h))) (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1e-194) {
tmp = -d / sqrt((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 <= (-1d-194)) then
tmp = -d / sqrt((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 <= -1e-194) {
tmp = -d / Math.sqrt((l * h));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1e-194: tmp = -d / math.sqrt((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 <= -1e-194) tmp = Float64(Float64(-d) / sqrt(Float64(l * h))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1e-194) tmp = -d / sqrt((l * h)); else tmp = d * sqrt(((1.0 / l) / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1e-194], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1 \cdot 10^{-194}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if d < -1.00000000000000002e-194Initial program 68.1%
Simplified67.1%
Applied egg-rr27.3%
Taylor expanded in d around -inf 48.7%
mul-1-neg48.7%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified49.7%
if -1.00000000000000002e-194 < d Initial program 58.2%
Simplified58.8%
Taylor expanded in d around inf 42.0%
*-commutative42.0%
associate-/r*42.2%
Simplified42.2%
Final simplification45.1%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (* l h)))) (if (<= d -9.5e-195) (/ (- d) t_0) (/ d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (d <= -9.5e-195) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((l * h))
if (d <= (-9.5d-195)) then
tmp = -d / t_0
else
tmp = d / t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double tmp;
if (d <= -9.5e-195) {
tmp = -d / t_0;
} else {
tmp = d / t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if d <= -9.5e-195: tmp = -d / t_0 else: tmp = d / t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (d <= -9.5e-195) tmp = Float64(Float64(-d) / t_0); else tmp = Float64(d / t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (d <= -9.5e-195) tmp = -d / t_0; else tmp = d / t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -9.5e-195], N[((-d) / t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;d \leq -9.5 \cdot 10^{-195}:\\
\;\;\;\;\frac{-d}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{t_0}\\
\end{array}
\end{array}
if d < -9.5000000000000007e-195Initial program 68.1%
Simplified67.1%
Applied egg-rr27.3%
Taylor expanded in d around -inf 48.7%
mul-1-neg48.7%
rem-exp-log0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
sqr-pow0.0%
fabs-sqr0.0%
sqr-pow0.0%
rem-exp-log0.0%
exp-to-pow0.0%
metadata-eval0.0%
distribute-rgt-neg-in0.0%
exp-neg0.0%
log-rec0.0%
exp-to-pow0.0%
unpow1/20.0%
Simplified49.7%
if -9.5000000000000007e-195 < d Initial program 58.2%
Simplified58.8%
Applied egg-rr20.8%
Taylor expanded in d around inf 42.0%
rem-exp-log37.4%
unpow-137.4%
metadata-eval37.4%
pow-sqr37.4%
rem-sqrt-square37.4%
sqr-pow37.4%
fabs-sqr37.4%
sqr-pow37.4%
rem-exp-log37.2%
exp-to-pow37.2%
metadata-eval37.2%
distribute-rgt-neg-in37.2%
exp-neg37.2%
log-rec37.2%
exp-to-pow37.2%
unpow1/237.2%
exp-sum37.2%
Simplified42.1%
Final simplification45.0%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 62.0%
Simplified62.0%
Applied egg-rr23.3%
Taylor expanded in d around inf 28.2%
rem-exp-log22.8%
unpow-122.8%
metadata-eval22.8%
pow-sqr22.8%
rem-sqrt-square22.8%
sqr-pow22.8%
fabs-sqr22.8%
sqr-pow22.8%
rem-exp-log22.7%
exp-to-pow22.7%
metadata-eval22.7%
distribute-rgt-neg-in22.7%
exp-neg22.7%
log-rec22.7%
exp-to-pow22.7%
unpow1/222.7%
exp-sum22.7%
Simplified28.2%
Final simplification28.2%
herbie shell --seed 2023333
(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)))))