
(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 27 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}
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ d (* M_m D_m)))
(t_1 (/ 0.5 t_0))
(t_2 (* d (sqrt (/ 1.0 (* h l)))))
(t_3 (/ (/ t_1 2.0) l)))
(if (<= h -1.35e+48)
(*
(* (sqrt (/ d h)) (+ 1.0 (/ (* (/ -0.5 t_0) (/ (/ h 4.0) t_0)) l)))
(* (pow (- 0.0 d) 0.5) (sqrt (/ -1.0 l))))
(if (<= h -1e-309)
(* t_2 (+ (* t_3 (/ t_1 (/ 1.0 h))) -1.0))
(if (<= h 1.45e+111)
(* (+ 1.0 (* t_3 (/ t_1 (/ -1.0 h)))) t_2)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = 0.5 / t_0;
double t_2 = d * sqrt((1.0 / (h * l)));
double t_3 = (t_1 / 2.0) / l;
double tmp;
if (h <= -1.35e+48) {
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (pow((0.0 - d), 0.5) * sqrt((-1.0 / l)));
} else if (h <= -1e-309) {
tmp = t_2 * ((t_3 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.45e+111) {
tmp = (1.0 + (t_3 * (t_1 / (-1.0 / h)))) * t_2;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = d / (m_m * d_m)
t_1 = 0.5d0 / t_0
t_2 = d * sqrt((1.0d0 / (h * l)))
t_3 = (t_1 / 2.0d0) / l
if (h <= (-1.35d+48)) then
tmp = (sqrt((d / h)) * (1.0d0 + ((((-0.5d0) / t_0) * ((h / 4.0d0) / t_0)) / l))) * (((0.0d0 - d) ** 0.5d0) * sqrt(((-1.0d0) / l)))
else if (h <= (-1d-309)) then
tmp = t_2 * ((t_3 * (t_1 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 1.45d+111) then
tmp = (1.0d0 + (t_3 * (t_1 / ((-1.0d0) / h)))) * t_2
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = 0.5 / t_0;
double t_2 = d * Math.sqrt((1.0 / (h * l)));
double t_3 = (t_1 / 2.0) / l;
double tmp;
if (h <= -1.35e+48) {
tmp = (Math.sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (Math.pow((0.0 - d), 0.5) * Math.sqrt((-1.0 / l)));
} else if (h <= -1e-309) {
tmp = t_2 * ((t_3 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.45e+111) {
tmp = (1.0 + (t_3 * (t_1 / (-1.0 / h)))) * t_2;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d / (M_m * D_m) t_1 = 0.5 / t_0 t_2 = d * math.sqrt((1.0 / (h * l))) t_3 = (t_1 / 2.0) / l tmp = 0 if h <= -1.35e+48: tmp = (math.sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (math.pow((0.0 - d), 0.5) * math.sqrt((-1.0 / l))) elif h <= -1e-309: tmp = t_2 * ((t_3 * (t_1 / (1.0 / h))) + -1.0) elif h <= 1.45e+111: tmp = (1.0 + (t_3 * (t_1 / (-1.0 / h)))) * t_2 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d / Float64(M_m * D_m)) t_1 = Float64(0.5 / t_0) t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_3 = Float64(Float64(t_1 / 2.0) / l) tmp = 0.0 if (h <= -1.35e+48) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(-0.5 / t_0) * Float64(Float64(h / 4.0) / t_0)) / l))) * Float64((Float64(0.0 - d) ^ 0.5) * sqrt(Float64(-1.0 / l)))); elseif (h <= -1e-309) tmp = Float64(t_2 * Float64(Float64(t_3 * Float64(t_1 / Float64(1.0 / h))) + -1.0)); elseif (h <= 1.45e+111) tmp = Float64(Float64(1.0 + Float64(t_3 * Float64(t_1 / Float64(-1.0 / h)))) * t_2); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d / (M_m * D_m);
t_1 = 0.5 / t_0;
t_2 = d * sqrt((1.0 / (h * l)));
t_3 = (t_1 / 2.0) / l;
tmp = 0.0;
if (h <= -1.35e+48)
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (((0.0 - d) ^ 0.5) * sqrt((-1.0 / l)));
elseif (h <= -1e-309)
tmp = t_2 * ((t_3 * (t_1 / (1.0 / h))) + -1.0);
elseif (h <= 1.45e+111)
tmp = (1.0 + (t_3 * (t_1 / (-1.0 / h)))) * t_2;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -1.35e+48], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(-0.5 / t$95$0), $MachinePrecision] * N[(N[(h / 4.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(0.0 - d), $MachinePrecision], 0.5], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$2 * N[(N[(t$95$3 * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.45e+111], N[(N[(1.0 + N[(t$95$3 * N[(t$95$1 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M\_m \cdot D\_m}\\
t_1 := \frac{0.5}{t\_0}\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_3 := \frac{\frac{t\_1}{2}}{\ell}\\
\mathbf{if}\;h \leq -1.35 \cdot 10^{+48}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\frac{-0.5}{t\_0} \cdot \frac{\frac{h}{4}}{t\_0}}{\ell}\right)\right) \cdot \left({\left(0 - d\right)}^{0.5} \cdot \sqrt{\frac{-1}{\ell}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_2 \cdot \left(t\_3 \cdot \frac{t\_1}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 1.45 \cdot 10^{+111}:\\
\;\;\;\;\left(1 + t\_3 \cdot \frac{t\_1}{\frac{-1}{h}}\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.35000000000000002e48Initial program 63.3%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr63.4%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6440.1%
Applied egg-rr40.1%
Applied egg-rr69.6%
frac-2negN/A
div-invN/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6477.2%
Applied egg-rr77.2%
if -1.35000000000000002e48 < h < -1.000000000000002e-309Initial program 71.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.9%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6490.3%
Simplified90.3%
if -1.000000000000002e-309 < h < 1.45e111Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 1.45e111 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification83.0%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ d (* M_m D_m)))
(t_1 (* d (sqrt (/ 1.0 (* h l)))))
(t_2 (/ 0.5 t_0))
(t_3 (/ (/ t_2 2.0) l)))
(if (<= h -4.5e+54)
(*
(* (sqrt (/ d h)) (+ 1.0 (/ (* (/ -0.5 t_0) (/ (/ h 4.0) t_0)) l)))
(/ (pow (- 0.0 d) 0.5) (pow (- 0.0 l) 0.5)))
(if (<= h -1e-309)
(* t_1 (+ (* t_3 (/ t_2 (/ 1.0 h))) -1.0))
(if (<= h 6e+111)
(* (+ 1.0 (* t_3 (/ t_2 (/ -1.0 h)))) t_1)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = d * sqrt((1.0 / (h * l)));
double t_2 = 0.5 / t_0;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -4.5e+54) {
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (pow((0.0 - d), 0.5) / pow((0.0 - l), 0.5));
} else if (h <= -1e-309) {
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 6e+111) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = d / (m_m * d_m)
t_1 = d * sqrt((1.0d0 / (h * l)))
t_2 = 0.5d0 / t_0
t_3 = (t_2 / 2.0d0) / l
if (h <= (-4.5d+54)) then
tmp = (sqrt((d / h)) * (1.0d0 + ((((-0.5d0) / t_0) * ((h / 4.0d0) / t_0)) / l))) * (((0.0d0 - d) ** 0.5d0) / ((0.0d0 - l) ** 0.5d0))
else if (h <= (-1d-309)) then
tmp = t_1 * ((t_3 * (t_2 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 6d+111) then
tmp = (1.0d0 + (t_3 * (t_2 / ((-1.0d0) / h)))) * t_1
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = d * Math.sqrt((1.0 / (h * l)));
double t_2 = 0.5 / t_0;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -4.5e+54) {
tmp = (Math.sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (Math.pow((0.0 - d), 0.5) / Math.pow((0.0 - l), 0.5));
} else if (h <= -1e-309) {
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 6e+111) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d / (M_m * D_m) t_1 = d * math.sqrt((1.0 / (h * l))) t_2 = 0.5 / t_0 t_3 = (t_2 / 2.0) / l tmp = 0 if h <= -4.5e+54: tmp = (math.sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (math.pow((0.0 - d), 0.5) / math.pow((0.0 - l), 0.5)) elif h <= -1e-309: tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0) elif h <= 6e+111: tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d / Float64(M_m * D_m)) t_1 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_2 = Float64(0.5 / t_0) t_3 = Float64(Float64(t_2 / 2.0) / l) tmp = 0.0 if (h <= -4.5e+54) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(-0.5 / t_0) * Float64(Float64(h / 4.0) / t_0)) / l))) * Float64((Float64(0.0 - d) ^ 0.5) / (Float64(0.0 - l) ^ 0.5))); elseif (h <= -1e-309) tmp = Float64(t_1 * Float64(Float64(t_3 * Float64(t_2 / Float64(1.0 / h))) + -1.0)); elseif (h <= 6e+111) tmp = Float64(Float64(1.0 + Float64(t_3 * Float64(t_2 / Float64(-1.0 / h)))) * t_1); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d / (M_m * D_m);
t_1 = d * sqrt((1.0 / (h * l)));
t_2 = 0.5 / t_0;
t_3 = (t_2 / 2.0) / l;
tmp = 0.0;
if (h <= -4.5e+54)
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l))) * (((0.0 - d) ^ 0.5) / ((0.0 - l) ^ 0.5));
elseif (h <= -1e-309)
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
elseif (h <= 6e+111)
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -4.5e+54], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(-0.5 / t$95$0), $MachinePrecision] * N[(N[(h / 4.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(0.0 - d), $MachinePrecision], 0.5], $MachinePrecision] / N[Power[N[(0.0 - l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$1 * N[(N[(t$95$3 * N[(t$95$2 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 6e+111], N[(N[(1.0 + N[(t$95$3 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M\_m \cdot D\_m}\\
t_1 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_2 := \frac{0.5}{t\_0}\\
t_3 := \frac{\frac{t\_2}{2}}{\ell}\\
\mathbf{if}\;h \leq -4.5 \cdot 10^{+54}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\frac{-0.5}{t\_0} \cdot \frac{\frac{h}{4}}{t\_0}}{\ell}\right)\right) \cdot \frac{{\left(0 - d\right)}^{0.5}}{{\left(0 - \ell\right)}^{0.5}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_1 \cdot \left(t\_3 \cdot \frac{t\_2}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 6 \cdot 10^{+111}:\\
\;\;\;\;\left(1 + t\_3 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -4.49999999999999984e54Initial program 63.3%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr63.4%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6440.1%
Applied egg-rr40.1%
Applied egg-rr69.6%
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6477.2%
Applied egg-rr77.2%
if -4.49999999999999984e54 < h < -1.000000000000002e-309Initial program 71.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.9%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6490.3%
Simplified90.3%
if -1.000000000000002e-309 < h < 6e111Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 6e111 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification83.0%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ d (* M_m D_m)))
(t_1 (* d (sqrt (/ 1.0 (* h l)))))
(t_2 (/ 0.5 t_0))
(t_3 (/ (/ t_2 2.0) l)))
(if (<= h -1.65e+55)
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (/ (* 0.5 (/ h (/ 4.0 (/ (* M_m D_m) d)))) (* t_0 l))))
(if (<= h -1e-309)
(* t_1 (+ (* t_3 (/ t_2 (/ 1.0 h))) -1.0))
(if (<= h 9.2e+101)
(* (+ 1.0 (* t_3 (/ t_2 (/ -1.0 h)))) t_1)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = d * sqrt((1.0 / (h * l)));
double t_2 = 0.5 / t_0;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -1.65e+55) {
tmp = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((0.5 * (h / (4.0 / ((M_m * D_m) / d)))) / (t_0 * l)));
} else if (h <= -1e-309) {
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 9.2e+101) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = d / (m_m * d_m)
t_1 = d * sqrt((1.0d0 / (h * l)))
t_2 = 0.5d0 / t_0
t_3 = (t_2 / 2.0d0) / l
if (h <= (-1.65d+55)) then
tmp = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((0.5d0 * (h / (4.0d0 / ((m_m * d_m) / d)))) / (t_0 * l)))
else if (h <= (-1d-309)) then
tmp = t_1 * ((t_3 * (t_2 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 9.2d+101) then
tmp = (1.0d0 + (t_3 * (t_2 / ((-1.0d0) / h)))) * t_1
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double t_1 = d * Math.sqrt((1.0 / (h * l)));
double t_2 = 0.5 / t_0;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -1.65e+55) {
tmp = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((0.5 * (h / (4.0 / ((M_m * D_m) / d)))) / (t_0 * l)));
} else if (h <= -1e-309) {
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 9.2e+101) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d / (M_m * D_m) t_1 = d * math.sqrt((1.0 / (h * l))) t_2 = 0.5 / t_0 t_3 = (t_2 / 2.0) / l tmp = 0 if h <= -1.65e+55: tmp = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((0.5 * (h / (4.0 / ((M_m * D_m) / d)))) / (t_0 * l))) elif h <= -1e-309: tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0) elif h <= 9.2e+101: tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d / Float64(M_m * D_m)) t_1 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_2 = Float64(0.5 / t_0) t_3 = Float64(Float64(t_2 / 2.0) / l) tmp = 0.0 if (h <= -1.65e+55) tmp = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(0.5 * Float64(h / Float64(4.0 / Float64(Float64(M_m * D_m) / d)))) / Float64(t_0 * l)))); elseif (h <= -1e-309) tmp = Float64(t_1 * Float64(Float64(t_3 * Float64(t_2 / Float64(1.0 / h))) + -1.0)); elseif (h <= 9.2e+101) tmp = Float64(Float64(1.0 + Float64(t_3 * Float64(t_2 / Float64(-1.0 / h)))) * t_1); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d / (M_m * D_m);
t_1 = d * sqrt((1.0 / (h * l)));
t_2 = 0.5 / t_0;
t_3 = (t_2 / 2.0) / l;
tmp = 0.0;
if (h <= -1.65e+55)
tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((0.5 * (h / (4.0 / ((M_m * D_m) / d)))) / (t_0 * l)));
elseif (h <= -1e-309)
tmp = t_1 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
elseif (h <= 9.2e+101)
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_1;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -1.65e+55], 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[(0.5 * N[(h / N[(4.0 / N[(N[(M$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$1 * N[(N[(t$95$3 * N[(t$95$2 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 9.2e+101], N[(N[(1.0 + N[(t$95$3 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M\_m \cdot D\_m}\\
t_1 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_2 := \frac{0.5}{t\_0}\\
t_3 := \frac{\frac{t\_2}{2}}{\ell}\\
\mathbf{if}\;h \leq -1.65 \cdot 10^{+55}:\\
\;\;\;\;\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 - \frac{0.5 \cdot \frac{h}{\frac{4}{\frac{M\_m \cdot D\_m}{d}}}}{t\_0 \cdot \ell}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_1 \cdot \left(t\_3 \cdot \frac{t\_2}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 9.2 \cdot 10^{+101}:\\
\;\;\;\;\left(1 + t\_3 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.65e55Initial program 63.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr71.7%
frac-timesN/A
div-invN/A
div-invN/A
clear-numN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
frac-timesN/A
/-lowering-/.f64N/A
Applied egg-rr71.7%
if -1.65e55 < h < -1.000000000000002e-309Initial program 71.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.9%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6490.3%
Simplified90.3%
if -1.000000000000002e-309 < h < 9.2000000000000005e101Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 9.2000000000000005e101 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification81.9%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (* d (sqrt (/ 1.0 (* h l)))))
(t_1 (/ 0.5 (/ d (* M_m D_m))))
(t_2 (/ (/ t_1 2.0) l))
(t_3 (+ 1.0 (* t_2 (/ t_1 (/ -1.0 h))))))
(if (<= h -4.2e+98)
(* t_3 (/ (sqrt (/ d h)) (sqrt (/ l d))))
(if (<= h -1e-309)
(* t_0 (+ (* t_2 (/ t_1 (/ 1.0 h))) -1.0))
(if (<= h 1.05e+97)
(* t_3 t_0)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double t_3 = 1.0 + (t_2 * (t_1 / (-1.0 / h)));
double tmp;
if (h <= -4.2e+98) {
tmp = t_3 * (sqrt((d / h)) / sqrt((l / d)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.05e+97) {
tmp = t_3 * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = d * sqrt((1.0d0 / (h * l)))
t_1 = 0.5d0 / (d / (m_m * d_m))
t_2 = (t_1 / 2.0d0) / l
t_3 = 1.0d0 + (t_2 * (t_1 / ((-1.0d0) / h)))
if (h <= (-4.2d+98)) then
tmp = t_3 * (sqrt((d / h)) / sqrt((l / d)))
else if (h <= (-1d-309)) then
tmp = t_0 * ((t_2 * (t_1 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 1.05d+97) then
tmp = t_3 * t_0
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * Math.sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double t_3 = 1.0 + (t_2 * (t_1 / (-1.0 / h)));
double tmp;
if (h <= -4.2e+98) {
tmp = t_3 * (Math.sqrt((d / h)) / Math.sqrt((l / d)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.05e+97) {
tmp = t_3 * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d * math.sqrt((1.0 / (h * l))) t_1 = 0.5 / (d / (M_m * D_m)) t_2 = (t_1 / 2.0) / l t_3 = 1.0 + (t_2 * (t_1 / (-1.0 / h))) tmp = 0 if h <= -4.2e+98: tmp = t_3 * (math.sqrt((d / h)) / math.sqrt((l / d))) elif h <= -1e-309: tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0) elif h <= 1.05e+97: tmp = t_3 * t_0 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_1 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_2 = Float64(Float64(t_1 / 2.0) / l) t_3 = Float64(1.0 + Float64(t_2 * Float64(t_1 / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -4.2e+98) tmp = Float64(t_3 * Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d)))); elseif (h <= -1e-309) tmp = Float64(t_0 * Float64(Float64(t_2 * Float64(t_1 / Float64(1.0 / h))) + -1.0)); elseif (h <= 1.05e+97) tmp = Float64(t_3 * t_0); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d * sqrt((1.0 / (h * l)));
t_1 = 0.5 / (d / (M_m * D_m));
t_2 = (t_1 / 2.0) / l;
t_3 = 1.0 + (t_2 * (t_1 / (-1.0 / h)));
tmp = 0.0;
if (h <= -4.2e+98)
tmp = t_3 * (sqrt((d / h)) / sqrt((l / d)));
elseif (h <= -1e-309)
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
elseif (h <= 1.05e+97)
tmp = t_3 * t_0;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(t$95$2 * N[(t$95$1 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -4.2e+98], N[(t$95$3 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$0 * N[(N[(t$95$2 * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.05e+97], N[(t$95$3 * t$95$0), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_2 := \frac{\frac{t\_1}{2}}{\ell}\\
t_3 := 1 + t\_2 \cdot \frac{t\_1}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -4.2 \cdot 10^{+98}:\\
\;\;\;\;t\_3 \cdot \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{t\_1}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 1.05 \cdot 10^{+97}:\\
\;\;\;\;t\_3 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -4.20000000000000008e98Initial program 60.9%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr70.9%
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
un-div-invN/A
/-lowering-/.f64N/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6470.9%
Applied egg-rr70.9%
if -4.20000000000000008e98 < h < -1.000000000000002e-309Initial program 71.7%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6489.0%
Simplified89.0%
if -1.000000000000002e-309 < h < 1.05000000000000006e97Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 1.05000000000000006e97 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification81.9%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (* d (sqrt (/ 1.0 (* h l)))))
(t_1 (/ 0.5 (/ d (* M_m D_m))))
(t_2 (/ (/ t_1 2.0) l)))
(if (<= h -6.8e+99)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(-
1.0
(/ (/ (/ (* M_m D_m) (* d 4.0)) l) (/ (/ d (* h (* M_m D_m))) 0.5))))
(if (<= h -1e-309)
(* t_0 (+ (* t_2 (/ t_1 (/ 1.0 h))) -1.0))
(if (<= h 1.3e+111)
(* (+ 1.0 (* t_2 (/ t_1 (/ -1.0 h)))) t_0)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double tmp;
if (h <= -6.8e+99) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 - ((((M_m * D_m) / (d * 4.0)) / l) / ((d / (h * (M_m * D_m))) / 0.5)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.3e+111) {
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = d * sqrt((1.0d0 / (h * l)))
t_1 = 0.5d0 / (d / (m_m * d_m))
t_2 = (t_1 / 2.0d0) / l
if (h <= (-6.8d+99)) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 - ((((m_m * d_m) / (d * 4.0d0)) / l) / ((d / (h * (m_m * d_m))) / 0.5d0)))
else if (h <= (-1d-309)) then
tmp = t_0 * ((t_2 * (t_1 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 1.3d+111) then
tmp = (1.0d0 + (t_2 * (t_1 / ((-1.0d0) / h)))) * t_0
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * Math.sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double tmp;
if (h <= -6.8e+99) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 - ((((M_m * D_m) / (d * 4.0)) / l) / ((d / (h * (M_m * D_m))) / 0.5)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 1.3e+111) {
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d * math.sqrt((1.0 / (h * l))) t_1 = 0.5 / (d / (M_m * D_m)) t_2 = (t_1 / 2.0) / l tmp = 0 if h <= -6.8e+99: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 - ((((M_m * D_m) / (d * 4.0)) / l) / ((d / (h * (M_m * D_m))) / 0.5))) elif h <= -1e-309: tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0) elif h <= 1.3e+111: tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_1 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_2 = Float64(Float64(t_1 / 2.0) / l) tmp = 0.0 if (h <= -6.8e+99) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 - Float64(Float64(Float64(Float64(M_m * D_m) / Float64(d * 4.0)) / l) / Float64(Float64(d / Float64(h * Float64(M_m * D_m))) / 0.5)))); elseif (h <= -1e-309) tmp = Float64(t_0 * Float64(Float64(t_2 * Float64(t_1 / Float64(1.0 / h))) + -1.0)); elseif (h <= 1.3e+111) tmp = Float64(Float64(1.0 + Float64(t_2 * Float64(t_1 / Float64(-1.0 / h)))) * t_0); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d * sqrt((1.0 / (h * l)));
t_1 = 0.5 / (d / (M_m * D_m));
t_2 = (t_1 / 2.0) / l;
tmp = 0.0;
if (h <= -6.8e+99)
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 - ((((M_m * D_m) / (d * 4.0)) / l) / ((d / (h * (M_m * D_m))) / 0.5)));
elseif (h <= -1e-309)
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
elseif (h <= 1.3e+111)
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -6.8e+99], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / N[(N[(d / N[(h * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$0 * N[(N[(t$95$2 * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.3e+111], N[(N[(1.0 + N[(t$95$2 * N[(t$95$1 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_2 := \frac{\frac{t\_1}{2}}{\ell}\\
\mathbf{if}\;h \leq -6.8 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \frac{\frac{\frac{M\_m \cdot D\_m}{d \cdot 4}}{\ell}}{\frac{\frac{d}{h \cdot \left(M\_m \cdot D\_m\right)}}{0.5}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{t\_1}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 1.3 \cdot 10^{+111}:\\
\;\;\;\;\left(1 + t\_2 \cdot \frac{t\_1}{\frac{-1}{h}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -6.79999999999999968e99Initial program 60.9%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr70.9%
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
un-div-invN/A
/-lowering-/.f64N/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6470.9%
Applied egg-rr70.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr70.9%
if -6.79999999999999968e99 < h < -1.000000000000002e-309Initial program 71.7%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6489.0%
Simplified89.0%
if -1.000000000000002e-309 < h < 1.2999999999999999e111Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 1.2999999999999999e111 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification81.9%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (* d (sqrt (/ 1.0 (* h l)))))
(t_1 (/ d (* M_m D_m)))
(t_2 (/ 0.5 t_1))
(t_3 (/ (/ t_2 2.0) l)))
(if (<= h -9e+49)
(*
(* (sqrt (/ d h)) (+ 1.0 (/ (* (/ -0.5 t_1) (/ (/ h 4.0) t_1)) l)))
(sqrt (/ d l)))
(if (<= h -1e-309)
(* t_0 (+ (* t_3 (/ t_2 (/ 1.0 h))) -1.0))
(if (<= h 1.25e+106)
(* (+ 1.0 (* t_3 (/ t_2 (/ -1.0 h)))) t_0)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * sqrt((1.0 / (h * l)));
double t_1 = d / (M_m * D_m);
double t_2 = 0.5 / t_1;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -9e+49) {
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_1) * ((h / 4.0) / t_1)) / l))) * sqrt((d / l));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 1.25e+106) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = d * sqrt((1.0d0 / (h * l)))
t_1 = d / (m_m * d_m)
t_2 = 0.5d0 / t_1
t_3 = (t_2 / 2.0d0) / l
if (h <= (-9d+49)) then
tmp = (sqrt((d / h)) * (1.0d0 + ((((-0.5d0) / t_1) * ((h / 4.0d0) / t_1)) / l))) * sqrt((d / l))
else if (h <= (-1d-309)) then
tmp = t_0 * ((t_3 * (t_2 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 1.25d+106) then
tmp = (1.0d0 + (t_3 * (t_2 / ((-1.0d0) / h)))) * t_0
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * Math.sqrt((1.0 / (h * l)));
double t_1 = d / (M_m * D_m);
double t_2 = 0.5 / t_1;
double t_3 = (t_2 / 2.0) / l;
double tmp;
if (h <= -9e+49) {
tmp = (Math.sqrt((d / h)) * (1.0 + (((-0.5 / t_1) * ((h / 4.0) / t_1)) / l))) * Math.sqrt((d / l));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
} else if (h <= 1.25e+106) {
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d * math.sqrt((1.0 / (h * l))) t_1 = d / (M_m * D_m) t_2 = 0.5 / t_1 t_3 = (t_2 / 2.0) / l tmp = 0 if h <= -9e+49: tmp = (math.sqrt((d / h)) * (1.0 + (((-0.5 / t_1) * ((h / 4.0) / t_1)) / l))) * math.sqrt((d / l)) elif h <= -1e-309: tmp = t_0 * ((t_3 * (t_2 / (1.0 / h))) + -1.0) elif h <= 1.25e+106: tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_0 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_1 = Float64(d / Float64(M_m * D_m)) t_2 = Float64(0.5 / t_1) t_3 = Float64(Float64(t_2 / 2.0) / l) tmp = 0.0 if (h <= -9e+49) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(Float64(-0.5 / t_1) * Float64(Float64(h / 4.0) / t_1)) / l))) * sqrt(Float64(d / l))); elseif (h <= -1e-309) tmp = Float64(t_0 * Float64(Float64(t_3 * Float64(t_2 / Float64(1.0 / h))) + -1.0)); elseif (h <= 1.25e+106) tmp = Float64(Float64(1.0 + Float64(t_3 * Float64(t_2 / Float64(-1.0 / h)))) * t_0); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d * sqrt((1.0 / (h * l)));
t_1 = d / (M_m * D_m);
t_2 = 0.5 / t_1;
t_3 = (t_2 / 2.0) / l;
tmp = 0.0;
if (h <= -9e+49)
tmp = (sqrt((d / h)) * (1.0 + (((-0.5 / t_1) * ((h / 4.0) / t_1)) / l))) * sqrt((d / l));
elseif (h <= -1e-309)
tmp = t_0 * ((t_3 * (t_2 / (1.0 / h))) + -1.0);
elseif (h <= 1.25e+106)
tmp = (1.0 + (t_3 * (t_2 / (-1.0 / h)))) * t_0;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -9e+49], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(-0.5 / t$95$1), $MachinePrecision] * N[(N[(h / 4.0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$0 * N[(N[(t$95$3 * N[(t$95$2 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.25e+106], N[(N[(1.0 + N[(t$95$3 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := \frac{d}{M\_m \cdot D\_m}\\
t_2 := \frac{0.5}{t\_1}\\
t_3 := \frac{\frac{t\_2}{2}}{\ell}\\
\mathbf{if}\;h \leq -9 \cdot 10^{+49}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\frac{-0.5}{t\_1} \cdot \frac{\frac{h}{4}}{t\_1}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot \frac{t\_2}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 1.25 \cdot 10^{+106}:\\
\;\;\;\;\left(1 + t\_3 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -8.99999999999999965e49Initial program 63.3%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr63.4%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6440.1%
Applied egg-rr40.1%
Applied egg-rr69.6%
if -8.99999999999999965e49 < h < -1.000000000000002e-309Initial program 71.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.9%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6490.3%
Simplified90.3%
if -1.000000000000002e-309 < h < 1.25e106Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 1.25e106 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification81.5%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (* d (sqrt (/ 1.0 (* h l)))))
(t_1 (/ 0.5 (/ d (* M_m D_m))))
(t_2 (/ (/ t_1 2.0) l)))
(if (<= h -2.8e+99)
(*
(/ (sqrt (/ d h)) (sqrt (/ l d)))
(- 1.0 (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l)))
(if (<= h -1e-309)
(* t_0 (+ (* t_2 (/ t_1 (/ 1.0 h))) -1.0))
(if (<= h 7e+110)
(* (+ 1.0 (* t_2 (/ t_1 (/ -1.0 h)))) t_0)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double tmp;
if (h <= -2.8e+99) {
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 7e+110) {
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = d * sqrt((1.0d0 / (h * l)))
t_1 = 0.5d0 / (d / (m_m * d_m))
t_2 = (t_1 / 2.0d0) / l
if (h <= (-2.8d+99)) then
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0d0 - ((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l))
else if (h <= (-1d-309)) then
tmp = t_0 * ((t_2 * (t_1 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 7d+110) then
tmp = (1.0d0 + (t_2 * (t_1 / ((-1.0d0) / h)))) * t_0
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * Math.sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = (t_1 / 2.0) / l;
double tmp;
if (h <= -2.8e+99) {
tmp = (Math.sqrt((d / h)) / Math.sqrt((l / d))) * (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
} else if (h <= 7e+110) {
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d * math.sqrt((1.0 / (h * l))) t_1 = 0.5 / (d / (M_m * D_m)) t_2 = (t_1 / 2.0) / l tmp = 0 if h <= -2.8e+99: tmp = (math.sqrt((d / h)) / math.sqrt((l / d))) * (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) elif h <= -1e-309: tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0) elif h <= 7e+110: tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_1 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_2 = Float64(Float64(t_1 / 2.0) / l) tmp = 0.0 if (h <= -2.8e+99) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 - Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l))); elseif (h <= -1e-309) tmp = Float64(t_0 * Float64(Float64(t_2 * Float64(t_1 / Float64(1.0 / h))) + -1.0)); elseif (h <= 7e+110) tmp = Float64(Float64(1.0 + Float64(t_2 * Float64(t_1 / Float64(-1.0 / h)))) * t_0); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d * sqrt((1.0 / (h * l)));
t_1 = 0.5 / (d / (M_m * D_m));
t_2 = (t_1 / 2.0) / l;
tmp = 0.0;
if (h <= -2.8e+99)
tmp = (sqrt((d / h)) / sqrt((l / d))) * (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l));
elseif (h <= -1e-309)
tmp = t_0 * ((t_2 * (t_1 / (1.0 / h))) + -1.0);
elseif (h <= 7e+110)
tmp = (1.0 + (t_2 * (t_1 / (-1.0 / h)))) * t_0;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[h, -2.8e+99], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$0 * N[(N[(t$95$2 * N[(t$95$1 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7e+110], N[(N[(1.0 + N[(t$95$2 * N[(t$95$1 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_2 := \frac{\frac{t\_1}{2}}{\ell}\\
\mathbf{if}\;h \leq -2.8 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{t\_1}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 7 \cdot 10^{+110}:\\
\;\;\;\;\left(1 + t\_2 \cdot \frac{t\_1}{\frac{-1}{h}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -2.8e99Initial program 60.9%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified61.3%
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
un-div-invN/A
/-lowering-/.f64N/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6461.3%
Applied egg-rr61.3%
if -2.8e99 < h < -1.000000000000002e-309Initial program 71.7%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6489.0%
Simplified89.0%
if -1.000000000000002e-309 < h < 6.9999999999999998e110Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 6.9999999999999998e110 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification80.3%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ 0.5 (/ d (* M_m D_m))))
(t_1 (/ (/ t_0 2.0) l))
(t_2 (* d (sqrt (/ 1.0 (* h l))))))
(if (<= h -1e-309)
(* t_2 (+ (* t_1 (/ t_0 (/ 1.0 h))) -1.0))
(if (<= h 6.5e+109)
(* (+ 1.0 (* t_1 (/ t_0 (/ -1.0 h)))) t_2)
(/
(/
(*
d
(-
1.0
(/ (* D_m (* (* M_m D_m) (* h (* M_m 0.125)))) (* l (* d d)))))
(sqrt h))
(sqrt l))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double t_1 = (t_0 / 2.0) / l;
double t_2 = d * sqrt((1.0 / (h * l)));
double tmp;
if (h <= -1e-309) {
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else if (h <= 6.5e+109) {
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 / (d / (m_m * d_m))
t_1 = (t_0 / 2.0d0) / l
t_2 = d * sqrt((1.0d0 / (h * l)))
if (h <= (-1d-309)) then
tmp = t_2 * ((t_1 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else if (h <= 6.5d+109) then
tmp = (1.0d0 + (t_1 * (t_0 / ((-1.0d0) / h)))) * t_2
else
tmp = ((d * (1.0d0 - ((d_m * ((m_m * d_m) * (h * (m_m * 0.125d0)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double t_1 = (t_0 / 2.0) / l;
double t_2 = d * Math.sqrt((1.0 / (h * l)));
double tmp;
if (h <= -1e-309) {
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else if (h <= 6.5e+109) {
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
} else {
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = 0.5 / (d / (M_m * D_m)) t_1 = (t_0 / 2.0) / l t_2 = d * math.sqrt((1.0 / (h * l))) tmp = 0 if h <= -1e-309: tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0) elif h <= 6.5e+109: tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2 else: tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / math.sqrt(h)) / math.sqrt(l) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_1 = Float64(Float64(t_0 / 2.0) / l) t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) tmp = 0.0 if (h <= -1e-309) tmp = Float64(t_2 * Float64(Float64(t_1 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); elseif (h <= 6.5e+109) tmp = Float64(Float64(1.0 + Float64(t_1 * Float64(t_0 / Float64(-1.0 / h)))) * t_2); else tmp = Float64(Float64(Float64(d * Float64(1.0 - Float64(Float64(D_m * Float64(Float64(M_m * D_m) * Float64(h * Float64(M_m * 0.125)))) / Float64(l * Float64(d * d))))) / sqrt(h)) / sqrt(l)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = 0.5 / (d / (M_m * D_m));
t_1 = (t_0 / 2.0) / l;
t_2 = d * sqrt((1.0 / (h * l)));
tmp = 0.0;
if (h <= -1e-309)
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
elseif (h <= 6.5e+109)
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
else
tmp = ((d * (1.0 - ((D_m * ((M_m * D_m) * (h * (M_m * 0.125)))) / (l * (d * d))))) / sqrt(h)) / sqrt(l);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(t$95$2 * N[(N[(t$95$1 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 6.5e+109], N[(N[(1.0 + N[(t$95$1 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[(d * N[(1.0 - N[(N[(D$95$m * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_1 := \frac{\frac{t\_0}{2}}{\ell}\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{elif}\;h \leq 6.5 \cdot 10^{+109}:\\
\;\;\;\;\left(1 + t\_1 \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \left(1 - \frac{D\_m \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(h \cdot \left(M\_m \cdot 0.125\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 68.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6478.1%
Simplified78.1%
if -1.000000000000002e-309 < h < 6.5e109Initial program 70.5%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr74.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
if 6.5e109 < h Initial program 46.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified44.5%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6439.8%
Applied egg-rr39.8%
associate-*l/N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr66.2%
Final simplification79.3%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (* d (sqrt (/ 1.0 (* h l)))))
(t_1 (/ 0.5 (/ d (* M_m D_m))))
(t_2 (/ t_1 2.0)))
(if (<= h -6.2e+99)
(*
(- 1.0 (/ (* (/ (/ (* M_m D_m) d) l) (* h (* (* M_m D_m) 0.125))) d))
(sqrt (/ (/ d l) (/ h d))))
(if (<= h -1e-309)
(* t_0 (+ (* t_1 (* t_2 (/ h l))) -1.0))
(* (+ 1.0 (* (/ t_2 l) (/ t_1 (/ -1.0 h)))) t_0)))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = t_1 / 2.0;
double tmp;
if (h <= -6.2e+99) {
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * sqrt(((d / l) / (h / d)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_1 * (t_2 * (h / l))) + -1.0);
} else {
tmp = (1.0 + ((t_2 / l) * (t_1 / (-1.0 / h)))) * t_0;
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = d * sqrt((1.0d0 / (h * l)))
t_1 = 0.5d0 / (d / (m_m * d_m))
t_2 = t_1 / 2.0d0
if (h <= (-6.2d+99)) then
tmp = (1.0d0 - (((((m_m * d_m) / d) / l) * (h * ((m_m * d_m) * 0.125d0))) / d)) * sqrt(((d / l) / (h / d)))
else if (h <= (-1d-309)) then
tmp = t_0 * ((t_1 * (t_2 * (h / l))) + (-1.0d0))
else
tmp = (1.0d0 + ((t_2 / l) * (t_1 / ((-1.0d0) / h)))) * t_0
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d * Math.sqrt((1.0 / (h * l)));
double t_1 = 0.5 / (d / (M_m * D_m));
double t_2 = t_1 / 2.0;
double tmp;
if (h <= -6.2e+99) {
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * Math.sqrt(((d / l) / (h / d)));
} else if (h <= -1e-309) {
tmp = t_0 * ((t_1 * (t_2 * (h / l))) + -1.0);
} else {
tmp = (1.0 + ((t_2 / l) * (t_1 / (-1.0 / h)))) * t_0;
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d * math.sqrt((1.0 / (h * l))) t_1 = 0.5 / (d / (M_m * D_m)) t_2 = t_1 / 2.0 tmp = 0 if h <= -6.2e+99: tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * math.sqrt(((d / l) / (h / d))) elif h <= -1e-309: tmp = t_0 * ((t_1 * (t_2 * (h / l))) + -1.0) else: tmp = (1.0 + ((t_2 / l) * (t_1 / (-1.0 / h)))) * t_0 return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) t_1 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_2 = Float64(t_1 / 2.0) tmp = 0.0 if (h <= -6.2e+99) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M_m * D_m) / d) / l) * Float64(h * Float64(Float64(M_m * D_m) * 0.125))) / d)) * sqrt(Float64(Float64(d / l) / Float64(h / d)))); elseif (h <= -1e-309) tmp = Float64(t_0 * Float64(Float64(t_1 * Float64(t_2 * Float64(h / l))) + -1.0)); else tmp = Float64(Float64(1.0 + Float64(Float64(t_2 / l) * Float64(t_1 / Float64(-1.0 / h)))) * t_0); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d * sqrt((1.0 / (h * l)));
t_1 = 0.5 / (d / (M_m * D_m));
t_2 = t_1 / 2.0;
tmp = 0.0;
if (h <= -6.2e+99)
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * sqrt(((d / l) / (h / d)));
elseif (h <= -1e-309)
tmp = t_0 * ((t_1 * (t_2 * (h / l))) + -1.0);
else
tmp = (1.0 + ((t_2 / l) * (t_1 / (-1.0 / h)))) * t_0;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / 2.0), $MachinePrecision]}, If[LessEqual[h, -6.2e+99], N[(N[(1.0 - N[(N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] * N[(h * N[(N[(M$95$m * D$95$m), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(t$95$0 * N[(N[(t$95$1 * N[(t$95$2 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(t$95$2 / l), $MachinePrecision] * N[(t$95$1 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
t_1 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_2 := \frac{t\_1}{2}\\
\mathbf{if}\;h \leq -6.2 \cdot 10^{+99}:\\
\;\;\;\;\left(1 - \frac{\frac{\frac{M\_m \cdot D\_m}{d}}{\ell} \cdot \left(h \cdot \left(\left(M\_m \cdot D\_m\right) \cdot 0.125\right)\right)}{d}\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(t\_2 \cdot \frac{h}{\ell}\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{t\_2}{\ell} \cdot \frac{t\_1}{\frac{-1}{h}}\right) \cdot t\_0\\
\end{array}
\end{array}
if h < -6.2000000000000001e99Initial program 60.9%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified61.3%
Applied egg-rr28.2%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6452.4%
Applied egg-rr52.4%
if -6.2000000000000001e99 < h < -1.000000000000002e-309Initial program 71.7%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr73.8%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6487.9%
Simplified87.9%
if -1.000000000000002e-309 < h Initial program 62.0%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6477.5%
Simplified77.5%
Final simplification77.1%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(if (<= d -4.3e+188)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -1e-180)
(*
(- 1.0 (/ (* (/ (/ (* M_m D_m) d) l) (* h (* (* M_m D_m) 0.125))) d))
(sqrt (/ (/ d l) (/ h d))))
(if (<= d -4.9e-296)
(*
(sqrt (/ (/ h l) (* l l)))
(* 0.125 (* D_m (/ (* D_m (* M_m M_m)) d))))
(*
(- 1.0 (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l))
(/ d (sqrt (* h l))))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -4.3e+188) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -1e-180) {
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * sqrt(((d / l) / (h / d)));
} else if (d <= -4.9e-296) {
tmp = sqrt(((h / l) / (l * l))) * (0.125 * (D_m * ((D_m * (M_m * M_m)) / d)));
} else {
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / sqrt((h * l)));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-4.3d+188)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-1d-180)) then
tmp = (1.0d0 - (((((m_m * d_m) / d) / l) * (h * ((m_m * d_m) * 0.125d0))) / d)) * sqrt(((d / l) / (h / d)))
else if (d <= (-4.9d-296)) then
tmp = sqrt(((h / l) / (l * l))) * (0.125d0 * (d_m * ((d_m * (m_m * m_m)) / d)))
else
tmp = (1.0d0 - ((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l)) * (d / sqrt((h * l)))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -4.3e+188) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -1e-180) {
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * Math.sqrt(((d / l) / (h / d)));
} else if (d <= -4.9e-296) {
tmp = Math.sqrt(((h / l) / (l * l))) * (0.125 * (D_m * ((D_m * (M_m * M_m)) / d)));
} else {
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / Math.sqrt((h * l)));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -4.3e+188: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -1e-180: tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * math.sqrt(((d / l) / (h / d))) elif d <= -4.9e-296: tmp = math.sqrt(((h / l) / (l * l))) * (0.125 * (D_m * ((D_m * (M_m * M_m)) / d))) else: tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / math.sqrt((h * l))) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -4.3e+188) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -1e-180) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M_m * D_m) / d) / l) * Float64(h * Float64(Float64(M_m * D_m) * 0.125))) / d)) * sqrt(Float64(Float64(d / l) / Float64(h / d)))); elseif (d <= -4.9e-296) tmp = Float64(sqrt(Float64(Float64(h / l) / Float64(l * l))) * Float64(0.125 * Float64(D_m * Float64(Float64(D_m * Float64(M_m * M_m)) / d)))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l)) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -4.3e+188)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -1e-180)
tmp = (1.0 - (((((M_m * D_m) / d) / l) * (h * ((M_m * D_m) * 0.125))) / d)) * sqrt(((d / l) / (h / d)));
elseif (d <= -4.9e-296)
tmp = sqrt(((h / l) / (l * l))) * (0.125 * (D_m * ((D_m * (M_m * M_m)) / d)));
else
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / sqrt((h * l)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -4.3e+188], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-180], N[(N[(1.0 - N[(N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] * N[(h * N[(N[(M$95$m * D$95$m), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.9e-296], N[(N[Sqrt[N[(N[(h / l), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.125 * N[(D$95$m * N[(N[(D$95$m * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.3 \cdot 10^{+188}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-180}:\\
\;\;\;\;\left(1 - \frac{\frac{\frac{M\_m \cdot D\_m}{d}}{\ell} \cdot \left(h \cdot \left(\left(M\_m \cdot D\_m\right) \cdot 0.125\right)\right)}{d}\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(0.125 \cdot \left(D\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot M\_m\right)}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -4.29999999999999985e188Initial program 74.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.1%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6477.6%
Simplified77.6%
if -4.29999999999999985e188 < d < -1e-180Initial program 73.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified72.6%
Applied egg-rr55.5%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.2%
Applied egg-rr70.2%
if -1e-180 < d < -4.8999999999999998e-296Initial program 50.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified40.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
cube-multN/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
associate-/l*N/A
Simplified51.5%
if -4.8999999999999998e-296 < d Initial program 61.1%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.2%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6447.4%
Applied egg-rr47.4%
sqrt-prodN/A
rem-square-sqrt67.3%
Applied egg-rr67.3%
Final simplification67.8%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0
(-
1.0
(/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l))))
(if (<= d -1.75e+188)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -3.5e-94)
(* t_0 (sqrt (/ (/ d l) (/ h d))))
(if (<= d -3.25e-308)
(*
(sqrt (/ h (* l (* l l))))
(* (* M_m (/ M_m d)) (* 0.125 (* D_m D_m))))
(* t_0 (/ d (sqrt (* h l)))))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l);
double tmp;
if (d <= -1.75e+188) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -3.5e-94) {
tmp = t_0 * sqrt(((d / l) / (h / d)));
} else if (d <= -3.25e-308) {
tmp = sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else {
tmp = t_0 * (d / sqrt((h * l)));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l)
if (d <= (-1.75d+188)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-3.5d-94)) then
tmp = t_0 * sqrt(((d / l) / (h / d)))
else if (d <= (-3.25d-308)) then
tmp = sqrt((h / (l * (l * l)))) * ((m_m * (m_m / d)) * (0.125d0 * (d_m * d_m)))
else
tmp = t_0 * (d / sqrt((h * l)))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l);
double tmp;
if (d <= -1.75e+188) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -3.5e-94) {
tmp = t_0 * Math.sqrt(((d / l) / (h / d)));
} else if (d <= -3.25e-308) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else {
tmp = t_0 * (d / Math.sqrt((h * l)));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = 1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) tmp = 0 if d <= -1.75e+188: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -3.5e-94: tmp = t_0 * math.sqrt(((d / l) / (h / d))) elif d <= -3.25e-308: tmp = math.sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m))) else: tmp = t_0 * (d / math.sqrt((h * l))) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l)) tmp = 0.0 if (d <= -1.75e+188) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -3.5e-94) tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) / Float64(h / d)))); elseif (d <= -3.25e-308) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(M_m * Float64(M_m / d)) * Float64(0.125 * Float64(D_m * D_m)))); else tmp = Float64(t_0 * Float64(d / sqrt(Float64(h * l)))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = 1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l);
tmp = 0.0;
if (d <= -1.75e+188)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -3.5e-94)
tmp = t_0 * sqrt(((d / l) / (h / d)));
elseif (d <= -3.25e-308)
tmp = sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
else
tmp = t_0 * (d / sqrt((h * l)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.75e+188], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.5e-94], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.25e-308], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := 1 - \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell}\\
\mathbf{if}\;d \leq -1.75 \cdot 10^{+188}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -3.5 \cdot 10^{-94}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\mathbf{elif}\;d \leq -3.25 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(M\_m \cdot \frac{M\_m}{d}\right) \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.75000000000000004e188Initial program 74.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.1%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6477.6%
Simplified77.6%
if -1.75000000000000004e188 < d < -3.49999999999999998e-94Initial program 76.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified73.0%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6463.1%
Applied egg-rr63.1%
if -3.49999999999999998e-94 < d < -3.24999999999999995e-308Initial program 56.9%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr58.6%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6444.4%
Applied egg-rr44.4%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
associate-*r/N/A
Simplified42.8%
if -3.24999999999999995e-308 < d Initial program 61.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6447.7%
Applied egg-rr47.7%
sqrt-prodN/A
rem-square-sqrt67.8%
Applied egg-rr67.8%
Final simplification63.5%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ 0.5 (/ d (* M_m D_m))))
(t_1 (/ (/ t_0 2.0) l))
(t_2 (* d (sqrt (/ 1.0 (* h l))))))
(if (<= h -1e-309)
(* t_2 (+ (* t_1 (/ t_0 (/ 1.0 h))) -1.0))
(* (+ 1.0 (* t_1 (/ t_0 (/ -1.0 h)))) t_2))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double t_1 = (t_0 / 2.0) / l;
double t_2 = d * sqrt((1.0 / (h * l)));
double tmp;
if (h <= -1e-309) {
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.5d0 / (d / (m_m * d_m))
t_1 = (t_0 / 2.0d0) / l
t_2 = d * sqrt((1.0d0 / (h * l)))
if (h <= (-1d-309)) then
tmp = t_2 * ((t_1 * (t_0 / (1.0d0 / h))) + (-1.0d0))
else
tmp = (1.0d0 + (t_1 * (t_0 / ((-1.0d0) / h)))) * t_2
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double t_1 = (t_0 / 2.0) / l;
double t_2 = d * Math.sqrt((1.0 / (h * l)));
double tmp;
if (h <= -1e-309) {
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
} else {
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = 0.5 / (d / (M_m * D_m)) t_1 = (t_0 / 2.0) / l t_2 = d * math.sqrt((1.0 / (h * l))) tmp = 0 if h <= -1e-309: tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0) else: tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2 return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) t_1 = Float64(Float64(t_0 / 2.0) / l) t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) tmp = 0.0 if (h <= -1e-309) tmp = Float64(t_2 * Float64(Float64(t_1 * Float64(t_0 / Float64(1.0 / h))) + -1.0)); else tmp = Float64(Float64(1.0 + Float64(t_1 * Float64(t_0 / Float64(-1.0 / h)))) * t_2); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = 0.5 / (d / (M_m * D_m));
t_1 = (t_0 / 2.0) / l;
t_2 = d * sqrt((1.0 / (h * l)));
tmp = 0.0;
if (h <= -1e-309)
tmp = t_2 * ((t_1 * (t_0 / (1.0 / h))) + -1.0);
else
tmp = (1.0 + (t_1 * (t_0 / (-1.0 / h)))) * t_2;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / 2.0), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(t$95$2 * N[(N[(t$95$1 * N[(t$95$0 / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$1 * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
t_1 := \frac{\frac{t\_0}{2}}{\ell}\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \frac{t\_0}{\frac{1}{h}} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t\_1 \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot t\_2\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 68.3%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr73.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6478.1%
Simplified78.1%
if -1.000000000000002e-309 < h Initial program 62.0%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6477.5%
Simplified77.5%
Final simplification77.8%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ 0.5 (/ d (* M_m D_m)))))
(if (<= h -1e-309)
(*
(/ d (sqrt (* h l)))
(+ (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l) -1.0))
(*
(+ 1.0 (* (/ (/ t_0 2.0) l) (/ t_0 (/ -1.0 h))))
(* d (sqrt (/ 1.0 (* h l))))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double tmp;
if (h <= -1e-309) {
tmp = (d / sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
} else {
tmp = (1.0 + (((t_0 / 2.0) / l) * (t_0 / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l))));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 / (d / (m_m * d_m))
if (h <= (-1d-309)) then
tmp = (d / sqrt((h * l))) * (((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l) + (-1.0d0))
else
tmp = (1.0d0 + (((t_0 / 2.0d0) / l) * (t_0 / ((-1.0d0) / h)))) * (d * sqrt((1.0d0 / (h * l))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = 0.5 / (d / (M_m * D_m));
double tmp;
if (h <= -1e-309) {
tmp = (d / Math.sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
} else {
tmp = (1.0 + (((t_0 / 2.0) / l) * (t_0 / (-1.0 / h)))) * (d * Math.sqrt((1.0 / (h * l))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = 0.5 / (d / (M_m * D_m)) tmp = 0 if h <= -1e-309: tmp = (d / math.sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0) else: tmp = (1.0 + (((t_0 / 2.0) / l) * (t_0 / (-1.0 / h)))) * (d * math.sqrt((1.0 / (h * l)))) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(0.5 / Float64(d / Float64(M_m * D_m))) tmp = 0.0 if (h <= -1e-309) tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l) + -1.0)); else tmp = Float64(Float64(1.0 + Float64(Float64(Float64(t_0 / 2.0) / l) * Float64(t_0 / Float64(-1.0 / h)))) * Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = 0.5 / (d / (M_m * D_m));
tmp = 0.0;
if (h <= -1e-309)
tmp = (d / sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
else
tmp = (1.0 + (((t_0 / 2.0) / l) * (t_0 / (-1.0 / h)))) * (d * sqrt((1.0 / (h * l))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(0.5 / N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[(t$95$0 / 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{0.5}{\frac{d}{M\_m \cdot D\_m}}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(\frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{\frac{t\_0}{2}}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\
\end{array}
\end{array}
if h < -1.000000000000002e-309Initial program 68.3%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified60.9%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6442.8%
Applied egg-rr42.8%
Taylor expanded in d around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6466.9%
Simplified66.9%
if -1.000000000000002e-309 < h Initial program 62.0%
clear-numN/A
un-div-invN/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
Applied egg-rr68.1%
Taylor expanded in d around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6477.5%
Simplified77.5%
Final simplification72.1%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(if (<= d -8.8e-23)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -3.25e-308)
(* (sqrt (/ h (* l (* l l)))) (* (* M_m (/ M_m d)) (* 0.125 (* D_m D_m))))
(*
(- 1.0 (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l))
(/ d (sqrt (* h l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -8.8e-23) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else {
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / sqrt((h * l)));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-8.8d-23)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-3.25d-308)) then
tmp = sqrt((h / (l * (l * l)))) * ((m_m * (m_m / d)) * (0.125d0 * (d_m * d_m)))
else
tmp = (1.0d0 - ((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l)) * (d / sqrt((h * l)))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -8.8e-23) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else {
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / Math.sqrt((h * l)));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -8.8e-23: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -3.25e-308: tmp = math.sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m))) else: tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / math.sqrt((h * l))) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -8.8e-23) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -3.25e-308) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(M_m * Float64(M_m / d)) * Float64(0.125 * Float64(D_m * D_m)))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l)) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -8.8e-23)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -3.25e-308)
tmp = sqrt((h / (l * (l * l)))) * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
else
tmp = (1.0 - ((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l)) * (d / sqrt((h * l)));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -8.8e-23], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.25e-308], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -8.8 \cdot 10^{-23}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -3.25 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(M\_m \cdot \frac{M\_m}{d}\right) \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -8.7999999999999998e-23Initial program 78.0%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.3%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6464.3%
Simplified64.3%
if -8.7999999999999998e-23 < d < -3.24999999999999995e-308Initial program 56.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr57.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6445.0%
Applied egg-rr45.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
associate-*r/N/A
Simplified41.8%
if -3.24999999999999995e-308 < d Initial program 61.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6447.7%
Applied egg-rr47.7%
sqrt-prodN/A
rem-square-sqrt67.8%
Applied egg-rr67.8%
Final simplification61.3%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))))
(if (<= d -5.4e-25)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -3.25e-308)
(* t_0 (* (* M_m (/ M_m d)) (* 0.125 (* D_m D_m))))
(if (<= d 4.8e-122)
(* (* D_m D_m) (* t_0 (* -0.125 (/ (* M_m M_m) d))))
(* d (sqrt (/ (/ 1.0 l) h))))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -5.4e-25) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else if (d <= 4.8e-122) {
tmp = (D_m * D_m) * (t_0 * (-0.125 * ((M_m * M_m) / d)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((h / (l * (l * l))))
if (d <= (-5.4d-25)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-3.25d-308)) then
tmp = t_0 * ((m_m * (m_m / d)) * (0.125d0 * (d_m * d_m)))
else if (d <= 4.8d-122) then
tmp = (d_m * d_m) * (t_0 * ((-0.125d0) * ((m_m * m_m) / d)))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (d <= -5.4e-25) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else if (d <= 4.8e-122) {
tmp = (D_m * D_m) * (t_0 * (-0.125 * ((M_m * M_m) / d)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if d <= -5.4e-25: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -3.25e-308: tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m))) elif d <= 4.8e-122: tmp = (D_m * D_m) * (t_0 * (-0.125 * ((M_m * M_m) / d))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -5.4e-25) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -3.25e-308) tmp = Float64(t_0 * Float64(Float64(M_m * Float64(M_m / d)) * Float64(0.125 * Float64(D_m * D_m)))); elseif (d <= 4.8e-122) tmp = Float64(Float64(D_m * D_m) * Float64(t_0 * Float64(-0.125 * Float64(Float64(M_m * M_m) / d)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = sqrt((h / (l * (l * l))));
tmp = 0.0;
if (d <= -5.4e-25)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -3.25e-308)
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
elseif (d <= 4.8e-122)
tmp = (D_m * D_m) * (t_0 * (-0.125 * ((M_m * M_m) / d)));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5.4e-25], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.25e-308], N[(t$95$0 * N[(N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.8e-122], N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(t$95$0 * N[(-0.125 * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -5.4 \cdot 10^{-25}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -3.25 \cdot 10^{-308}:\\
\;\;\;\;t\_0 \cdot \left(\left(M\_m \cdot \frac{M\_m}{d}\right) \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\
\mathbf{elif}\;d \leq 4.8 \cdot 10^{-122}:\\
\;\;\;\;\left(D\_m \cdot D\_m\right) \cdot \left(t\_0 \cdot \left(-0.125 \cdot \frac{M\_m \cdot M\_m}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if d < -5.40000000000000032e-25Initial program 78.0%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.3%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6464.3%
Simplified64.3%
if -5.40000000000000032e-25 < d < -3.24999999999999995e-308Initial program 56.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr57.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6445.0%
Applied egg-rr45.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
associate-*r/N/A
Simplified41.8%
if -3.24999999999999995e-308 < d < 4.79999999999999975e-122Initial program 37.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr41.6%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6432.5%
Applied egg-rr32.5%
Applied egg-rr39.3%
Taylor expanded in d around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
Simplified42.2%
if 4.79999999999999975e-122 < d Initial program 72.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified68.1%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6454.3%
Simplified54.3%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.9%
Applied egg-rr54.9%
Final simplification53.0%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))))
(if (<= d -5.6e-19)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -3.25e-308)
(* t_0 (* (* M_m (/ M_m d)) (* 0.125 (* D_m D_m))))
(if (<= d 2.1e-119)
(* t_0 (* (* D_m D_m) (/ (* (* M_m M_m) -0.125) d)))
(* d (sqrt (/ (/ 1.0 l) h))))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -5.6e-19) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else if (d <= 2.1e-119) {
tmp = t_0 * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((h / (l * (l * l))))
if (d <= (-5.6d-19)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-3.25d-308)) then
tmp = t_0 * ((m_m * (m_m / d)) * (0.125d0 * (d_m * d_m)))
else if (d <= 2.1d-119) then
tmp = t_0 * ((d_m * d_m) * (((m_m * m_m) * (-0.125d0)) / d))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (d <= -5.6e-19) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -3.25e-308) {
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
} else if (d <= 2.1e-119) {
tmp = t_0 * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if d <= -5.6e-19: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -3.25e-308: tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m))) elif d <= 2.1e-119: tmp = t_0 * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d)) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -5.6e-19) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -3.25e-308) tmp = Float64(t_0 * Float64(Float64(M_m * Float64(M_m / d)) * Float64(0.125 * Float64(D_m * D_m)))); elseif (d <= 2.1e-119) tmp = Float64(t_0 * Float64(Float64(D_m * D_m) * Float64(Float64(Float64(M_m * M_m) * -0.125) / d))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = sqrt((h / (l * (l * l))));
tmp = 0.0;
if (d <= -5.6e-19)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -3.25e-308)
tmp = t_0 * ((M_m * (M_m / d)) * (0.125 * (D_m * D_m)));
elseif (d <= 2.1e-119)
tmp = t_0 * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5.6e-19], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.25e-308], N[(t$95$0 * N[(N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.1e-119], N[(t$95$0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -5.6 \cdot 10^{-19}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -3.25 \cdot 10^{-308}:\\
\;\;\;\;t\_0 \cdot \left(\left(M\_m \cdot \frac{M\_m}{d}\right) \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\
\mathbf{elif}\;d \leq 2.1 \cdot 10^{-119}:\\
\;\;\;\;t\_0 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot -0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if d < -5.60000000000000005e-19Initial program 78.0%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.3%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6464.3%
Simplified64.3%
if -5.60000000000000005e-19 < d < -3.24999999999999995e-308Initial program 56.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr57.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6445.0%
Applied egg-rr45.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
associate-*r/N/A
Simplified41.8%
if -3.24999999999999995e-308 < d < 2.1e-119Initial program 37.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr41.6%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6432.5%
Applied egg-rr32.5%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified39.6%
if 2.1e-119 < d Initial program 72.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified68.1%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6454.3%
Simplified54.3%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.9%
Applied egg-rr54.9%
Final simplification52.6%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(if (<= d -6.6e-37)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= d -5e-310)
(* d (pow (/ (/ 1.0 (* h (* l l))) h) 0.25))
(if (<= d 2.8e-120)
(*
(sqrt (/ h (* l (* l l))))
(* (* D_m D_m) (/ (* (* M_m M_m) -0.125) d)))
(* d (sqrt (/ (/ 1.0 l) h)))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -6.6e-37) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = d * pow(((1.0 / (h * (l * l))) / h), 0.25);
} else if (d <= 2.8e-120) {
tmp = sqrt((h / (l * (l * l)))) * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-6.6d-37)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (d <= (-5d-310)) then
tmp = d * (((1.0d0 / (h * (l * l))) / h) ** 0.25d0)
else if (d <= 2.8d-120) then
tmp = sqrt((h / (l * (l * l)))) * ((d_m * d_m) * (((m_m * m_m) * (-0.125d0)) / d))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -6.6e-37) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = d * Math.pow(((1.0 / (h * (l * l))) / h), 0.25);
} else if (d <= 2.8e-120) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -6.6e-37: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif d <= -5e-310: tmp = d * math.pow(((1.0 / (h * (l * l))) / h), 0.25) elif d <= 2.8e-120: tmp = math.sqrt((h / (l * (l * l)))) * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d)) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -6.6e-37) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -5e-310) tmp = Float64(d * (Float64(Float64(1.0 / Float64(h * Float64(l * l))) / h) ^ 0.25)); elseif (d <= 2.8e-120) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D_m * D_m) * Float64(Float64(Float64(M_m * M_m) * -0.125) / d))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -6.6e-37)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (d <= -5e-310)
tmp = d * (((1.0 / (h * (l * l))) / h) ^ 0.25);
elseif (d <= 2.8e-120)
tmp = sqrt((h / (l * (l * l)))) * ((D_m * D_m) * (((M_m * M_m) * -0.125) / d));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -6.6e-37], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Power[N[(N[(1.0 / N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.8e-120], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.6 \cdot 10^{-37}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(\frac{\frac{1}{h \cdot \left(\ell \cdot \ell\right)}}{h}\right)}^{0.25}\\
\mathbf{elif}\;d \leq 2.8 \cdot 10^{-120}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot -0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if d < -6.59999999999999964e-37Initial program 78.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified67.2%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6464.0%
Simplified64.0%
if -6.59999999999999964e-37 < d < -4.999999999999985e-310Initial program 53.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified51.8%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6412.3%
Simplified12.3%
pow1/2N/A
metadata-evalN/A
sqr-powN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval27.0%
Applied egg-rr27.0%
Taylor expanded in h around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/r*N/A
associate-/l/N/A
/-lowering-/.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.6%
Simplified34.6%
if -4.999999999999985e-310 < d < 2.79999999999999994e-120Initial program 38.1%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr42.7%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6433.3%
Applied egg-rr33.3%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified40.7%
if 2.79999999999999994e-120 < d Initial program 72.4%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified68.1%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6454.3%
Simplified54.3%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.9%
Applied egg-rr54.9%
Final simplification51.3%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ d (* M_m D_m))))
(if (<= d 5.2e-304)
(*
(/ d (sqrt (* h l)))
(+ (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l) -1.0))
(/
(+ 1.0 (/ (* (/ -0.5 t_0) (/ (/ h 4.0) t_0)) l))
(/ (pow (* h l) 0.5) d)))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double tmp;
if (d <= 5.2e-304) {
tmp = (d / sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
} else {
tmp = (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l)) / (pow((h * l), 0.5) / d);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: tmp
t_0 = d / (m_m * d_m)
if (d <= 5.2d-304) then
tmp = (d / sqrt((h * l))) * (((((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l) + (-1.0d0))
else
tmp = (1.0d0 + ((((-0.5d0) / t_0) * ((h / 4.0d0) / t_0)) / l)) / (((h * l) ** 0.5d0) / d)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = d / (M_m * D_m);
double tmp;
if (d <= 5.2e-304) {
tmp = (d / Math.sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
} else {
tmp = (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l)) / (Math.pow((h * l), 0.5) / d);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = d / (M_m * D_m) tmp = 0 if d <= 5.2e-304: tmp = (d / math.sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0) else: tmp = (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l)) / (math.pow((h * l), 0.5) / d) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(d / Float64(M_m * D_m)) tmp = 0.0 if (d <= 5.2e-304) tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l) + -1.0)); else tmp = Float64(Float64(1.0 + Float64(Float64(Float64(-0.5 / t_0) * Float64(Float64(h / 4.0) / t_0)) / l)) / Float64((Float64(h * l) ^ 0.5) / d)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = d / (M_m * D_m);
tmp = 0.0;
if (d <= 5.2e-304)
tmp = (d / sqrt((h * l))) * (((((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l) + -1.0);
else
tmp = (1.0 + (((-0.5 / t_0) * ((h / 4.0) / t_0)) / l)) / (((h * l) ^ 0.5) / d);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 5.2e-304], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[(-0.5 / t$95$0), $MachinePrecision] * N[(N[(h / 4.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[(h * l), $MachinePrecision], 0.5], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M\_m \cdot D\_m}\\
\mathbf{if}\;d \leq 5.2 \cdot 10^{-304}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(\frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{\frac{-0.5}{t\_0} \cdot \frac{\frac{h}{4}}{t\_0}}{\ell}}{\frac{{\left(h \cdot \ell\right)}^{0.5}}{d}}\\
\end{array}
\end{array}
if d < 5.19999999999999993e-304Initial program 67.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified60.4%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6442.5%
Applied egg-rr42.5%
Taylor expanded in d around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6466.4%
Simplified66.4%
if 5.19999999999999993e-304 < d Initial program 62.5%
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
clear-numN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr65.3%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
associate-*l/N/A
clear-numN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6454.4%
Applied egg-rr54.4%
Applied egg-rr74.5%
Final simplification70.3%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(let* ((t_0 (/ (/ (/ (* D_m (* D_m (* M_m (* 0.125 (* h M_m))))) d) d) l))
(t_1 (/ d (sqrt (* h l)))))
(if (<= l 4.45e-305) (* t_1 (+ t_0 -1.0)) (* (- 1.0 t_0) t_1))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = (((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l;
double t_1 = d / sqrt((h * l));
double tmp;
if (l <= 4.45e-305) {
tmp = t_1 * (t_0 + -1.0);
} else {
tmp = (1.0 - t_0) * t_1;
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((d_m * (d_m * (m_m * (0.125d0 * (h * m_m))))) / d) / d) / l
t_1 = d / sqrt((h * l))
if (l <= 4.45d-305) then
tmp = t_1 * (t_0 + (-1.0d0))
else
tmp = (1.0d0 - t_0) * t_1
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double t_0 = (((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l;
double t_1 = d / Math.sqrt((h * l));
double tmp;
if (l <= 4.45e-305) {
tmp = t_1 * (t_0 + -1.0);
} else {
tmp = (1.0 - t_0) * t_1;
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): t_0 = (((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l t_1 = d / math.sqrt((h * l)) tmp = 0 if l <= 4.45e-305: tmp = t_1 * (t_0 + -1.0) else: tmp = (1.0 - t_0) * t_1 return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) t_0 = Float64(Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * Float64(0.125 * Float64(h * M_m))))) / d) / d) / l) t_1 = Float64(d / sqrt(Float64(h * l))) tmp = 0.0 if (l <= 4.45e-305) tmp = Float64(t_1 * Float64(t_0 + -1.0)); else tmp = Float64(Float64(1.0 - t_0) * t_1); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
t_0 = (((D_m * (D_m * (M_m * (0.125 * (h * M_m))))) / d) / d) / l;
t_1 = d / sqrt((h * l));
tmp = 0.0;
if (l <= 4.45e-305)
tmp = t_1 * (t_0 + -1.0);
else
tmp = (1.0 - t_0) * t_1;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * N[(0.125 * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 4.45e-305], N[(t$95$1 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot \left(0.125 \cdot \left(h \cdot M\_m\right)\right)\right)\right)}{d}}{d}}{\ell}\\
t_1 := \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;\ell \leq 4.45 \cdot 10^{-305}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if l < 4.4499999999999998e-305Initial program 68.5%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified60.4%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6442.5%
Applied egg-rr42.5%
Taylor expanded in d around -inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6466.4%
Simplified66.4%
if 4.4499999999999998e-305 < l Initial program 61.8%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified58.6%
pow-prod-downN/A
metadata-evalN/A
unpow1/2N/A
frac-timesN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6448.5%
Applied egg-rr48.5%
sqrt-prodN/A
rem-square-sqrt68.9%
Applied egg-rr68.9%
Final simplification67.6%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
:precision binary64
(if (<= l -3.4e-134)
(* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
(if (<= l -2.6e-308)
(* d (pow (/ (/ 1.0 (* h (* l l))) h) 0.25))
(* d (sqrt (/ (/ 1.0 h) l))))))M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (l <= -3.4e-134) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else if (l <= -2.6e-308) {
tmp = d * pow(((1.0 / (h * (l * l))) / h), 0.25);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (l <= (-3.4d-134)) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else if (l <= (-2.6d-308)) then
tmp = d * (((1.0d0 / (h * (l * l))) / h) ** 0.25d0)
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (l <= -3.4e-134) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else if (l <= -2.6e-308) {
tmp = d * Math.pow(((1.0 / (h * (l * l))) / h), 0.25);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if l <= -3.4e-134: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) elif l <= -2.6e-308: tmp = d * math.pow(((1.0 / (h * (l * l))) / h), 0.25) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (l <= -3.4e-134) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= -2.6e-308) tmp = Float64(d * (Float64(Float64(1.0 / Float64(h * Float64(l * l))) / h) ^ 0.25)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (l <= -3.4e-134)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
elseif (l <= -2.6e-308)
tmp = d * (((1.0 / (h * (l * l))) / h) ^ 0.25);
else
tmp = d * sqrt(((1.0 / h) / l));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -3.4e-134], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.6e-308], N[(d * N[Power[N[(N[(1.0 / N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{-134}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -2.6 \cdot 10^{-308}:\\
\;\;\;\;d \cdot {\left(\frac{\frac{1}{h \cdot \left(\ell \cdot \ell\right)}}{h}\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < -3.39999999999999977e-134Initial program 67.5%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified58.1%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6454.3%
Simplified54.3%
if -3.39999999999999977e-134 < l < -2.6e-308Initial program 69.5%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified67.0%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6418.4%
Simplified18.4%
pow1/2N/A
metadata-evalN/A
sqr-powN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval39.8%
Applied egg-rr39.8%
Taylor expanded in h around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/r*N/A
associate-/l/N/A
/-lowering-/.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
if -2.6e-308 < l Initial program 62.3%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified58.5%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6442.9%
Simplified42.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6443.3%
Applied egg-rr43.3%
Final simplification48.3%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (if (<= d 5e-156) (* (- 0.0 d) (sqrt (/ 1.0 (* h l)))) (* d (sqrt (/ (/ 1.0 l) h)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= 5e-156) {
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= 5d-156) then
tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
else
tmp = d * sqrt(((1.0d0 / l) / h))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= 5e-156) {
tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= 5e-156: tmp = (0.0 - d) * math.sqrt((1.0 / (h * l))) else: tmp = d * math.sqrt(((1.0 / l) / h)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= 5e-156) tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= 5e-156)
tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
else
tmp = d * sqrt(((1.0 / l) / h));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, 5e-156], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5 \cdot 10^{-156}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\end{array}
\end{array}
if d < 5.00000000000000007e-156Initial program 63.0%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.4%
Taylor expanded in l around -inf
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6442.6%
Simplified42.6%
if 5.00000000000000007e-156 < d Initial program 68.9%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified63.0%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6451.5%
Simplified51.5%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6452.0%
Applied egg-rr52.0%
Final simplification46.2%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (if (<= d -1.14e-60) (pow (/ (* h l) (* d d)) -0.5) (* d (sqrt (/ (/ 1.0 h) l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -1.14e-60) {
tmp = pow(((h * l) / (d * d)), -0.5);
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-1.14d-60)) then
tmp = ((h * l) / (d * d)) ** (-0.5d0)
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -1.14e-60) {
tmp = Math.pow(((h * l) / (d * d)), -0.5);
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -1.14e-60: tmp = math.pow(((h * l) / (d * d)), -0.5) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -1.14e-60) tmp = Float64(Float64(h * l) / Float64(d * d)) ^ -0.5; else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -1.14e-60)
tmp = ((h * l) / (d * d)) ^ -0.5;
else
tmp = d * sqrt(((1.0 / h) / l));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -1.14e-60], N[Power[N[(N[(h * l), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.14 \cdot 10^{-60}:\\
\;\;\;\;{\left(\frac{h \cdot \ell}{d \cdot d}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if d < -1.14000000000000001e-60Initial program 76.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.7%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f646.5%
Simplified6.5%
rem-square-sqrtN/A
sqrt-prodN/A
sqrt-unprodN/A
div-invN/A
*-commutativeN/A
frac-timesN/A
clear-numN/A
div-invN/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
associate-/l/N/A
frac-timesN/A
*-commutativeN/A
clear-numN/A
remove-double-divN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Applied egg-rr38.2%
if -1.14000000000000001e-60 < d Initial program 60.2%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified56.3%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6433.8%
Simplified33.8%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6434.1%
Applied egg-rr34.1%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (if (<= l -1.75e-249) (sqrt (/ (/ d l) (/ h d))) (* d (sqrt (/ (/ 1.0 h) l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (l <= -1.75e-249) {
tmp = sqrt(((d / l) / (h / d)));
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (l <= (-1.75d-249)) then
tmp = sqrt(((d / l) / (h / d)))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (l <= -1.75e-249) {
tmp = Math.sqrt(((d / l) / (h / d)));
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if l <= -1.75e-249: tmp = math.sqrt(((d / l) / (h / d))) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (l <= -1.75e-249) tmp = sqrt(Float64(Float64(d / l) / Float64(h / d))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (l <= -1.75e-249)
tmp = sqrt(((d / l) / (h / d)));
else
tmp = d * sqrt(((1.0 / h) / l));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1.75e-249], N[Sqrt[N[(N[(d / l), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if l < -1.75000000000000006e-249Initial program 69.5%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified61.6%
Applied egg-rr42.4%
Taylor expanded in M around 0
Simplified33.6%
if -1.75000000000000006e-249 < l Initial program 61.3%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified57.7%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6442.2%
Simplified42.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6442.6%
Applied egg-rr42.6%
Final simplification38.3%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (if (<= d -6.5e-57) (sqrt (/ (/ (* d d) l) h)) (* d (sqrt (/ (/ 1.0 h) l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -6.5e-57) {
tmp = sqrt((((d * d) / l) / h));
} else {
tmp = d * sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-6.5d-57)) then
tmp = sqrt((((d * d) / l) / h))
else
tmp = d * sqrt(((1.0d0 / h) / l))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -6.5e-57) {
tmp = Math.sqrt((((d * d) / l) / h));
} else {
tmp = d * Math.sqrt(((1.0 / h) / l));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -6.5e-57: tmp = math.sqrt((((d * d) / l) / h)) else: tmp = d * math.sqrt(((1.0 / h) / l)) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -6.5e-57) tmp = sqrt(Float64(Float64(Float64(d * d) / l) / h)); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l))); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -6.5e-57)
tmp = sqrt((((d * d) / l) / h));
else
tmp = d * sqrt(((1.0 / h) / l));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -6.5e-57], N[Sqrt[N[(N[(N[(d * d), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.5 \cdot 10^{-57}:\\
\;\;\;\;\sqrt{\frac{\frac{d \cdot d}{\ell}}{h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\end{array}
\end{array}
if d < -6.49999999999999992e-57Initial program 76.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.7%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f646.5%
Simplified6.5%
rem-square-sqrtN/A
sqrt-prodN/A
sqrt-unprodN/A
div-invN/A
*-commutativeN/A
frac-timesN/A
clear-numN/A
div-invN/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
clear-numN/A
frac-timesN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6437.9%
Applied egg-rr37.9%
if -6.49999999999999992e-57 < d Initial program 60.2%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified56.3%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6433.8%
Simplified33.8%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6434.1%
Applied egg-rr34.1%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (if (<= d -3.4e-60) (sqrt (/ (/ (* d d) l) h)) (/ d (pow (* h l) 0.5))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -3.4e-60) {
tmp = sqrt((((d * d) / l) / h));
} else {
tmp = d / pow((h * l), 0.5);
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8) :: tmp
if (d <= (-3.4d-60)) then
tmp = sqrt((((d * d) / l) / h))
else
tmp = d / ((h * l) ** 0.5d0)
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
double tmp;
if (d <= -3.4e-60) {
tmp = Math.sqrt((((d * d) / l) / h));
} else {
tmp = d / Math.pow((h * l), 0.5);
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): tmp = 0 if d <= -3.4e-60: tmp = math.sqrt((((d * d) / l) / h)) else: tmp = d / math.pow((h * l), 0.5) return tmp
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) tmp = 0.0 if (d <= -3.4e-60) tmp = sqrt(Float64(Float64(Float64(d * d) / l) / h)); else tmp = Float64(d / (Float64(h * l) ^ 0.5)); end return tmp end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
tmp = 0.0;
if (d <= -3.4e-60)
tmp = sqrt((((d * d) / l) / h));
else
tmp = d / ((h * l) ^ 0.5);
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -3.4e-60], N[Sqrt[N[(N[(N[(d * d), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision], N[(d / N[Power[N[(h * l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.4 \cdot 10^{-60}:\\
\;\;\;\;\sqrt{\frac{\frac{d \cdot d}{\ell}}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\
\end{array}
\end{array}
if d < -3.40000000000000007e-60Initial program 76.6%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified66.7%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f646.5%
Simplified6.5%
rem-square-sqrtN/A
sqrt-prodN/A
sqrt-unprodN/A
div-invN/A
*-commutativeN/A
frac-timesN/A
clear-numN/A
div-invN/A
sqrt-lowering-sqrt.f64N/A
div-invN/A
clear-numN/A
frac-timesN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6437.9%
Applied egg-rr37.9%
if -3.40000000000000007e-60 < d Initial program 60.2%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified56.3%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6433.8%
Simplified33.8%
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-eval34.1%
Applied egg-rr34.1%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (/ d (pow (* h l) 0.5)))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
return d / pow((h * l), 0.5);
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
code = d / ((h * l) ** 0.5d0)
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
return d / Math.pow((h * l), 0.5);
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): return d / math.pow((h * l), 0.5)
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) return Float64(d / (Float64(h * l) ^ 0.5)) end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp = code(d, h, l, M_m, D_m)
tmp = d / ((h * l) ^ 0.5);
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Power[N[(h * l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\frac{d}{{\left(h \cdot \ell\right)}^{0.5}}
\end{array}
Initial program 65.2%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified59.5%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6425.4%
Simplified25.4%
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
pow1/2N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-eval25.6%
Applied egg-rr25.6%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. (FPCore (d h l M_m D_m) :precision binary64 (* d (pow (* h l) -0.5)))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
return d * pow((h * l), -0.5);
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
code = d * ((h * l) ** (-0.5d0))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
return d * Math.pow((h * l), -0.5);
}
M_m = math.fabs(M) D_m = math.fabs(D) [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m]) def code(d, h, l, M_m, D_m): return d * math.pow((h * l), -0.5)
M_m = abs(M) D_m = abs(D) d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m]) function code(d, h, l, M_m, D_m) return Float64(d * (Float64(h * l) ^ -0.5)) end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp = code(d, h, l, M_m, D_m)
tmp = d * ((h * l) ^ -0.5);
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function. code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Initial program 65.2%
Taylor expanded in M around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Simplified59.5%
Taylor expanded in d around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6425.4%
Simplified25.4%
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval25.6%
Applied egg-rr25.6%
Final simplification25.6%
herbie shell --seed 2024192
(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)))))