
(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 28 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}
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= h -8.5e+132)
(*
(sqrt (/ d l))
(*
(/ t_0 (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D_m (/ (/ M 2.0) d)) 2.0) -0.5)))))
(if (<= h -1e-310)
(*
(* (sqrt (/ d h)) (/ t_0 (sqrt (- l))))
(- 1.0 (* 0.5 (pow (* (* (/ M d) (/ D_m 2.0)) (sqrt (/ h l))) 2.0))))
(*
d
(/
(fma h (* (pow (* M (/ D_m (* d 2.0))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -8.5e+132) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * (1.0 + ((h / l) * (pow((D_m * ((M / 2.0) / d)), 2.0) * -0.5))));
} else if (h <= -1e-310) {
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 - (0.5 * pow((((M / d) * (D_m / 2.0)) * sqrt((h / l))), 2.0)));
} else {
tmp = d * (fma(h, (pow((M * (D_m / (d * 2.0))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -8.5e+132) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D_m * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); elseif (h <= -1e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(0.5 * (Float64(Float64(Float64(M / d) * Float64(D_m / 2.0)) * sqrt(Float64(h / l))) ^ 2.0)))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -8.5e+132], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D$95$m * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], 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[(M / d), $MachinePrecision] * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;h \leq -8.5 \cdot 10^{+132}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D\_m \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{M}{d} \cdot \frac{D\_m}{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -8.49999999999999969e132Initial program 56.0%
Simplified56.0%
frac-2neg56.0%
sqrt-div82.6%
Applied egg-rr82.6%
if -8.49999999999999969e132 < h < -9.999999999999969e-311Initial program 73.0%
Simplified71.9%
add-sqr-sqrt71.9%
pow271.9%
sqrt-prod72.0%
sqrt-pow173.1%
metadata-eval73.1%
pow173.1%
frac-times74.1%
*-commutative74.1%
times-frac73.0%
Applied egg-rr73.0%
frac-2neg73.0%
sqrt-div83.6%
Applied egg-rr83.6%
if -9.999999999999969e-311 < h Initial program 68.9%
pow168.9%
Applied egg-rr80.3%
unpow180.3%
associate-*l/81.9%
associate-/l*81.9%
Simplified88.7%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (- d)))
(t_1 (+ 1.0 (* (/ h l) (* (pow (* D_m (/ (/ M 2.0) d)) 2.0) -0.5)))))
(if (<= h -3.1e+127)
(* (sqrt (/ d l)) (* (/ t_0 (sqrt (- h))) t_1))
(if (<= h -1e-310)
(* (/ t_0 (sqrt (- l))) (* t_1 (sqrt (/ d h))))
(*
d
(/
(fma h (* (pow (* M (/ D_m (* d 2.0))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt(-d);
double t_1 = 1.0 + ((h / l) * (pow((D_m * ((M / 2.0) / d)), 2.0) * -0.5));
double tmp;
if (h <= -3.1e+127) {
tmp = sqrt((d / l)) * ((t_0 / sqrt(-h)) * t_1);
} else if (h <= -1e-310) {
tmp = (t_0 / sqrt(-l)) * (t_1 * sqrt((d / h)));
} else {
tmp = d * (fma(h, (pow((M * (D_m / (d * 2.0))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(-d)) t_1 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(D_m * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))) tmp = 0.0 if (h <= -3.1e+127) tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_0 / sqrt(Float64(-h))) * t_1)); elseif (h <= -1e-310) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(t_1 * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D$95$m * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.1e+127], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := 1 + \frac{h}{\ell} \cdot \left({\left(D\_m \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\\
\mathbf{if}\;h \leq -3.1 \cdot 10^{+127}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot t\_1\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-\ell}} \cdot \left(t\_1 \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -3.1000000000000002e127Initial program 56.0%
Simplified56.0%
frac-2neg56.0%
sqrt-div82.6%
Applied egg-rr82.6%
if -3.1000000000000002e127 < h < -9.999999999999969e-311Initial program 73.0%
Simplified71.9%
frac-2neg73.0%
sqrt-div83.6%
Applied egg-rr83.5%
if -9.999999999999969e-311 < h Initial program 68.9%
pow168.9%
Applied egg-rr80.3%
unpow180.3%
associate-*l/81.9%
associate-/l*81.9%
Simplified88.7%
Final simplification86.1%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -4e-310)
(*
(sqrt (/ d l))
(*
(/ (sqrt (- d)) (sqrt (- h)))
(+ 1.0 (* (/ h l) (* (pow (* D_m (/ (/ M 2.0) d)) 2.0) -0.5)))))
(*
d
(/
(fma h (* (pow (* M (/ D_m (* d 2.0))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -4e-310) {
tmp = sqrt((d / l)) * ((sqrt(-d) / sqrt(-h)) * (1.0 + ((h / l) * (pow((D_m * ((M / 2.0) / d)), 2.0) * -0.5))));
} else {
tmp = d * (fma(h, (pow((M * (D_m / (d * 2.0))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) 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((Float64(D_m * Float64(Float64(M / 2.0) / d)) ^ 2.0) * -0.5))))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := 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[(N[Power[N[(D$95$m * N[(N[(M / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\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({\left(D\_m \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 68.3%
Simplified67.6%
frac-2neg67.6%
sqrt-div78.6%
Applied egg-rr78.6%
if -3.999999999999988e-310 < l Initial program 68.9%
pow168.9%
Applied egg-rr80.3%
unpow180.3%
associate-*l/81.9%
associate-/l*81.9%
Simplified88.7%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<= h -3.1e+159)
(*
(/ (sqrt (- d)) (sqrt (- h)))
(* t_0 (* h (* (/ -0.125 l) (pow (/ M (/ d D_m)) 2.0)))))
(if (<= h 1.8e-246)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* 0.5 (/ (* D_m M) d)) 2.0)) l)))
(* t_0 (sqrt (/ d h))))
(*
d
(/
(fma h (* (pow (* M (/ D_m (* d 2.0))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt((d / l));
double tmp;
if (h <= -3.1e+159) {
tmp = (sqrt(-d) / sqrt(-h)) * (t_0 * (h * ((-0.125 / l) * pow((M / (d / D_m)), 2.0))));
} else if (h <= 1.8e-246) {
tmp = (1.0 - (0.5 * ((h * pow((0.5 * ((D_m * M) / d)), 2.0)) / l))) * (t_0 * sqrt((d / h)));
} else {
tmp = d * (fma(h, (pow((M * (D_m / (d * 2.0))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -3.1e+159) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * Float64(t_0 * Float64(h * Float64(Float64(-0.125 / l) * (Float64(M / Float64(d / D_m)) ^ 2.0))))); elseif (h <= 1.8e-246) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(0.5 * Float64(Float64(D_m * M) / d)) ^ 2.0)) / l))) * Float64(t_0 * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -3.1e+159], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(M / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.8e-246], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(0.5 * N[(N[(D$95$m * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -3.1 \cdot 10^{+159}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t\_0 \cdot \left(h \cdot \left(\frac{-0.125}{\ell} \cdot {\left(\frac{M}{\frac{d}{D\_m}}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;h \leq 1.8 \cdot 10^{-246}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(0.5 \cdot \frac{D\_m \cdot M}{d}\right)}^{2}}{\ell}\right) \cdot \left(t\_0 \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -3.0999999999999998e159Initial program 55.5%
Simplified55.4%
Taylor expanded in M around inf 19.1%
associate-*r/19.1%
associate-*r*19.1%
associate-*r*19.1%
associate-*l/22.7%
associate-*r/22.7%
*-commutative22.7%
associate-*r/22.7%
*-commutative22.7%
times-frac22.7%
*-commutative22.7%
associate-/l*22.7%
unpow222.7%
unpow222.7%
unpow222.7%
times-frac37.4%
swap-sqr41.1%
associate-/l*41.1%
Simplified41.2%
frac-2neg55.5%
sqrt-div85.3%
Applied egg-rr71.1%
if -3.0999999999999998e159 < h < 1.8000000000000001e-246Initial program 71.7%
Simplified70.8%
associate-*r/72.9%
frac-times73.8%
*-commutative73.8%
times-frac71.9%
Applied egg-rr71.9%
*-commutative71.9%
associate-/l*70.9%
times-frac72.9%
associate-/l*72.0%
Simplified72.0%
associate-*r/72.9%
associate-*r/73.8%
*-commutative73.8%
*-un-lft-identity73.8%
*-commutative73.8%
times-frac73.8%
metadata-eval73.8%
*-commutative73.8%
Applied egg-rr73.8%
if 1.8000000000000001e-246 < h Initial program 69.0%
pow169.0%
Applied egg-rr81.7%
unpow181.7%
associate-*l/83.4%
associate-/l*83.4%
Simplified89.0%
Final simplification81.0%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= h 1.9e-246)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* 0.5 (/ (* D_m M) d)) 2.0)) l)))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
d
(/
(fma h (* (pow (* M (/ D_m (* d 2.0))) 2.0) (/ -0.5 l)) 1.0)
(* (sqrt l) (sqrt h))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (h <= 1.9e-246) {
tmp = (1.0 - (0.5 * ((h * pow((0.5 * ((D_m * M) / d)), 2.0)) / l))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = d * (fma(h, (pow((M * (D_m / (d * 2.0))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (h <= 1.9e-246) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(0.5 * Float64(Float64(D_m * M) / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(d * Float64(fma(h, Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[h, 1.9e-246], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(0.5 * N[(N[(D$95$m * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 1.9 \cdot 10^{-246}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(0.5 \cdot \frac{D\_m \cdot M}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < 1.89999999999999988e-246Initial program 68.3%
Simplified67.6%
associate-*r/68.5%
frac-times69.3%
*-commutative69.3%
times-frac67.7%
Applied egg-rr67.7%
*-commutative67.7%
associate-/l*67.7%
times-frac69.3%
associate-/l*68.6%
Simplified68.6%
associate-*r/68.5%
associate-*r/69.3%
*-commutative69.3%
*-un-lft-identity69.3%
*-commutative69.3%
times-frac69.3%
metadata-eval69.3%
*-commutative69.3%
Applied egg-rr69.3%
if 1.89999999999999988e-246 < h Initial program 69.0%
pow169.0%
Applied egg-rr81.7%
unpow181.7%
associate-*l/83.4%
associate-/l*83.4%
Simplified89.0%
Final simplification79.0%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -1.9e-129)
(* (- d) (pow (* h l) -0.5))
(if (<= l -9.8e-203)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -7.5e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -4e-310)
(* d (sqrt (log (exp (/ (/ 1.0 l) h)))))
(if (<= l 1.35e-190)
(* 0.125 (/ (* (pow (* D_m M) 2.0) (- (sqrt (/ h (pow l 3.0))))) d))
(* d (* (pow h -0.5) (pow l -0.5)))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -1.9e-129) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -9.8e-203) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
} else if (l <= 1.35e-190) {
tmp = 0.125 * ((pow((D_m * M), 2.0) * -sqrt((h / pow(l, 3.0)))) / d);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (l <= (-1.9d-129)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= (-9.8d-203)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= (-7.5d-222)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (l <= (-4d-310)) then
tmp = d * sqrt(log(exp(((1.0d0 / l) / h))))
else if (l <= 1.35d-190) then
tmp = 0.125d0 * ((((d_m * m) ** 2.0d0) * -sqrt((h / (l ** 3.0d0)))) / d)
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -1.9e-129) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -9.8e-203) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / l) / h))));
} else if (l <= 1.35e-190) {
tmp = 0.125 * ((Math.pow((D_m * M), 2.0) * -Math.sqrt((h / Math.pow(l, 3.0)))) / d);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if l <= -1.9e-129: tmp = -d * math.pow((h * l), -0.5) elif l <= -9.8e-203: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -7.5e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -4e-310: tmp = d * math.sqrt(math.log(math.exp(((1.0 / l) / h)))) elif l <= 1.35e-190: tmp = 0.125 * ((math.pow((D_m * M), 2.0) * -math.sqrt((h / math.pow(l, 3.0)))) / d) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -1.9e-129) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -9.8e-203) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -7.5e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -4e-310) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / l) / h))))); elseif (l <= 1.35e-190) tmp = Float64(0.125 * Float64(Float64((Float64(D_m * M) ^ 2.0) * Float64(-sqrt(Float64(h / (l ^ 3.0))))) / d)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (l <= -1.9e-129)
tmp = -d * ((h * l) ^ -0.5);
elseif (l <= -9.8e-203)
tmp = d * (((h * l) ^ 2.0) ^ -0.25);
elseif (l <= -7.5e-222)
tmp = sqrt((d / l)) * sqrt((d / h));
elseif (l <= -4e-310)
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
elseif (l <= 1.35e-190)
tmp = 0.125 * ((((D_m * M) ^ 2.0) * -sqrt((h / (l ^ 3.0)))) / d);
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -1.9e-129], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -9.8e-203], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7.5e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.35e-190], N[(0.125 * N[(N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] * (-N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{-129}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -9.8 \cdot 10^{-203}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -7.5 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{\ell}}{h}}\right)}\\
\mathbf{elif}\;\ell \leq 1.35 \cdot 10^{-190}:\\
\;\;\;\;0.125 \cdot \frac{{\left(D\_m \cdot M\right)}^{2} \cdot \left(-\sqrt{\frac{h}{{\ell}^{3}}}\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.89999999999999992e-129Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -1.89999999999999992e-129 < l < -9.7999999999999999e-203Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -9.7999999999999999e-203 < l < -7.5000000000000004e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -7.5000000000000004e-222 < l < -3.999999999999988e-310Initial program 83.3%
Taylor expanded in d around inf 24.4%
*-commutative24.4%
Simplified24.4%
add-log-exp78.0%
associate-/r*78.0%
Applied egg-rr78.0%
if -3.999999999999988e-310 < l < 1.35e-190Initial program 71.1%
Taylor expanded in d around 0 52.1%
*-commutative52.1%
associate-*l*52.1%
*-commutative52.1%
associate-/l*45.2%
Simplified45.2%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt52.1%
associate-*l*52.1%
*-commutative52.1%
unpow252.1%
unpow252.1%
swap-sqr66.0%
unpow266.0%
*-commutative66.0%
mul-1-neg66.0%
Simplified66.0%
if 1.35e-190 < l Initial program 68.3%
Taylor expanded in d around inf 51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in l around 0 51.4%
unpow-151.4%
metadata-eval51.4%
pow-sqr51.4%
rem-sqrt-square51.4%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt51.4%
Simplified51.4%
*-commutative51.4%
unpow-prod-down58.6%
Applied egg-rr58.6%
Final simplification56.3%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -6.2e-130)
(* (- d) (pow (* h l) -0.5))
(if (<= l -3.1e-204)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -5e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -4e-310)
(* d (sqrt (log (exp (/ (/ 1.0 l) h)))))
(if (<= l 3.4e-190)
(* (/ (pow (* D_m M) 2.0) d) (* -0.125 (sqrt (/ h (pow l 3.0)))))
(* d (* (pow h -0.5) (pow l -0.5)))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -6.2e-130) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -3.1e-204) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -5e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
} else if (l <= 3.4e-190) {
tmp = (pow((D_m * M), 2.0) / d) * (-0.125 * sqrt((h / pow(l, 3.0))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (l <= (-6.2d-130)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= (-3.1d-204)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= (-5d-222)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (l <= (-4d-310)) then
tmp = d * sqrt(log(exp(((1.0d0 / l) / h))))
else if (l <= 3.4d-190) then
tmp = (((d_m * m) ** 2.0d0) / d) * ((-0.125d0) * sqrt((h / (l ** 3.0d0))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -6.2e-130) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -3.1e-204) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -5e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / l) / h))));
} else if (l <= 3.4e-190) {
tmp = (Math.pow((D_m * M), 2.0) / d) * (-0.125 * Math.sqrt((h / Math.pow(l, 3.0))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if l <= -6.2e-130: tmp = -d * math.pow((h * l), -0.5) elif l <= -3.1e-204: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -5e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -4e-310: tmp = d * math.sqrt(math.log(math.exp(((1.0 / l) / h)))) elif l <= 3.4e-190: tmp = (math.pow((D_m * M), 2.0) / d) * (-0.125 * math.sqrt((h / math.pow(l, 3.0)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -6.2e-130) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -3.1e-204) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -5e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -4e-310) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / l) / h))))); elseif (l <= 3.4e-190) tmp = Float64(Float64((Float64(D_m * M) ^ 2.0) / d) * Float64(-0.125 * sqrt(Float64(h / (l ^ 3.0))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (l <= -6.2e-130)
tmp = -d * ((h * l) ^ -0.5);
elseif (l <= -3.1e-204)
tmp = d * (((h * l) ^ 2.0) ^ -0.25);
elseif (l <= -5e-222)
tmp = sqrt((d / l)) * sqrt((d / h));
elseif (l <= -4e-310)
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
elseif (l <= 3.4e-190)
tmp = (((D_m * M) ^ 2.0) / d) * (-0.125 * sqrt((h / (l ^ 3.0))));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -6.2e-130], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.1e-204], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.4e-190], N[(N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(-0.125 * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-130}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -3.1 \cdot 10^{-204}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{\ell}}{h}}\right)}\\
\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{-190}:\\
\;\;\;\;\frac{{\left(D\_m \cdot M\right)}^{2}}{d} \cdot \left(-0.125 \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.20000000000000021e-130Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -6.20000000000000021e-130 < l < -3.0999999999999999e-204Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -3.0999999999999999e-204 < l < -5.00000000000000008e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -5.00000000000000008e-222 < l < -3.999999999999988e-310Initial program 83.3%
Taylor expanded in d around inf 24.4%
*-commutative24.4%
Simplified24.4%
add-log-exp78.0%
associate-/r*78.0%
Applied egg-rr78.0%
if -3.999999999999988e-310 < l < 3.39999999999999981e-190Initial program 71.1%
Taylor expanded in d around 0 52.1%
*-commutative52.1%
associate-*l*52.1%
*-commutative52.1%
associate-/l*45.2%
Simplified45.2%
associate-*r/52.1%
pow-prod-down66.0%
Applied egg-rr66.0%
if 3.39999999999999981e-190 < l Initial program 68.3%
Taylor expanded in d around inf 51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in l around 0 51.4%
unpow-151.4%
metadata-eval51.4%
pow-sqr51.4%
rem-sqrt-square51.4%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt51.4%
Simplified51.4%
*-commutative51.4%
unpow-prod-down58.6%
Applied egg-rr58.6%
Final simplification56.3%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (sqrt (/ d l))))
(if (<= (* D_m M) 2.8e-27)
(* t_1 t_0)
(if (<= (* D_m M) 5e+31)
(*
(sqrt (* (/ d l) (/ d h)))
(fma (pow (* D_m (* 0.5 (/ M d))) 2.0) (* (/ h l) -0.5) 1.0))
(* t_0 (* t_1 (* h (* (/ -0.125 l) (pow (/ M (/ d D_m)) 2.0)))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double tmp;
if ((D_m * M) <= 2.8e-27) {
tmp = t_1 * t_0;
} else if ((D_m * M) <= 5e+31) {
tmp = sqrt(((d / l) * (d / h))) * fma(pow((D_m * (0.5 * (M / d))), 2.0), ((h / l) * -0.5), 1.0);
} else {
tmp = t_0 * (t_1 * (h * ((-0.125 / l) * pow((M / (d / D_m)), 2.0))));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (Float64(D_m * M) <= 2.8e-27) tmp = Float64(t_1 * t_0); elseif (Float64(D_m * M) <= 5e+31) tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * fma((Float64(D_m * Float64(0.5 * Float64(M / d))) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0)); else tmp = Float64(t_0 * Float64(t_1 * Float64(h * Float64(Float64(-0.125 / l) * (Float64(M / Float64(d / D_m)) ^ 2.0))))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(D$95$m * M), $MachinePrecision], 2.8e-27], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[N[(D$95$m * M), $MachinePrecision], 5e+31], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(D$95$m * N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(M / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;D\_m \cdot M \leq 2.8 \cdot 10^{-27}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{elif}\;D\_m \cdot M \leq 5 \cdot 10^{+31}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \mathsf{fma}\left({\left(D\_m \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(h \cdot \left(\frac{-0.125}{\ell} \cdot {\left(\frac{M}{\frac{d}{D\_m}}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 2.8e-27Initial program 70.1%
Simplified69.8%
Taylor expanded in M around 0 45.0%
if 2.8e-27 < (*.f64 M D) < 5.00000000000000027e31Initial program 61.4%
Simplified61.4%
fma-undefine61.4%
metadata-eval61.4%
associate-*r/61.4%
times-frac61.4%
*-un-lft-identity61.4%
*-commutative61.4%
times-frac61.6%
Applied egg-rr61.6%
pow1/261.6%
sqr-pow61.6%
pow261.6%
metadata-eval61.6%
Applied egg-rr61.6%
pow-pow61.6%
metadata-eval61.6%
pow1/261.6%
pow161.6%
Applied egg-rr55.4%
unpow155.4%
unpow1/255.4%
*-commutative55.4%
associate-*l*55.4%
*-commutative55.4%
Simplified55.4%
if 5.00000000000000027e31 < (*.f64 M D) Initial program 65.0%
Simplified65.1%
Taylor expanded in M around inf 43.8%
associate-*r/43.8%
associate-*r*45.9%
associate-*r*45.9%
associate-*l/45.9%
associate-*r/45.9%
*-commutative45.9%
associate-*r/45.9%
*-commutative45.9%
times-frac52.5%
*-commutative52.5%
associate-/l*52.5%
unpow252.5%
unpow252.5%
unpow252.5%
times-frac59.0%
swap-sqr61.1%
associate-/l*61.1%
Simplified61.1%
Final simplification48.6%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (/ (/ 1.0 l) h)))
(if (<= l -2e-128)
(* (- d) (pow (* h l) -0.5))
(if (<= l -1.7e-204)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -4.6e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -4e-310)
(* d (sqrt (log (exp t_0))))
(if (<= l 1.16e-223)
(log1p (expm1 (* (- d) (sqrt t_0))))
(* d (* (pow h -0.5) (pow l -0.5))))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = (1.0 / l) / h;
double tmp;
if (l <= -2e-128) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -1.7e-204) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -4.6e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * sqrt(log(exp(t_0)));
} else if (l <= 1.16e-223) {
tmp = log1p(expm1((-d * sqrt(t_0))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = (1.0 / l) / h;
double tmp;
if (l <= -2e-128) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -1.7e-204) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -4.6e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp(t_0)));
} else if (l <= 1.16e-223) {
tmp = Math.log1p(Math.expm1((-d * Math.sqrt(t_0))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = (1.0 / l) / h tmp = 0 if l <= -2e-128: tmp = -d * math.pow((h * l), -0.5) elif l <= -1.7e-204: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -4.6e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -4e-310: tmp = d * math.sqrt(math.log(math.exp(t_0))) elif l <= 1.16e-223: tmp = math.log1p(math.expm1((-d * math.sqrt(t_0)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = Float64(Float64(1.0 / l) / h) tmp = 0.0 if (l <= -2e-128) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -1.7e-204) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -4.6e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -4e-310) tmp = Float64(d * sqrt(log(exp(t_0)))); elseif (l <= 1.16e-223) tmp = log1p(expm1(Float64(Float64(-d) * sqrt(t_0)))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]}, If[LessEqual[l, -2e-128], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.7e-204], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.6e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Sqrt[N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.16e-223], N[Log[1 + N[(Exp[N[((-d) * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{\ell}}{h}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-128}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -1.7 \cdot 10^{-204}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{t\_0}\right)}\\
\mathbf{elif}\;\ell \leq 1.16 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\left(-d\right) \cdot \sqrt{t\_0}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.00000000000000011e-128Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -2.00000000000000011e-128 < l < -1.7000000000000001e-204Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -1.7000000000000001e-204 < l < -4.6000000000000003e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -4.6000000000000003e-222 < l < -3.999999999999988e-310Initial program 83.3%
Taylor expanded in d around inf 24.4%
*-commutative24.4%
Simplified24.4%
add-log-exp78.0%
associate-/r*78.0%
Applied egg-rr78.0%
if -3.999999999999988e-310 < l < 1.16e-223Initial program 76.4%
Taylor expanded in d around inf 19.3%
*-commutative19.3%
Simplified19.3%
log1p-expm1-u9.1%
pow1/29.1%
inv-pow9.1%
pow-pow9.1%
*-commutative9.1%
metadata-eval9.1%
Applied egg-rr9.1%
Taylor expanded in h around -inf 0.0%
expm1-define0.0%
*-commutative0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.3%
mul-1-neg48.3%
*-commutative48.3%
associate-/r*48.3%
Simplified48.3%
if 1.16e-223 < l Initial program 67.6%
Taylor expanded in d around inf 48.7%
*-commutative48.7%
Simplified48.7%
Taylor expanded in l around 0 48.7%
unpow-148.7%
metadata-eval48.7%
pow-sqr48.7%
rem-sqrt-square48.7%
rem-square-sqrt48.5%
fabs-sqr48.5%
rem-square-sqrt48.7%
Simplified48.7%
*-commutative48.7%
unpow-prod-down56.1%
Applied egg-rr56.1%
Final simplification53.6%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= d -2.4e-174)
(*
(- 1.0 (* 0.5 (/ (* h (pow (* 0.5 (/ (* D_m M) d)) 2.0)) l)))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(if (<= d 2.3e-293)
(/ (* -0.125 (* (pow (* D_m M) 2.0) (- (sqrt (/ h (pow l 3.0)))))) d)
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (/ M d) (/ D_m 2.0)) 2.0))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -2.4e-174) {
tmp = (1.0 - (0.5 * ((h * pow((0.5 * ((D_m * M) / d)), 2.0)) / l))) * (sqrt((d / l)) * sqrt((d / h)));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (pow((D_m * M), 2.0) * -sqrt((h / pow(l, 3.0))))) / d;
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (d <= (-2.4d-174)) then
tmp = (1.0d0 - (0.5d0 * ((h * ((0.5d0 * ((d_m * m) / d)) ** 2.0d0)) / l))) * (sqrt((d / l)) * sqrt((d / h)))
else if (d <= 2.3d-293) then
tmp = ((-0.125d0) * (((d_m * m) ** 2.0d0) * -sqrt((h / (l ** 3.0d0))))) / d
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * (((m / d) * (d_m / 2.0d0)) ** 2.0d0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -2.4e-174) {
tmp = (1.0 - (0.5 * ((h * Math.pow((0.5 * ((D_m * M) / d)), 2.0)) / l))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (Math.pow((D_m * M), 2.0) * -Math.sqrt((h / Math.pow(l, 3.0))))) / d;
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if d <= -2.4e-174: tmp = (1.0 - (0.5 * ((h * math.pow((0.5 * ((D_m * M) / d)), 2.0)) / l))) * (math.sqrt((d / l)) * math.sqrt((d / h))) elif d <= 2.3e-293: tmp = (-0.125 * (math.pow((D_m * M), 2.0) * -math.sqrt((h / math.pow(l, 3.0))))) / d else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow(((M / d) * (D_m / 2.0)), 2.0)))) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (d <= -2.4e-174) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(0.5 * Float64(Float64(D_m * M) / d)) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); elseif (d <= 2.3e-293) tmp = Float64(Float64(-0.125 * Float64((Float64(D_m * M) ^ 2.0) * Float64(-sqrt(Float64(h / (l ^ 3.0)))))) / d); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M / d) * Float64(D_m / 2.0)) ^ 2.0))))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (d <= -2.4e-174)
tmp = (1.0 - (0.5 * ((h * ((0.5 * ((D_m * M) / d)) ^ 2.0)) / l))) * (sqrt((d / l)) * sqrt((d / h)));
elseif (d <= 2.3e-293)
tmp = (-0.125 * (((D_m * M) ^ 2.0) * -sqrt((h / (l ^ 3.0))))) / d;
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * (((M / d) * (D_m / 2.0)) ^ 2.0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, -2.4e-174], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(0.5 * N[(N[(D$95$m * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.3e-293], N[(N[(-0.125 * N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] * (-N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.4 \cdot 10^{-174}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(0.5 \cdot \frac{D\_m \cdot M}{d}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;d \leq 2.3 \cdot 10^{-293}:\\
\;\;\;\;\frac{-0.125 \cdot \left({\left(D\_m \cdot M\right)}^{2} \cdot \left(-\sqrt{\frac{h}{{\ell}^{3}}}\right)\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M}{d} \cdot \frac{D\_m}{2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -2.4e-174Initial program 75.5%
Simplified75.5%
associate-*r/76.8%
frac-times76.8%
*-commutative76.8%
times-frac75.8%
Applied egg-rr75.8%
*-commutative75.8%
associate-/l*75.8%
times-frac76.9%
associate-/l*76.8%
Simplified76.8%
associate-*r/76.8%
associate-*r/76.8%
*-commutative76.8%
*-un-lft-identity76.8%
*-commutative76.8%
times-frac76.8%
metadata-eval76.8%
*-commutative76.8%
Applied egg-rr76.8%
if -2.4e-174 < d < 2.29999999999999995e-293Initial program 42.8%
Simplified42.8%
frac-2neg42.8%
sqrt-div62.1%
Applied egg-rr62.1%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r/0.0%
Simplified59.1%
if 2.29999999999999995e-293 < d Initial program 69.7%
pow169.7%
Applied egg-rr81.4%
unpow181.4%
associate-/r*80.1%
Simplified80.1%
Final simplification76.3%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= d -1.1e-173)
(*
(- 1.0 (* 0.5 (* h (/ (pow (* M (/ D_m (* d 2.0))) 2.0) l))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(if (<= d 2.3e-293)
(/ (* -0.125 (* (pow (* D_m M) 2.0) (- (sqrt (/ h (pow l 3.0)))))) d)
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (/ M d) (/ D_m 2.0)) 2.0))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -1.1e-173) {
tmp = (1.0 - (0.5 * (h * (pow((M * (D_m / (d * 2.0))), 2.0) / l)))) * (sqrt((d / l)) * sqrt((d / h)));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (pow((D_m * M), 2.0) * -sqrt((h / pow(l, 3.0))))) / d;
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (d <= (-1.1d-173)) then
tmp = (1.0d0 - (0.5d0 * (h * (((m * (d_m / (d * 2.0d0))) ** 2.0d0) / l)))) * (sqrt((d / l)) * sqrt((d / h)))
else if (d <= 2.3d-293) then
tmp = ((-0.125d0) * (((d_m * m) ** 2.0d0) * -sqrt((h / (l ** 3.0d0))))) / d
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * (((m / d) * (d_m / 2.0d0)) ** 2.0d0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -1.1e-173) {
tmp = (1.0 - (0.5 * (h * (Math.pow((M * (D_m / (d * 2.0))), 2.0) / l)))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (Math.pow((D_m * M), 2.0) * -Math.sqrt((h / Math.pow(l, 3.0))))) / d;
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if d <= -1.1e-173: tmp = (1.0 - (0.5 * (h * (math.pow((M * (D_m / (d * 2.0))), 2.0) / l)))) * (math.sqrt((d / l)) * math.sqrt((d / h))) elif d <= 2.3e-293: tmp = (-0.125 * (math.pow((D_m * M), 2.0) * -math.sqrt((h / math.pow(l, 3.0))))) / d else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow(((M / d) * (D_m / 2.0)), 2.0)))) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (d <= -1.1e-173) tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64((Float64(M * Float64(D_m / Float64(d * 2.0))) ^ 2.0) / l)))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); elseif (d <= 2.3e-293) tmp = Float64(Float64(-0.125 * Float64((Float64(D_m * M) ^ 2.0) * Float64(-sqrt(Float64(h / (l ^ 3.0)))))) / d); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M / d) * Float64(D_m / 2.0)) ^ 2.0))))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (d <= -1.1e-173)
tmp = (1.0 - (0.5 * (h * (((M * (D_m / (d * 2.0))) ^ 2.0) / l)))) * (sqrt((d / l)) * sqrt((d / h)));
elseif (d <= 2.3e-293)
tmp = (-0.125 * (((D_m * M) ^ 2.0) * -sqrt((h / (l ^ 3.0))))) / d;
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * (((M / d) * (D_m / 2.0)) ^ 2.0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, -1.1e-173], N[(N[(1.0 - N[(0.5 * N[(h * N[(N[Power[N[(M * N[(D$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.3e-293], N[(N[(-0.125 * N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] * (-N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.1 \cdot 10^{-173}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \frac{D\_m}{d \cdot 2}\right)}^{2}}{\ell}\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;d \leq 2.3 \cdot 10^{-293}:\\
\;\;\;\;\frac{-0.125 \cdot \left({\left(D\_m \cdot M\right)}^{2} \cdot \left(-\sqrt{\frac{h}{{\ell}^{3}}}\right)\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M}{d} \cdot \frac{D\_m}{2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -1.1e-173Initial program 75.5%
Simplified75.5%
associate-*r/76.8%
frac-times76.8%
*-commutative76.8%
times-frac75.8%
Applied egg-rr75.8%
*-commutative75.8%
associate-/l*75.8%
times-frac76.9%
associate-/l*76.8%
Simplified76.8%
if -1.1e-173 < d < 2.29999999999999995e-293Initial program 42.8%
Simplified42.8%
frac-2neg42.8%
sqrt-div62.1%
Applied egg-rr62.1%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r/0.0%
Simplified59.1%
if 2.29999999999999995e-293 < d Initial program 69.7%
pow169.7%
Applied egg-rr81.4%
unpow181.4%
associate-/r*80.1%
Simplified80.1%
Final simplification76.3%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= d -7e-174)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* -0.125 (* (/ h l) (pow (* D_m (/ M d)) 2.0))))))
(if (<= d 2.3e-293)
(/ (* -0.125 (* (pow (* D_m M) 2.0) (- (sqrt (/ h (pow l 3.0)))))) d)
(*
(/ (/ d (sqrt l)) (sqrt h))
(- 1.0 (* (/ h l) (* 0.5 (pow (* (/ M d) (/ D_m 2.0)) 2.0))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -7e-174) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * pow((D_m * (M / d)), 2.0)))));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (pow((D_m * M), 2.0) * -sqrt((h / pow(l, 3.0))))) / d;
} else {
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (d <= (-7d-174)) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.125d0) * ((h / l) * ((d_m * (m / d)) ** 2.0d0)))))
else if (d <= 2.3d-293) then
tmp = ((-0.125d0) * (((d_m * m) ** 2.0d0) * -sqrt((h / (l ** 3.0d0))))) / d
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0d0 - ((h / l) * (0.5d0 * (((m / d) * (d_m / 2.0d0)) ** 2.0d0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (d <= -7e-174) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * Math.pow((D_m * (M / d)), 2.0)))));
} else if (d <= 2.3e-293) {
tmp = (-0.125 * (Math.pow((D_m * M), 2.0) * -Math.sqrt((h / Math.pow(l, 3.0))))) / d;
} else {
tmp = ((d / Math.sqrt(l)) / Math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * Math.pow(((M / d) * (D_m / 2.0)), 2.0))));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if d <= -7e-174: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * math.pow((D_m * (M / d)), 2.0))))) elif d <= 2.3e-293: tmp = (-0.125 * (math.pow((D_m * M), 2.0) * -math.sqrt((h / math.pow(l, 3.0))))) / d else: tmp = ((d / math.sqrt(l)) / math.sqrt(h)) * (1.0 - ((h / l) * (0.5 * math.pow(((M / d) * (D_m / 2.0)), 2.0)))) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (d <= -7e-174) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(D_m * Float64(M / d)) ^ 2.0)))))); elseif (d <= 2.3e-293) tmp = Float64(Float64(-0.125 * Float64((Float64(D_m * M) ^ 2.0) * Float64(-sqrt(Float64(h / (l ^ 3.0)))))) / d); else tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * Float64(1.0 - Float64(Float64(h / l) * Float64(0.5 * (Float64(Float64(M / d) * Float64(D_m / 2.0)) ^ 2.0))))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (d <= -7e-174)
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * ((D_m * (M / d)) ^ 2.0)))));
elseif (d <= 2.3e-293)
tmp = (-0.125 * (((D_m * M) ^ 2.0) * -sqrt((h / (l ^ 3.0))))) / d;
else
tmp = ((d / sqrt(l)) / sqrt(h)) * (1.0 - ((h / l) * (0.5 * (((M / d) * (D_m / 2.0)) ^ 2.0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, -7e-174], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D$95$m * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.3e-293], N[(N[(-0.125 * N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] * (-N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(0.5 * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -7 \cdot 10^{-174}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D\_m \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{elif}\;d \leq 2.3 \cdot 10^{-293}:\\
\;\;\;\;\frac{-0.125 \cdot \left({\left(D\_m \cdot M\right)}^{2} \cdot \left(-\sqrt{\frac{h}{{\ell}^{3}}}\right)\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{M}{d} \cdot \frac{D\_m}{2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if d < -6.99999999999999975e-174Initial program 75.5%
Simplified74.5%
associate-*r/75.5%
*-un-lft-identity75.5%
times-frac74.5%
associate-/l/74.5%
*-commutative74.5%
times-frac75.5%
*-un-lft-identity75.5%
*-commutative75.5%
frac-times75.5%
clear-num75.5%
frac-times75.5%
*-un-lft-identity75.5%
Applied egg-rr75.5%
Taylor expanded in h around 0 52.5%
associate-*r*54.6%
times-frac59.9%
associate-/l*59.9%
*-commutative59.9%
unpow259.9%
unpow259.9%
times-frac67.3%
unpow267.3%
swap-sqr74.5%
unpow274.5%
*-commutative74.5%
Simplified74.5%
if -6.99999999999999975e-174 < d < 2.29999999999999995e-293Initial program 42.8%
Simplified42.8%
frac-2neg42.8%
sqrt-div62.1%
Applied egg-rr62.1%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r/0.0%
Simplified59.1%
if 2.29999999999999995e-293 < d Initial program 69.7%
pow169.7%
Applied egg-rr81.4%
unpow181.4%
associate-/r*80.1%
Simplified80.1%
Final simplification75.4%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (* (pow (* D_m M) 2.0) (- (sqrt (/ h (pow l 3.0)))))))
(if (<= l -2.8e-112)
(* (- d) (pow (* h l) -0.5))
(if (<= l -4e-310)
(/ (* -0.125 t_0) d)
(if (<= l 3.8e-190)
(* 0.125 (/ t_0 d))
(* d (* (pow h -0.5) (pow l -0.5))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = pow((D_m * M), 2.0) * -sqrt((h / pow(l, 3.0)));
double tmp;
if (l <= -2.8e-112) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = (-0.125 * t_0) / d;
} else if (l <= 3.8e-190) {
tmp = 0.125 * (t_0 / d);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: t_0
real(8) :: tmp
t_0 = ((d_m * m) ** 2.0d0) * -sqrt((h / (l ** 3.0d0)))
if (l <= (-2.8d-112)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= (-4d-310)) then
tmp = ((-0.125d0) * t_0) / d
else if (l <= 3.8d-190) then
tmp = 0.125d0 * (t_0 / d)
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.pow((D_m * M), 2.0) * -Math.sqrt((h / Math.pow(l, 3.0)));
double tmp;
if (l <= -2.8e-112) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = (-0.125 * t_0) / d;
} else if (l <= 3.8e-190) {
tmp = 0.125 * (t_0 / d);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.pow((D_m * M), 2.0) * -math.sqrt((h / math.pow(l, 3.0))) tmp = 0 if l <= -2.8e-112: tmp = -d * math.pow((h * l), -0.5) elif l <= -4e-310: tmp = (-0.125 * t_0) / d elif l <= 3.8e-190: tmp = 0.125 * (t_0 / d) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = Float64((Float64(D_m * M) ^ 2.0) * Float64(-sqrt(Float64(h / (l ^ 3.0))))) tmp = 0.0 if (l <= -2.8e-112) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -4e-310) tmp = Float64(Float64(-0.125 * t_0) / d); elseif (l <= 3.8e-190) tmp = Float64(0.125 * Float64(t_0 / d)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
t_0 = ((D_m * M) ^ 2.0) * -sqrt((h / (l ^ 3.0)));
tmp = 0.0;
if (l <= -2.8e-112)
tmp = -d * ((h * l) ^ -0.5);
elseif (l <= -4e-310)
tmp = (-0.125 * t_0) / d;
elseif (l <= 3.8e-190)
tmp = 0.125 * (t_0 / d);
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[(N[Power[N[(D$95$m * M), $MachinePrecision], 2.0], $MachinePrecision] * (-N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, -2.8e-112], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(N[(-0.125 * t$95$0), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[l, 3.8e-190], N[(0.125 * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(D\_m \cdot M\right)}^{2} \cdot \left(-\sqrt{\frac{h}{{\ell}^{3}}}\right)\\
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{-112}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{-0.125 \cdot t\_0}{d}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-190}:\\
\;\;\;\;0.125 \cdot \frac{t\_0}{d}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -2.80000000000000023e-112Initial program 59.6%
Taylor expanded in d around inf 7.8%
*-commutative7.8%
Simplified7.8%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.8%
neg-mul-145.8%
Simplified45.8%
if -2.80000000000000023e-112 < l < -3.999999999999988e-310Initial program 81.7%
Simplified81.8%
frac-2neg81.8%
sqrt-div94.0%
Applied egg-rr94.0%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r/0.0%
Simplified69.6%
if -3.999999999999988e-310 < l < 3.7999999999999998e-190Initial program 71.1%
Taylor expanded in d around 0 52.1%
*-commutative52.1%
associate-*l*52.1%
*-commutative52.1%
associate-/l*45.2%
Simplified45.2%
Taylor expanded in h around -inf 0.0%
associate-*l/0.0%
associate-*r*0.0%
unpow20.0%
rem-square-sqrt52.1%
associate-*l*52.1%
*-commutative52.1%
unpow252.1%
unpow252.1%
swap-sqr66.0%
unpow266.0%
*-commutative66.0%
mul-1-neg66.0%
Simplified66.0%
if 3.7999999999999998e-190 < l Initial program 68.3%
Taylor expanded in d around inf 51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in l around 0 51.4%
unpow-151.4%
metadata-eval51.4%
pow-sqr51.4%
rem-sqrt-square51.4%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt51.4%
Simplified51.4%
*-commutative51.4%
unpow-prod-down58.6%
Applied egg-rr58.6%
Final simplification57.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -9.2e-129)
(* (- d) (pow (* h l) -0.5))
(if (<= l -5.8e-201)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -7.5e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -4e-310)
(* d (sqrt (log (exp (/ (/ 1.0 l) h)))))
(* d (* (pow h -0.5) (pow l -0.5))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -9.2e-129) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -5.8e-201) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (l <= (-9.2d-129)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= (-5.8d-201)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= (-7.5d-222)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (l <= (-4d-310)) then
tmp = d * sqrt(log(exp(((1.0d0 / l) / h))))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -9.2e-129) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -5.8e-201) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * Math.sqrt(Math.log(Math.exp(((1.0 / l) / h))));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if l <= -9.2e-129: tmp = -d * math.pow((h * l), -0.5) elif l <= -5.8e-201: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -7.5e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -4e-310: tmp = d * math.sqrt(math.log(math.exp(((1.0 / l) / h)))) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -9.2e-129) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -5.8e-201) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -7.5e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -4e-310) tmp = Float64(d * sqrt(log(exp(Float64(Float64(1.0 / l) / h))))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (l <= -9.2e-129)
tmp = -d * ((h * l) ^ -0.5);
elseif (l <= -5.8e-201)
tmp = d * (((h * l) ^ 2.0) ^ -0.25);
elseif (l <= -7.5e-222)
tmp = sqrt((d / l)) * sqrt((d / h));
elseif (l <= -4e-310)
tmp = d * sqrt(log(exp(((1.0 / l) / h))));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -9.2e-129], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.8e-201], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7.5e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Sqrt[N[Log[N[Exp[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.2 \cdot 10^{-129}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -5.8 \cdot 10^{-201}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -7.5 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\log \left(e^{\frac{\frac{1}{\ell}}{h}}\right)}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -9.1999999999999998e-129Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -9.1999999999999998e-129 < l < -5.8000000000000003e-201Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -5.8000000000000003e-201 < l < -7.5000000000000004e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -7.5000000000000004e-222 < l < -3.999999999999988e-310Initial program 83.3%
Taylor expanded in d around inf 24.4%
*-commutative24.4%
Simplified24.4%
add-log-exp78.0%
associate-/r*78.0%
Applied egg-rr78.0%
if -3.999999999999988e-310 < l Initial program 68.9%
Taylor expanded in d around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in l around 0 44.5%
unpow-144.5%
metadata-eval44.5%
pow-sqr44.5%
rem-sqrt-square44.5%
rem-square-sqrt44.3%
fabs-sqr44.3%
rem-square-sqrt44.5%
Simplified44.5%
*-commutative44.5%
unpow-prod-down51.5%
Applied egg-rr51.5%
Final simplification51.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l 3.5e+172)
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(+ 1.0 (* -0.125 (* (/ h l) (pow (* D_m (/ M d)) 2.0))))))
(* d (/ (pow h -0.5) (sqrt l)))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= 3.5e+172) {
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * pow((D_m * (M / d)), 2.0)))));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (l <= 3.5d+172) then
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((-0.125d0) * ((h / l) * ((d_m * (m / d)) ** 2.0d0)))))
else
tmp = d * ((h ** (-0.5d0)) / sqrt(l))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= 3.5e+172) {
tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * Math.pow((D_m * (M / d)), 2.0)))));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if l <= 3.5e+172: tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * math.pow((D_m * (M / d)), 2.0))))) else: tmp = d * (math.pow(h, -0.5) / math.sqrt(l)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= 3.5e+172) tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * (Float64(D_m * Float64(M / d)) ^ 2.0)))))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (l <= 3.5e+172)
tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (-0.125 * ((h / l) * ((D_m * (M / d)) ^ 2.0)))));
else
tmp = d * ((h ^ -0.5) / sqrt(l));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, 3.5e+172], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D$95$m * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{+172}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D\_m \cdot \frac{M}{d}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.49999999999999977e172Initial program 71.8%
Simplified70.7%
associate-*r/71.8%
*-un-lft-identity71.8%
times-frac70.7%
associate-/l/70.7%
*-commutative70.7%
times-frac71.8%
*-un-lft-identity71.8%
*-commutative71.8%
frac-times71.6%
clear-num71.6%
frac-times71.6%
*-un-lft-identity71.6%
Applied egg-rr71.6%
Taylor expanded in h around 0 46.5%
associate-*r*47.9%
times-frac51.3%
associate-/l*51.3%
*-commutative51.3%
unpow251.3%
unpow251.3%
times-frac63.0%
unpow263.0%
swap-sqr70.7%
unpow270.7%
*-commutative70.7%
Simplified70.7%
if 3.49999999999999977e172 < l Initial program 43.0%
Taylor expanded in d around inf 52.0%
associate-/r*51.8%
Simplified51.8%
sqrt-div71.8%
inv-pow71.8%
sqrt-pow171.9%
metadata-eval71.9%
Applied egg-rr71.9%
Final simplification70.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (sqrt (/ d l))))
(if (<= (* D_m M) 2e-23)
(* t_1 t_0)
(* t_0 (* t_1 (* h (* (/ -0.125 l) (pow (/ M (/ d D_m)) 2.0))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double tmp;
if ((D_m * M) <= 2e-23) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * (t_1 * (h * ((-0.125 / l) * pow((M / (d / D_m)), 2.0))));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
if ((d_m * m) <= 2d-23) then
tmp = t_1 * t_0
else
tmp = t_0 * (t_1 * (h * (((-0.125d0) / l) * ((m / (d / d_m)) ** 2.0d0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double tmp;
if ((D_m * M) <= 2e-23) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * (t_1 * (h * ((-0.125 / l) * Math.pow((M / (d / D_m)), 2.0))));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) tmp = 0 if (D_m * M) <= 2e-23: tmp = t_1 * t_0 else: tmp = t_0 * (t_1 * (h * ((-0.125 / l) * math.pow((M / (d / D_m)), 2.0)))) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (Float64(D_m * M) <= 2e-23) tmp = Float64(t_1 * t_0); else tmp = Float64(t_0 * Float64(t_1 * Float64(h * Float64(Float64(-0.125 / l) * (Float64(M / Float64(d / D_m)) ^ 2.0))))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
t_0 = sqrt((d / h));
t_1 = sqrt((d / l));
tmp = 0.0;
if ((D_m * M) <= 2e-23)
tmp = t_1 * t_0;
else
tmp = t_0 * (t_1 * (h * ((-0.125 / l) * ((M / (d / D_m)) ^ 2.0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(D$95$m * M), $MachinePrecision], 2e-23], N[(t$95$1 * t$95$0), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[(h * N[(N[(-0.125 / l), $MachinePrecision] * N[Power[N[(M / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;D\_m \cdot M \leq 2 \cdot 10^{-23}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(h \cdot \left(\frac{-0.125}{\ell} \cdot {\left(\frac{M}{\frac{d}{D\_m}}\right)}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 1.99999999999999992e-23Initial program 70.2%
Simplified70.0%
Taylor expanded in M around 0 45.1%
if 1.99999999999999992e-23 < (*.f64 M D) Initial program 63.3%
Simplified63.4%
Taylor expanded in M around inf 42.7%
associate-*r/42.7%
associate-*r*44.4%
associate-*r*44.4%
associate-*l/44.4%
associate-*r/44.4%
*-commutative44.4%
associate-*r/44.4%
*-commutative44.4%
times-frac49.7%
*-commutative49.7%
associate-/l*47.9%
unpow247.9%
unpow247.9%
unpow247.9%
times-frac53.2%
swap-sqr56.7%
associate-/l*56.7%
Simplified56.7%
Final simplification47.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (sqrt (/ d l))))
(if (<= (* D_m M) 2e-23)
(* t_1 t_0)
(* t_0 (* t_1 (* h (* -0.125 (/ (pow (* M (/ D_m d)) 2.0) l))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double tmp;
if ((D_m * M) <= 2e-23) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * (t_1 * (h * (-0.125 * (pow((M * (D_m / d)), 2.0) / l))));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
if ((d_m * m) <= 2d-23) then
tmp = t_1 * t_0
else
tmp = t_0 * (t_1 * (h * ((-0.125d0) * (((m * (d_m / d)) ** 2.0d0) / l))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double tmp;
if ((D_m * M) <= 2e-23) {
tmp = t_1 * t_0;
} else {
tmp = t_0 * (t_1 * (h * (-0.125 * (Math.pow((M * (D_m / d)), 2.0) / l))));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) tmp = 0 if (D_m * M) <= 2e-23: tmp = t_1 * t_0 else: tmp = t_0 * (t_1 * (h * (-0.125 * (math.pow((M * (D_m / d)), 2.0) / l)))) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (Float64(D_m * M) <= 2e-23) tmp = Float64(t_1 * t_0); else tmp = Float64(t_0 * Float64(t_1 * Float64(h * Float64(-0.125 * Float64((Float64(M * Float64(D_m / d)) ^ 2.0) / l))))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
t_0 = sqrt((d / h));
t_1 = sqrt((d / l));
tmp = 0.0;
if ((D_m * M) <= 2e-23)
tmp = t_1 * t_0;
else
tmp = t_0 * (t_1 * (h * (-0.125 * (((M * (D_m / d)) ^ 2.0) / l))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(D$95$m * M), $MachinePrecision], 2e-23], N[(t$95$1 * t$95$0), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[(h * N[(-0.125 * N[(N[Power[N[(M * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;D\_m \cdot M \leq 2 \cdot 10^{-23}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(h \cdot \left(-0.125 \cdot \frac{{\left(M \cdot \frac{D\_m}{d}\right)}^{2}}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 1.99999999999999992e-23Initial program 70.2%
Simplified70.0%
Taylor expanded in M around 0 45.1%
if 1.99999999999999992e-23 < (*.f64 M D) Initial program 63.3%
Simplified63.4%
Taylor expanded in M around inf 42.7%
associate-*r/42.7%
associate-*r*44.4%
associate-*r*44.4%
associate-*l/44.4%
associate-*r/44.4%
*-commutative44.4%
associate-*r/44.4%
*-commutative44.4%
times-frac49.7%
*-commutative49.7%
associate-/l*47.9%
unpow247.9%
unpow247.9%
unpow247.9%
times-frac53.2%
swap-sqr56.7%
associate-/l*56.7%
Simplified56.7%
pow156.7%
associate-*r*57.9%
associate-/r/57.9%
Applied egg-rr57.9%
unpow157.9%
associate-*l*56.7%
associate-*l/56.7%
associate-/l*56.7%
associate-*l/56.7%
associate-/l*56.7%
Simplified56.7%
Final simplification47.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)))
(if (<= l -1.35e-129)
(* (- d) t_0)
(if (<= l -5e-202)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -7.5e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -4e-310)
(* d (log (exp t_0)))
(* d (* (pow h -0.5) (pow l -0.5)))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (l <= -1.35e-129) {
tmp = -d * t_0;
} else if (l <= -5e-202) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * log(exp(t_0));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if (l <= (-1.35d-129)) then
tmp = -d * t_0
else if (l <= (-5d-202)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else if (l <= (-7.5d-222)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (l <= (-4d-310)) then
tmp = d * log(exp(t_0))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (l <= -1.35e-129) {
tmp = -d * t_0;
} else if (l <= -5e-202) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -7.5e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -4e-310) {
tmp = d * Math.log(Math.exp(t_0));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.pow((h * l), -0.5) tmp = 0 if l <= -1.35e-129: tmp = -d * t_0 elif l <= -5e-202: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -7.5e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -4e-310: tmp = d * math.log(math.exp(t_0)) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (l <= -1.35e-129) tmp = Float64(Float64(-d) * t_0); elseif (l <= -5e-202) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -7.5e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -4e-310) tmp = Float64(d * log(exp(t_0))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
t_0 = (h * l) ^ -0.5;
tmp = 0.0;
if (l <= -1.35e-129)
tmp = -d * t_0;
elseif (l <= -5e-202)
tmp = d * (((h * l) ^ 2.0) ^ -0.25);
elseif (l <= -7.5e-222)
tmp = sqrt((d / l)) * sqrt((d / h));
elseif (l <= -4e-310)
tmp = d * log(exp(t_0));
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -1.35e-129], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, -5e-202], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7.5e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{-129}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-202}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -7.5 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \log \left(e^{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.35e-129Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -1.35e-129 < l < -4.99999999999999973e-202Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -4.99999999999999973e-202 < l < -7.5000000000000004e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -7.5000000000000004e-222 < l < -3.999999999999988e-310Initial program 83.3%
Taylor expanded in d around inf 24.4%
*-commutative24.4%
Simplified24.4%
add-log-exp78.0%
pow1/278.0%
inv-pow78.0%
pow-pow78.0%
*-commutative78.0%
metadata-eval78.0%
Applied egg-rr78.0%
if -3.999999999999988e-310 < l Initial program 68.9%
Taylor expanded in d around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in l around 0 44.5%
unpow-144.5%
metadata-eval44.5%
pow-sqr44.5%
rem-sqrt-square44.5%
rem-square-sqrt44.3%
fabs-sqr44.3%
rem-square-sqrt44.5%
Simplified44.5%
*-commutative44.5%
unpow-prod-down51.5%
Applied egg-rr51.5%
Final simplification51.8%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(let* ((t_0 (pow (* h l) -0.5)) (t_1 (* (- d) t_0)))
(if (<= l -6.4e-130)
t_1
(if (<= l -1.75e-203)
(* d (pow (pow (* h l) 2.0) -0.25))
(if (<= l -7.2e-222)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= l -1.2e-292)
(log1p (expm1 (* d t_0)))
(if (<= l 7.5e-281) t_1 (* d (* (pow h -0.5) (pow l -0.5))))))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = pow((h * l), -0.5);
double t_1 = -d * t_0;
double tmp;
if (l <= -6.4e-130) {
tmp = t_1;
} else if (l <= -1.75e-203) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else if (l <= -7.2e-222) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (l <= -1.2e-292) {
tmp = log1p(expm1((d * t_0)));
} else if (l <= 7.5e-281) {
tmp = t_1;
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.pow((h * l), -0.5);
double t_1 = -d * t_0;
double tmp;
if (l <= -6.4e-130) {
tmp = t_1;
} else if (l <= -1.75e-203) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else if (l <= -7.2e-222) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (l <= -1.2e-292) {
tmp = Math.log1p(Math.expm1((d * t_0)));
} else if (l <= 7.5e-281) {
tmp = t_1;
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.pow((h * l), -0.5) t_1 = -d * t_0 tmp = 0 if l <= -6.4e-130: tmp = t_1 elif l <= -1.75e-203: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) elif l <= -7.2e-222: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif l <= -1.2e-292: tmp = math.log1p(math.expm1((d * t_0))) elif l <= 7.5e-281: tmp = t_1 else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = Float64(h * l) ^ -0.5 t_1 = Float64(Float64(-d) * t_0) tmp = 0.0 if (l <= -6.4e-130) tmp = t_1; elseif (l <= -1.75e-203) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); elseif (l <= -7.2e-222) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (l <= -1.2e-292) tmp = log1p(expm1(Float64(d * t_0))); elseif (l <= 7.5e-281) tmp = t_1; else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[((-d) * t$95$0), $MachinePrecision]}, If[LessEqual[l, -6.4e-130], t$95$1, If[LessEqual[l, -1.75e-203], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -7.2e-222], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.2e-292], N[Log[1 + N[(Exp[N[(d * t$95$0), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 7.5e-281], t$95$1, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
t_1 := \left(-d\right) \cdot t\_0\\
\mathbf{if}\;\ell \leq -6.4 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1.75 \cdot 10^{-203}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{elif}\;\ell \leq -7.2 \cdot 10^{-222}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -1.2 \cdot 10^{-292}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(d \cdot t\_0\right)\right)\\
\mathbf{elif}\;\ell \leq 7.5 \cdot 10^{-281}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -6.3999999999999999e-130 or -1.2000000000000001e-292 < l < 7.49999999999999968e-281Initial program 64.0%
Taylor expanded in d around inf 6.9%
*-commutative6.9%
Simplified6.9%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.3%
neg-mul-144.3%
Simplified44.3%
if -6.3999999999999999e-130 < l < -1.7500000000000001e-203Initial program 75.5%
Taylor expanded in d around inf 36.9%
associate-/r*36.9%
Simplified36.9%
associate-/l/36.9%
*-commutative36.9%
inv-pow36.9%
metadata-eval36.9%
metadata-eval36.9%
metadata-eval36.9%
pow-prod-up36.9%
pow-prod-up36.9%
pow-prod-up36.9%
sqrt-unprod36.9%
add-sqr-sqrt36.9%
pow-prod-down51.2%
pow251.2%
Applied egg-rr51.2%
if -1.7500000000000001e-203 < l < -7.19999999999999948e-222Initial program 98.8%
Simplified98.8%
Taylor expanded in M around 0 98.8%
if -7.19999999999999948e-222 < l < -1.2000000000000001e-292Initial program 81.3%
Taylor expanded in d around inf 27.2%
*-commutative27.2%
Simplified27.2%
log1p-expm1-u63.2%
pow1/263.2%
inv-pow63.2%
pow-pow57.2%
*-commutative57.2%
metadata-eval57.2%
Applied egg-rr57.2%
if 7.49999999999999968e-281 < l Initial program 68.2%
Taylor expanded in d around inf 45.5%
*-commutative45.5%
Simplified45.5%
Taylor expanded in l around 0 45.5%
unpow-145.5%
metadata-eval45.5%
pow-sqr45.5%
rem-sqrt-square45.5%
rem-square-sqrt45.3%
fabs-sqr45.3%
rem-square-sqrt45.5%
Simplified45.5%
*-commutative45.5%
unpow-prod-down52.7%
Applied egg-rr52.7%
Final simplification50.7%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -5.6e-130)
(* (- d) (pow (* h l) -0.5))
(if (<= l -4e-310)
(* d (pow (pow (* h l) 2.0) -0.25))
(* d (* (pow h -0.5) (pow l -0.5))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -5.6e-130) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * pow(pow((h * l), 2.0), -0.25);
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (l <= (-5.6d-130)) then
tmp = -d * ((h * l) ** (-0.5d0))
else if (l <= (-4d-310)) then
tmp = d * (((h * l) ** 2.0d0) ** (-0.25d0))
else
tmp = d * ((h ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -5.6e-130) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * Math.pow(Math.pow((h * l), 2.0), -0.25);
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if l <= -5.6e-130: tmp = -d * math.pow((h * l), -0.5) elif l <= -4e-310: tmp = d * math.pow(math.pow((h * l), 2.0), -0.25) else: tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5)) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -5.6e-130) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -4e-310) tmp = Float64(d * ((Float64(h * l) ^ 2.0) ^ -0.25)); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (l <= -5.6e-130)
tmp = -d * ((h * l) ^ -0.5);
elseif (l <= -4e-310)
tmp = d * (((h * l) ^ 2.0) ^ -0.25);
else
tmp = d * ((h ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -5.6e-130], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{-130}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -5.60000000000000032e-130Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -5.60000000000000032e-130 < l < -3.999999999999988e-310Initial program 81.1%
Taylor expanded in d around inf 28.1%
associate-/r*28.1%
Simplified28.1%
associate-/l/28.1%
*-commutative28.1%
inv-pow28.1%
metadata-eval28.1%
metadata-eval28.1%
metadata-eval28.1%
pow-prod-up28.1%
pow-prod-up28.1%
pow-prod-up28.1%
sqrt-unprod25.7%
add-sqr-sqrt25.7%
pow-prod-down46.4%
pow246.4%
Applied egg-rr46.4%
if -3.999999999999988e-310 < l Initial program 68.9%
Taylor expanded in d around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in l around 0 44.5%
unpow-144.5%
metadata-eval44.5%
pow-sqr44.5%
rem-sqrt-square44.5%
rem-square-sqrt44.3%
fabs-sqr44.3%
rem-square-sqrt44.5%
Simplified44.5%
*-commutative44.5%
unpow-prod-down51.5%
Applied egg-rr51.5%
Final simplification48.4%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -1.15e-128)
(* (- d) (pow (* h l) -0.5))
(if (<= l -4e-310)
(* d (cbrt (pow (* h l) -1.5)))
(* d (* (pow h -0.5) (pow l -0.5))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -1.15e-128) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d * (pow(h, -0.5) * pow(l, -0.5));
}
return tmp;
}
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -1.15e-128) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -1.15e-128) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -4e-310) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5))); end return tmp end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -1.15e-128], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{-128}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -1.15e-128Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -1.15e-128 < l < -3.999999999999988e-310Initial program 81.1%
Taylor expanded in d around inf 28.1%
associate-/r*28.1%
Simplified28.1%
associate-/l/28.1%
*-commutative28.1%
inv-pow28.1%
metadata-eval28.1%
metadata-eval28.1%
metadata-eval28.1%
pow-prod-up28.1%
pow-prod-up28.1%
pow-prod-up28.1%
sqrt-unprod25.7%
add-sqr-sqrt25.7%
add-cbrt-cube25.7%
add-cbrt-cube25.7%
cbrt-unprod41.9%
Applied egg-rr41.9%
pow-sqr41.9%
metadata-eval41.9%
Simplified41.9%
if -3.999999999999988e-310 < l Initial program 68.9%
Taylor expanded in d around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in l around 0 44.5%
unpow-144.5%
metadata-eval44.5%
pow-sqr44.5%
rem-sqrt-square44.5%
rem-square-sqrt44.3%
fabs-sqr44.3%
rem-square-sqrt44.5%
Simplified44.5%
*-commutative44.5%
unpow-prod-down51.5%
Applied egg-rr51.5%
Final simplification47.7%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -2.3e-129)
(* (- d) (pow (* h l) -0.5))
(if (<= l -4e-310)
(* d (cbrt (pow (* h l) -1.5)))
(* d (/ (pow h -0.5) (sqrt l))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -2.3e-129) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d * (pow(h, -0.5) / sqrt(l));
}
return tmp;
}
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -2.3e-129) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= -4e-310) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -2.3e-129) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= -4e-310) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l))); end return tmp end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -2.3e-129], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4e-310], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{-129}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.3e-129Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -2.3e-129 < l < -3.999999999999988e-310Initial program 81.1%
Taylor expanded in d around inf 28.1%
associate-/r*28.1%
Simplified28.1%
associate-/l/28.1%
*-commutative28.1%
inv-pow28.1%
metadata-eval28.1%
metadata-eval28.1%
metadata-eval28.1%
pow-prod-up28.1%
pow-prod-up28.1%
pow-prod-up28.1%
sqrt-unprod25.7%
add-sqr-sqrt25.7%
add-cbrt-cube25.7%
add-cbrt-cube25.7%
cbrt-unprod41.9%
Applied egg-rr41.9%
pow-sqr41.9%
metadata-eval41.9%
Simplified41.9%
if -3.999999999999988e-310 < l Initial program 68.9%
Taylor expanded in d around inf 44.5%
associate-/r*44.4%
Simplified44.4%
sqrt-div51.5%
inv-pow51.5%
sqrt-pow151.5%
metadata-eval51.5%
Applied egg-rr51.5%
Final simplification47.6%
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
:precision binary64
(if (<= l -6.4e-130)
(* (- d) (pow (* h l) -0.5))
(if (<= l 6e-309)
(* d (cbrt (pow (* h l) -1.5)))
(* d (sqrt (/ (/ 1.0 l) h))))))D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -6.4e-130) {
tmp = -d * pow((h * l), -0.5);
} else if (l <= 6e-309) {
tmp = d * cbrt(pow((h * l), -1.5));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (l <= -6.4e-130) {
tmp = -d * Math.pow((h * l), -0.5);
} else if (l <= 6e-309) {
tmp = d * Math.cbrt(Math.pow((h * l), -1.5));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (l <= -6.4e-130) tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5)); elseif (l <= 6e-309) tmp = Float64(d * cbrt((Float64(h * l) ^ -1.5))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[l, -6.4e-130], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e-309], N[(d * N[Power[N[Power[N[(h * l), $MachinePrecision], -1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.4 \cdot 10^{-130}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{-309}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(h \cdot \ell\right)}^{-1.5}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if l < -6.3999999999999999e-130Initial program 61.8%
Taylor expanded in d around inf 7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt44.4%
neg-mul-144.4%
Simplified44.4%
if -6.3999999999999999e-130 < l < 6.000000000000001e-309Initial program 81.1%
Taylor expanded in d around inf 28.1%
associate-/r*28.1%
Simplified28.1%
associate-/l/28.1%
*-commutative28.1%
inv-pow28.1%
metadata-eval28.1%
metadata-eval28.1%
metadata-eval28.1%
pow-prod-up28.1%
pow-prod-up28.1%
pow-prod-up28.1%
sqrt-unprod25.7%
add-sqr-sqrt25.7%
add-cbrt-cube25.7%
add-cbrt-cube25.7%
cbrt-unprod41.9%
Applied egg-rr41.9%
pow-sqr41.9%
metadata-eval41.9%
Simplified41.9%
if 6.000000000000001e-309 < l Initial program 68.9%
Simplified69.3%
Taylor expanded in h around -inf 45.8%
mul-1-neg45.8%
*-commutative45.8%
distribute-rgt-neg-in45.8%
Simplified72.0%
Taylor expanded in d around inf 44.5%
*-commutative44.5%
associate-/r*44.5%
Simplified44.5%
Final simplification44.0%
D_m = (fabs.f64 D) NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M D_m) :precision binary64 (if (<= h -9.2e-209) (* (- d) (sqrt (/ (/ 1.0 h) l))) (* d (pow (* h l) -0.5))))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (h <= -9.2e-209) {
tmp = -d * sqrt(((1.0 / h) / l));
} else {
tmp = d * pow((h * l), -0.5);
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: tmp
if (h <= (-9.2d-209)) then
tmp = -d * sqrt(((1.0d0 / h) / l))
else
tmp = d * ((h * l) ** (-0.5d0))
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double tmp;
if (h <= -9.2e-209) {
tmp = -d * Math.sqrt(((1.0 / h) / l));
} else {
tmp = d * Math.pow((h * l), -0.5);
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): tmp = 0 if h <= -9.2e-209: tmp = -d * math.sqrt(((1.0 / h) / l)) else: tmp = d * math.pow((h * l), -0.5) return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) tmp = 0.0 if (h <= -9.2e-209) tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / h) / l))); else tmp = Float64(d * (Float64(h * l) ^ -0.5)); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
tmp = 0.0;
if (h <= -9.2e-209)
tmp = -d * sqrt(((1.0 / h) / l));
else
tmp = d * ((h * l) ^ -0.5);
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[h, -9.2e-209], N[((-d) * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -9.2 \cdot 10^{-209}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\
\end{array}
\end{array}
if h < -9.1999999999999999e-209Initial program 67.3%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
associate-/r*0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt37.4%
neg-mul-137.4%
Simplified37.4%
if -9.1999999999999999e-209 < h Initial program 69.5%
Taylor expanded in d around inf 43.4%
*-commutative43.4%
Simplified43.4%
Taylor expanded in l around 0 43.4%
unpow-143.4%
metadata-eval43.4%
pow-sqr43.4%
rem-sqrt-square43.4%
rem-square-sqrt43.3%
fabs-sqr43.3%
rem-square-sqrt43.4%
Simplified43.4%
Final simplification41.1%
D_m = (fabs.f64 D) NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M D_m) :precision binary64 (let* ((t_0 (pow (* h l) -0.5))) (if (<= h -8.5e-209) (* (- d) t_0) (* d t_0))))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
double t_0 = pow((h * l), -0.5);
double tmp;
if (h <= -8.5e-209) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
real(8) :: t_0
real(8) :: tmp
t_0 = (h * l) ** (-0.5d0)
if (h <= (-8.5d-209)) then
tmp = -d * t_0
else
tmp = d * t_0
end if
code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
double t_0 = Math.pow((h * l), -0.5);
double tmp;
if (h <= -8.5e-209) {
tmp = -d * t_0;
} else {
tmp = d * t_0;
}
return tmp;
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): t_0 = math.pow((h * l), -0.5) tmp = 0 if h <= -8.5e-209: tmp = -d * t_0 else: tmp = d * t_0 return tmp
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) t_0 = Float64(h * l) ^ -0.5 tmp = 0.0 if (h <= -8.5e-209) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(d * t_0); end return tmp end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
t_0 = (h * l) ^ -0.5;
tmp = 0.0;
if (h <= -8.5e-209)
tmp = -d * t_0;
else
tmp = d * t_0;
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[h, -8.5e-209], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(h \cdot \ell\right)}^{-0.5}\\
\mathbf{if}\;h \leq -8.5 \cdot 10^{-209}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if h < -8.5e-209Initial program 67.3%
Taylor expanded in d around inf 8.4%
*-commutative8.4%
Simplified8.4%
Taylor expanded in l around -inf 0.0%
*-commutative0.0%
unpow-10.0%
metadata-eval0.0%
pow-sqr0.0%
rem-sqrt-square0.0%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt37.3%
neg-mul-137.3%
Simplified37.3%
if -8.5e-209 < h Initial program 69.5%
Taylor expanded in d around inf 43.4%
*-commutative43.4%
Simplified43.4%
Taylor expanded in l around 0 43.4%
unpow-143.4%
metadata-eval43.4%
pow-sqr43.4%
rem-sqrt-square43.4%
rem-square-sqrt43.3%
fabs-sqr43.3%
rem-square-sqrt43.4%
Simplified43.4%
Final simplification41.1%
D_m = (fabs.f64 D) NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M D_m) :precision binary64 (* d (sqrt (/ (/ 1.0 l) h))))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
return d * sqrt(((1.0 / l) / h));
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
code = d * sqrt(((1.0d0 / l) / h))
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
return d * Math.sqrt(((1.0 / l) / h));
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): return d * math.sqrt(((1.0 / l) / h))
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) return Float64(d * sqrt(Float64(Float64(1.0 / l) / h))) end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp = code(d, h, l, M, D_m)
tmp = d * sqrt(((1.0 / l) / h));
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\end{array}
Initial program 68.6%
Simplified68.5%
Taylor expanded in h around -inf 46.4%
mul-1-neg46.4%
*-commutative46.4%
distribute-rgt-neg-in46.4%
Simplified70.4%
Taylor expanded in d around inf 29.9%
*-commutative29.9%
associate-/r*29.9%
Simplified29.9%
D_m = (fabs.f64 D) NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M D_m) :precision binary64 (* d (sqrt (/ 1.0 (* h l)))))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
return d * sqrt((1.0 / (h * l)));
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
code = d * sqrt((1.0d0 / (h * l)))
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
return d * Math.sqrt((1.0 / (h * l)));
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): return d * math.sqrt((1.0 / (h * l)))
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) return Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp = code(d, h, l, M, D_m)
tmp = d * sqrt((1.0 / (h * l)));
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
d \cdot \sqrt{\frac{1}{h \cdot \ell}}
\end{array}
Initial program 68.6%
Taylor expanded in d around inf 29.9%
*-commutative29.9%
Simplified29.9%
Final simplification29.9%
D_m = (fabs.f64 D) NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M D_m) :precision binary64 (* d (pow (* h l) -0.5)))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
return d * pow((h * l), -0.5);
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
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_m
code = d * ((h * l) ** (-0.5d0))
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
return d * Math.pow((h * l), -0.5);
}
D_m = math.fabs(D) [d, h, l, M, D_m] = sort([d, h, l, M, D_m]) def code(d, h, l, M, D_m): return d * math.pow((h * l), -0.5)
D_m = abs(D) d, h, l, M, D_m = sort([d, h, l, M, D_m]) function code(d, h, l, M, D_m) return Float64(d * (Float64(h * l) ^ -0.5)) end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp = code(d, h, l, M, D_m)
tmp = d * ((h * l) ^ -0.5);
end
D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M_, D$95$m_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 68.6%
Taylor expanded in d around inf 29.9%
*-commutative29.9%
Simplified29.9%
Taylor expanded in l around 0 29.9%
unpow-129.9%
metadata-eval29.9%
pow-sqr29.9%
rem-sqrt-square29.5%
rem-square-sqrt29.4%
fabs-sqr29.4%
rem-square-sqrt29.5%
Simplified29.5%
herbie shell --seed 2024093
(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)))))