
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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)) (t_1 (sqrt (- d))))
(if (<= l -9.5e-62)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ 2.0 M_m) (/ d D_m)) -2.0) 1.0)
(sqrt (/ d l)))
t_1)
(sqrt (- h)))
(if (<= l -5e-311)
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (/ t_1 (sqrt (- l))))
(- 1.0 (* (/ (* t_0 0.5) l) (* (* (/ M_m d) (* 0.25 D_m)) h))))
(/
(*
(*
(fma (* (/ 0.5 l) t_0) (* (* (/ M_m (- d)) h) (* 0.25 D_m)) 1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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;
double t_1 = sqrt(-d);
double tmp;
if (l <= -9.5e-62) {
tmp = ((fma((-0.5 * (h / l)), pow(((2.0 / M_m) * (d / D_m)), -2.0), 1.0) * sqrt((d / l))) * t_1) / sqrt(-h);
} else if (l <= -5e-311) {
tmp = (pow((d / h), pow(2.0, -1.0)) * (t_1 / sqrt(-l))) * (1.0 - (((t_0 * 0.5) / l) * (((M_m / d) * (0.25 * D_m)) * h)));
} else {
tmp = ((fma(((0.5 / l) * t_0), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(D_m / d) * M_m) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -9.5e-62) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(2.0 / M_m) * Float64(d / D_m)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * t_1) / sqrt(Float64(-h))); elseif (l <= -5e-311) tmp = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * Float64(t_1 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(Float64(Float64(t_0 * 0.5) / l) * Float64(Float64(Float64(M_m / d) * Float64(0.25 * D_m)) * h)))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * t_0), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -9.5e-62], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 / M$95$m), $MachinePrecision] * N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$0 * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\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}{d} \cdot M\_m\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -9.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M\_m} \cdot \frac{d}{D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_1}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot \frac{t\_1}{\sqrt{-\ell}}\right) \cdot \left(1 - \frac{t\_0 \cdot 0.5}{\ell} \cdot \left(\left(\frac{M\_m}{d} \cdot \left(0.25 \cdot D\_m\right)\right) \cdot h\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot t\_0, \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -9.49999999999999951e-62Initial program 57.9%
Applied rewrites77.6%
if -9.49999999999999951e-62 < l < -5.00000000000023e-311Initial program 60.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites66.0%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6466.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.0
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval66.0
Applied rewrites66.0%
lift-/.f64N/A
metadata-eval66.0
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
lower-/.f64N/A
lift-*.f64N/A
*-lft-identityN/A
pow1/2N/A
lower-sqrt.f6486.9
Applied rewrites86.9%
if -5.00000000000023e-311 < l Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification83.1%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (<= h -2.7e+76)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ 2.0 M_m) (/ d D_m)) -2.0) 1.0)
(sqrt (/ d h)))
(sqrt (- d)))
(sqrt (- l)))
(if (<= h -4e-310)
(*
(* (- d) (sqrt (pow (* l h) -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
(/
(*
(*
(fma
(* (/ 0.5 l) (* (/ D_m d) M_m))
(* (* (/ M_m (- d)) h) (* 0.25 D_m))
1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h)))))D_m = fabs(D);
M_m = fabs(M);
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 (h <= -2.7e+76) {
tmp = ((fma((-0.5 * (h / l)), pow(((2.0 / M_m) * (d / D_m)), -2.0), 1.0) * sqrt((d / h))) * sqrt(-d)) / sqrt(-l);
} else if (h <= -4e-310) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
} else {
tmp = ((fma(((0.5 / l) * ((D_m / d) * M_m)), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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 (h <= -2.7e+76) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(2.0 / M_m) * Float64(d / D_m)) ^ -2.0), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(-d))) / sqrt(Float64(-l))); elseif (h <= -4e-310) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * Float64(Float64(D_m / d) * M_m)), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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[h, -2.7e+76], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 / M$95$m), $MachinePrecision] * N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -4e-310], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.7 \cdot 10^{+76}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M\_m} \cdot \frac{d}{D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot \left(\frac{D\_m}{d} \cdot M\_m\right), \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -2.6999999999999999e76Initial program 54.4%
Applied rewrites66.0%
if -2.6999999999999999e76 < h < -3.999999999999988e-310Initial program 61.6%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6460.3
Applied rewrites60.3%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
if -3.999999999999988e-310 < h Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification81.3%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (* M_m (/ D_m d))))
(if (<= l -5e+163)
(*
(*
(fma (* (/ (* -0.5 t_0) l) h) (* 0.25 t_0) 1.0)
(pow (sqrt (/ h d)) -1.0))
(sqrt (/ d l)))
(if (<= l -5e-311)
(*
(* (- d) (sqrt (pow (* l h) -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
(/
(*
(*
(fma
(* (/ 0.5 l) (* (/ D_m d) M_m))
(* (* (/ M_m (- d)) h) (* 0.25 D_m))
1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 = M_m * (D_m / d);
double tmp;
if (l <= -5e+163) {
tmp = (fma((((-0.5 * t_0) / l) * h), (0.25 * t_0), 1.0) * pow(sqrt((h / d)), -1.0)) * sqrt((d / l));
} else if (l <= -5e-311) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
} else {
tmp = ((fma(((0.5 / l) * ((D_m / d) * M_m)), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(M_m * Float64(D_m / d)) tmp = 0.0 if (l <= -5e+163) tmp = Float64(Float64(fma(Float64(Float64(Float64(-0.5 * t_0) / l) * h), Float64(0.25 * t_0), 1.0) * (sqrt(Float64(h / d)) ^ -1.0)) * sqrt(Float64(d / l))); elseif (l <= -5e-311) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * Float64(Float64(D_m / d) * M_m)), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(M$95$m * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e+163], N[(N[(N[(N[(N[(N[(-0.5 * t$95$0), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{+163}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.5 \cdot t\_0}{\ell} \cdot h, 0.25 \cdot t\_0, 1\right) \cdot {\left(\sqrt{\frac{h}{d}}\right)}^{-1}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot \left(\frac{D\_m}{d} \cdot M\_m\right), \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -5e163Initial program 53.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites53.5%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6453.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval53.5
Applied rewrites53.5%
Applied rewrites58.9%
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6460.8
Applied rewrites60.8%
if -5e163 < l < -5.00000000000023e-311Initial program 60.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6459.8
Applied rewrites59.8%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
if -5.00000000000023e-311 < l Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification80.8%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (* M_m (/ D_m d))))
(if (<= d -1.56e+156)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -1e-231)
(*
(*
(fma (* (/ (* -0.5 t_0) l) h) (* 0.25 t_0) 1.0)
(pow (sqrt (/ h d)) -1.0))
(sqrt (/ d l)))
(if (<= d -2e-310)
(*
(* (* 0.125 (* D_m D_m)) (/ (* M_m M_m) d))
(sqrt (/ h (pow l 3.0))))
(/
(*
(*
(fma
(* (/ 0.5 l) (* (/ D_m d) M_m))
(* (* (/ M_m (- d)) h) (* 0.25 D_m))
1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h)))))))D_m = fabs(D);
M_m = fabs(M);
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 = M_m * (D_m / d);
double tmp;
if (d <= -1.56e+156) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -1e-231) {
tmp = (fma((((-0.5 * t_0) / l) * h), (0.25 * t_0), 1.0) * pow(sqrt((h / d)), -1.0)) * sqrt((d / l));
} else if (d <= -2e-310) {
tmp = ((0.125 * (D_m * D_m)) * ((M_m * M_m) / d)) * sqrt((h / pow(l, 3.0)));
} else {
tmp = ((fma(((0.5 / l) * ((D_m / d) * M_m)), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(M_m * Float64(D_m / d)) tmp = 0.0 if (d <= -1.56e+156) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -1e-231) tmp = Float64(Float64(fma(Float64(Float64(Float64(-0.5 * t_0) / l) * h), Float64(0.25 * t_0), 1.0) * (sqrt(Float64(h / d)) ^ -1.0)) * sqrt(Float64(d / l))); elseif (d <= -2e-310) tmp = Float64(Float64(Float64(0.125 * Float64(D_m * D_m)) * Float64(Float64(M_m * M_m) / d)) * sqrt(Float64(h / (l ^ 3.0)))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * Float64(Float64(D_m / d) * M_m)), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(M$95$m * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.56e+156], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-231], N[(N[(N[(N[(N[(N[(-0.5 * t$95$0), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d}\\
\mathbf{if}\;d \leq -1.56 \cdot 10^{+156}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-231}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.5 \cdot t\_0}{\ell} \cdot h, 0.25 \cdot t\_0, 1\right) \cdot {\left(\sqrt{\frac{h}{d}}\right)}^{-1}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot \left(\frac{D\_m}{d} \cdot M\_m\right), \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.55999999999999992e156Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -1.55999999999999992e156 < d < -9.9999999999999999e-232Initial program 75.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites80.7%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6480.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval80.7
Applied rewrites80.7%
Applied rewrites79.5%
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
if -9.9999999999999999e-232 < d < -1.999999999999994e-310Initial program 1.4%
Taylor expanded in h around -inf
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites39.9%
if -1.999999999999994e-310 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification81.5%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (* M_m (/ D_m d))))
(if (<= d -1.56e+156)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -2e-310)
(*
(*
(fma (* (/ (* -0.5 t_0) l) h) (* 0.25 t_0) 1.0)
(pow (sqrt (/ h d)) -1.0))
(sqrt (/ d l)))
(/
(*
(*
(fma
(* (/ 0.5 l) (* (/ D_m d) M_m))
(* (* (/ M_m (- d)) h) (* 0.25 D_m))
1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 = M_m * (D_m / d);
double tmp;
if (d <= -1.56e+156) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -2e-310) {
tmp = (fma((((-0.5 * t_0) / l) * h), (0.25 * t_0), 1.0) * pow(sqrt((h / d)), -1.0)) * sqrt((d / l));
} else {
tmp = ((fma(((0.5 / l) * ((D_m / d) * M_m)), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(M_m * Float64(D_m / d)) tmp = 0.0 if (d <= -1.56e+156) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -2e-310) tmp = Float64(Float64(fma(Float64(Float64(Float64(-0.5 * t_0) / l) * h), Float64(0.25 * t_0), 1.0) * (sqrt(Float64(h / d)) ^ -1.0)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * Float64(Float64(D_m / d) * M_m)), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(M$95$m * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.56e+156], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[(N[(N[(N[(-0.5 * t$95$0), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d}\\
\mathbf{if}\;d \leq -1.56 \cdot 10^{+156}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.5 \cdot t\_0}{\ell} \cdot h, 0.25 \cdot t\_0, 1\right) \cdot {\left(\sqrt{\frac{h}{d}}\right)}^{-1}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot \left(\frac{D\_m}{d} \cdot M\_m\right), \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.55999999999999992e156Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -1.55999999999999992e156 < d < -1.999999999999994e-310Initial program 64.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites68.7%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6468.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval68.7
Applied rewrites68.7%
Applied rewrites67.7%
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
if -1.999999999999994e-310 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification79.6%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (* M_m (/ D_m d))))
(if (<= d -1.56e+156)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -2e-310)
(*
(*
(fma (* (/ (* -0.5 t_0) l) h) (* 0.25 t_0) 1.0)
(pow (sqrt (/ h d)) -1.0))
(sqrt (/ d l)))
(/
(*
(fma
(* (* -0.25 D_m) (* (/ M_m d) h))
(/ (* 0.5 (* (/ D_m d) M_m)) l)
1.0)
(/ d (sqrt l)))
(sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 = M_m * (D_m / d);
double tmp;
if (d <= -1.56e+156) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -2e-310) {
tmp = (fma((((-0.5 * t_0) / l) * h), (0.25 * t_0), 1.0) * pow(sqrt((h / d)), -1.0)) * sqrt((d / l));
} else {
tmp = (fma(((-0.25 * D_m) * ((M_m / d) * h)), ((0.5 * ((D_m / d) * M_m)) / l), 1.0) * (d / sqrt(l))) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(M_m * Float64(D_m / d)) tmp = 0.0 if (d <= -1.56e+156) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -2e-310) tmp = Float64(Float64(fma(Float64(Float64(Float64(-0.5 * t_0) / l) * h), Float64(0.25 * t_0), 1.0) * (sqrt(Float64(h / d)) ^ -1.0)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(fma(Float64(Float64(-0.25 * D_m) * Float64(Float64(M_m / d) * h)), Float64(Float64(0.5 * Float64(Float64(D_m / d) * M_m)) / l), 1.0) * Float64(d / sqrt(l))) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(M$95$m * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.56e+156], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[(N[(N[(N[(-0.5 * t$95$0), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d}\\
\mathbf{if}\;d \leq -1.56 \cdot 10^{+156}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.5 \cdot t\_0}{\ell} \cdot h, 0.25 \cdot t\_0, 1\right) \cdot {\left(\sqrt{\frac{h}{d}}\right)}^{-1}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), \frac{0.5 \cdot \left(\frac{D\_m}{d} \cdot M\_m\right)}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.55999999999999992e156Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -1.55999999999999992e156 < d < -1.999999999999994e-310Initial program 64.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites68.7%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6468.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval68.7
Applied rewrites68.7%
Applied rewrites67.7%
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
if -1.999999999999994e-310 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
Applied rewrites83.4%
Final simplification78.5%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (- d))))
(if (<= d -6.8e+231)
(/ t_0 (* (sqrt (/ h d)) (sqrt (- l))))
(if (<= d -2e-310)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ 2.0 M_m) (/ d D_m)) -2.0) 1.0)
(sqrt (/ d l)))
t_0)
(sqrt (- h)))
(/
(*
(*
(fma
(* (/ 0.5 l) (* (/ D_m d) M_m))
(* (* (/ M_m (- d)) h) (* 0.25 D_m))
1.0)
(/ (sqrt d) (sqrt l)))
(sqrt d))
(sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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(-d);
double tmp;
if (d <= -6.8e+231) {
tmp = t_0 / (sqrt((h / d)) * sqrt(-l));
} else if (d <= -2e-310) {
tmp = ((fma((-0.5 * (h / l)), pow(((2.0 / M_m) * (d / D_m)), -2.0), 1.0) * sqrt((d / l))) * t_0) / sqrt(-h);
} else {
tmp = ((fma(((0.5 / l) * ((D_m / d) * M_m)), (((M_m / -d) * h) * (0.25 * D_m)), 1.0) * (sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(-d)) tmp = 0.0 if (d <= -6.8e+231) tmp = Float64(t_0 / Float64(sqrt(Float64(h / d)) * sqrt(Float64(-l)))); elseif (d <= -2e-310) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(2.0 / M_m) * Float64(d / D_m)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * t_0) / sqrt(Float64(-h))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 / l) * Float64(Float64(D_m / d) * M_m)), Float64(Float64(Float64(M_m / Float64(-d)) * h) * Float64(0.25 * D_m)), 1.0) * Float64(sqrt(d) / sqrt(l))) * sqrt(d)) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(-d)], $MachinePrecision]}, If[LessEqual[d, -6.8e+231], N[(t$95$0 / N[(N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 / M$95$m), $MachinePrecision] * N[(d / D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / (-d)), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;d \leq -6.8 \cdot 10^{+231}:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}} \cdot \sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M\_m} \cdot \frac{d}{D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0}{\sqrt{-h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5}{\ell} \cdot \left(\frac{D\_m}{d} \cdot M\_m\right), \left(\frac{M\_m}{-d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -6.8e231Initial program 46.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f640.7
Applied rewrites0.7%
Applied rewrites71.8%
Applied rewrites84.5%
if -6.8e231 < d < -1.999999999999994e-310Initial program 61.3%
Applied rewrites79.6%
if -1.999999999999994e-310 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Final simplification83.1%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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)))
(if (<= h -2.05e+120)
(/ (sqrt (- d)) (* (sqrt (/ h d)) (sqrt (- l))))
(if (<= h -4e-310)
(* (- d) (sqrt (pow (* l h) -1.0)))
(*
(fma (* 0.25 t_0) (* h (/ (* t_0 -0.5) l)) 1.0)
(/ d (sqrt (* h l))))))))D_m = fabs(D);
M_m = fabs(M);
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;
double tmp;
if (h <= -2.05e+120) {
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l));
} else if (h <= -4e-310) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = fma((0.25 * t_0), (h * ((t_0 * -0.5) / l)), 1.0) * (d / sqrt((h * l)));
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(D_m / d) * M_m) tmp = 0.0 if (h <= -2.05e+120) tmp = Float64(sqrt(Float64(-d)) / Float64(sqrt(Float64(h / d)) * sqrt(Float64(-l)))); elseif (h <= -4e-310) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(fma(Float64(0.25 * t_0), Float64(h * Float64(Float64(t_0 * -0.5) / l)), 1.0) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]}, If[LessEqual[h, -2.05e+120], N[(N[Sqrt[(-d)], $MachinePrecision] / N[(N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -4e-310], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.25 * t$95$0), $MachinePrecision] * N[(h * N[(N[(t$95$0 * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\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}{d} \cdot M\_m\\
\mathbf{if}\;h \leq -2.05 \cdot 10^{+120}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\frac{h}{d}} \cdot \sqrt{-\ell}}\\
\mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25 \cdot t\_0, h \cdot \frac{t\_0 \cdot -0.5}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if h < -2.05e120Initial program 50.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f645.3
Applied rewrites5.3%
Applied rewrites40.5%
Applied rewrites56.1%
if -2.05e120 < h < -3.999999999999988e-310Initial program 62.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6457.6
Applied rewrites57.6%
if -3.999999999999988e-310 < h Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites67.0%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6467.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.0
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval67.0
Applied rewrites67.0%
Applied rewrites68.8%
Applied rewrites78.8%
Final simplification68.3%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (<= h -2.05e+120)
(/ (sqrt (- d)) (* (sqrt (/ h d)) (sqrt (- l))))
(if (<= h -4e-310)
(* (- d) (sqrt (pow (* l h) -1.0)))
(/ d (* (sqrt l) (sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 (h <= -2.05e+120) {
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l));
} else if (h <= -4e-310) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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 (h <= (-2.05d+120)) then
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l))
else if (h <= (-4d-310)) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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 (h <= -2.05e+120) {
tmp = Math.sqrt(-d) / (Math.sqrt((h / d)) * Math.sqrt(-l));
} else if (h <= -4e-310) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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 h <= -2.05e+120: tmp = math.sqrt(-d) / (math.sqrt((h / d)) * math.sqrt(-l)) elif h <= -4e-310: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
D_m = abs(D) M_m = abs(M) 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 (h <= -2.05e+120) tmp = Float64(sqrt(Float64(-d)) / Float64(sqrt(Float64(h / d)) * sqrt(Float64(-l)))); elseif (h <= -4e-310) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
D_m = abs(D);
M_m = abs(M);
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 (h <= -2.05e+120)
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l));
elseif (h <= -4e-310)
tmp = -d * sqrt(((l * h) ^ -1.0));
else
tmp = d / (sqrt(l) * sqrt(h));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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[h, -2.05e+120], N[(N[Sqrt[(-d)], $MachinePrecision] / N[(N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -4e-310], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.05 \cdot 10^{+120}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\frac{h}{d}} \cdot \sqrt{-\ell}}\\
\mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -2.05e120Initial program 50.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f645.3
Applied rewrites5.3%
Applied rewrites40.5%
Applied rewrites56.1%
if -2.05e120 < h < -3.999999999999988e-310Initial program 62.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6457.6
Applied rewrites57.6%
if -3.999999999999988e-310 < h Initial program 64.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
Applied rewrites40.1%
Applied rewrites46.0%
Final simplification51.4%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (<= h -2.05e+105)
(* (/ (sqrt (/ d h)) (sqrt (- l))) (sqrt (- d)))
(if (<= h -4e-310)
(* (- d) (sqrt (pow (* l h) -1.0)))
(/ d (* (sqrt l) (sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 (h <= -2.05e+105) {
tmp = (sqrt((d / h)) / sqrt(-l)) * sqrt(-d);
} else if (h <= -4e-310) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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 (h <= (-2.05d+105)) then
tmp = (sqrt((d / h)) / sqrt(-l)) * sqrt(-d)
else if (h <= (-4d-310)) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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 (h <= -2.05e+105) {
tmp = (Math.sqrt((d / h)) / Math.sqrt(-l)) * Math.sqrt(-d);
} else if (h <= -4e-310) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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 h <= -2.05e+105: tmp = (math.sqrt((d / h)) / math.sqrt(-l)) * math.sqrt(-d) elif h <= -4e-310: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
D_m = abs(D) M_m = abs(M) 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 (h <= -2.05e+105) tmp = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(-l))) * sqrt(Float64(-d))); elseif (h <= -4e-310) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
D_m = abs(D);
M_m = abs(M);
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 (h <= -2.05e+105)
tmp = (sqrt((d / h)) / sqrt(-l)) * sqrt(-d);
elseif (h <= -4e-310)
tmp = -d * sqrt(((l * h) ^ -1.0));
else
tmp = d / (sqrt(l) * sqrt(h));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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[h, -2.05e+105], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -4e-310], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.05 \cdot 10^{+105}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{-\ell}} \cdot \sqrt{-d}\\
\mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -2.0500000000000001e105Initial program 53.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f644.8
Applied rewrites4.8%
Applied rewrites41.0%
Applied rewrites41.0%
Applied rewrites53.8%
if -2.0500000000000001e105 < h < -3.999999999999988e-310Initial program 61.5%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6458.9
Applied rewrites58.9%
if -3.999999999999988e-310 < h Initial program 64.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
Applied rewrites40.1%
Applied rewrites46.0%
Final simplification51.4%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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.7e+177)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(if (<= l 5.5e-305)
(* (- d) (sqrt (pow (* l h) -1.0)))
(/ d (* (sqrt l) (sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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.7e+177) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else if (l <= 5.5e-305) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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.7d+177)) then
tmp = sqrt((d / l)) / sqrt((h / d))
else if (l <= 5.5d-305) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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.7e+177) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else if (l <= 5.5e-305) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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.7e+177: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) elif l <= 5.5e-305: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
D_m = abs(D) M_m = abs(M) 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.7e+177) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); elseif (l <= 5.5e-305) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
D_m = abs(D);
M_m = abs(M);
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.7e+177)
tmp = sqrt((d / l)) / sqrt((h / d));
elseif (l <= 5.5e-305)
tmp = -d * sqrt(((l * h) ^ -1.0));
else
tmp = d / (sqrt(l) * sqrt(h));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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.7e+177], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.5e-305], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\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.7 \cdot 10^{+177}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;\ell \leq 5.5 \cdot 10^{-305}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.70000000000000014e177Initial program 52.9%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f646.7
Applied rewrites6.7%
Applied rewrites46.3%
if -3.70000000000000014e177 < l < 5.5e-305Initial program 61.4%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
if 5.5e-305 < l Initial program 64.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.7
Applied rewrites40.7%
Applied rewrites40.7%
Applied rewrites46.7%
Final simplification50.2%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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
(fma
(* (* -0.25 D_m) (* (/ M_m d) h))
(/ (* 0.5 (* (/ D_m d) M_m)) l)
1.0)))
(if (<= d -1.56e+156)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -2e-310)
(* (* t_0 (sqrt (/ d l))) (sqrt (/ d h)))
(/ (* t_0 (/ d (sqrt l))) (sqrt h))))))D_m = fabs(D);
M_m = fabs(M);
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 = fma(((-0.25 * D_m) * ((M_m / d) * h)), ((0.5 * ((D_m / d) * M_m)) / l), 1.0);
double tmp;
if (d <= -1.56e+156) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -2e-310) {
tmp = (t_0 * sqrt((d / l))) * sqrt((d / h));
} else {
tmp = (t_0 * (d / sqrt(l))) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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 = fma(Float64(Float64(-0.25 * D_m) * Float64(Float64(M_m / d) * h)), Float64(Float64(0.5 * Float64(Float64(D_m / d) * M_m)) / l), 1.0) tmp = 0.0 if (d <= -1.56e+156) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -2e-310) tmp = Float64(Float64(t_0 * sqrt(Float64(d / l))) * sqrt(Float64(d / h))); else tmp = Float64(Float64(t_0 * Float64(d / sqrt(l))) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(-0.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -1.56e+156], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\left(-0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), \frac{0.5 \cdot \left(\frac{D\_m}{d} \cdot M\_m\right)}{\ell}, 1\right)\\
\mathbf{if}\;d \leq -1.56 \cdot 10^{+156}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -1.55999999999999992e156Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -1.55999999999999992e156 < d < -1.999999999999994e-310Initial program 64.1%
Applied rewrites0.0%
Applied rewrites0.0%
Applied rewrites65.3%
if -1.999999999999994e-310 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
Applied rewrites83.4%
Final simplification77.1%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 -8e+155)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -1e-309)
(*
(*
(fma (/ -0.125 (* l d)) (* (* (* (* M_m M_m) h) D_m) (/ D_m d)) 1.0)
(sqrt (/ d h)))
(sqrt (/ d l)))
(/
(*
(fma
(* (* -0.25 D_m) (* (/ M_m d) h))
(/ (* 0.5 (* (/ D_m d) M_m)) l)
1.0)
(/ d (sqrt l)))
(sqrt h)))))D_m = fabs(D);
M_m = fabs(M);
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 <= -8e+155) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -1e-309) {
tmp = (fma((-0.125 / (l * d)), ((((M_m * M_m) * h) * D_m) * (D_m / d)), 1.0) * sqrt((d / h))) * sqrt((d / l));
} else {
tmp = (fma(((-0.25 * D_m) * ((M_m / d) * h)), ((0.5 * ((D_m / d) * M_m)) / l), 1.0) * (d / sqrt(l))) / sqrt(h);
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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 <= -8e+155) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -1e-309) tmp = Float64(Float64(fma(Float64(-0.125 / Float64(l * d)), Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * Float64(D_m / d)), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l))); else tmp = Float64(Float64(fma(Float64(Float64(-0.25 * D_m) * Float64(Float64(M_m / d) * h)), Float64(Float64(0.5 * Float64(Float64(D_m / d) * M_m)) / l), 1.0) * Float64(d / sqrt(l))) / sqrt(h)); end return tmp end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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, -8e+155], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(N[(N[(-0.125 / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\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 \cdot 10^{+155}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.125}{\ell \cdot d}, \left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot \frac{D\_m}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), \frac{0.5 \cdot \left(\frac{D\_m}{d} \cdot M\_m\right)}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -8.00000000000000006e155Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -8.00000000000000006e155 < d < -1.000000000000002e-309Initial program 64.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites68.7%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6468.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval68.7
Applied rewrites68.7%
Applied rewrites67.7%
Taylor expanded in d around inf
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites54.9%
if -1.000000000000002e-309 < d Initial program 64.5%
Applied rewrites73.7%
Applied rewrites75.4%
Applied rewrites83.4%
Final simplification73.6%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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)))
(if (<= d -8e+155)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -3e-309)
(*
(*
(fma (/ -0.125 (* l d)) (* (* (* (* M_m M_m) h) D_m) (/ D_m d)) 1.0)
(sqrt (/ d h)))
(sqrt (/ d l)))
(*
(fma (* 0.25 t_0) (* h (/ (* t_0 -0.5) l)) 1.0)
(/ d (sqrt (* h l))))))))D_m = fabs(D);
M_m = fabs(M);
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;
double tmp;
if (d <= -8e+155) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -3e-309) {
tmp = (fma((-0.125 / (l * d)), ((((M_m * M_m) * h) * D_m) * (D_m / d)), 1.0) * sqrt((d / h))) * sqrt((d / l));
} else {
tmp = fma((0.25 * t_0), (h * ((t_0 * -0.5) / l)), 1.0) * (d / sqrt((h * l)));
}
return tmp;
}
D_m = abs(D) M_m = abs(M) 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(D_m / d) * M_m) tmp = 0.0 if (d <= -8e+155) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -3e-309) tmp = Float64(Float64(fma(Float64(-0.125 / Float64(l * d)), Float64(Float64(Float64(Float64(M_m * M_m) * h) * D_m) * Float64(D_m / d)), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l))); else tmp = Float64(fma(Float64(0.25 * t_0), Float64(h * Float64(Float64(t_0 * -0.5) / l)), 1.0) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[(D$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]}, If[LessEqual[d, -8e+155], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3e-309], N[(N[(N[(N[(-0.125 / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.25 * t$95$0), $MachinePrecision] * N[(h * N[(N[(t$95$0 * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\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}{d} \cdot M\_m\\
\mathbf{if}\;d \leq -8 \cdot 10^{+155}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -3 \cdot 10^{-309}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-0.125}{\ell \cdot d}, \left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot D\_m\right) \cdot \frac{D\_m}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25 \cdot t\_0, h \cdot \frac{t\_0 \cdot -0.5}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -8.00000000000000006e155Initial program 46.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
if -8.00000000000000006e155 < d < -3.000000000000001e-309Initial program 64.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites68.7%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6468.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval68.7
Applied rewrites68.7%
Applied rewrites67.7%
Taylor expanded in d around inf
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites54.9%
if -3.000000000000001e-309 < d Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites67.0%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6467.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.0
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval67.0
Applied rewrites67.0%
Applied rewrites68.8%
Applied rewrites78.8%
Final simplification71.3%
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 -2.7e+96)
(* (- d) (sqrt (pow (* l h) -1.0)))
(if (<= d -2e-310)
(/ (sqrt (- d)) (* (sqrt (/ h d)) (sqrt (- l))))
(if (<= d 1.2e+43)
(/
(* (* (* M_m M_m) -0.125) (* (/ (* D_m D_m) d) (sqrt (* l h))))
(* l l))
(/ d (* (sqrt l) (sqrt h)))))))D_m = fabs(D);
M_m = fabs(M);
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 <= -2.7e+96) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else if (d <= -2e-310) {
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l));
} else if (d <= 1.2e+43) {
tmp = (((M_m * M_m) * -0.125) * (((D_m * D_m) / d) * sqrt((l * h)))) / (l * l);
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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 <= (-2.7d+96)) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else if (d <= (-2d-310)) then
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l))
else if (d <= 1.2d+43) then
tmp = (((m_m * m_m) * (-0.125d0)) * (((d_m * d_m) / d) * sqrt((l * h)))) / (l * l)
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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 <= -2.7e+96) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else if (d <= -2e-310) {
tmp = Math.sqrt(-d) / (Math.sqrt((h / d)) * Math.sqrt(-l));
} else if (d <= 1.2e+43) {
tmp = (((M_m * M_m) * -0.125) * (((D_m * D_m) / d) * Math.sqrt((l * h)))) / (l * l);
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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 <= -2.7e+96: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) elif d <= -2e-310: tmp = math.sqrt(-d) / (math.sqrt((h / d)) * math.sqrt(-l)) elif d <= 1.2e+43: tmp = (((M_m * M_m) * -0.125) * (((D_m * D_m) / d) * math.sqrt((l * h)))) / (l * l) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
D_m = abs(D) M_m = abs(M) 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 <= -2.7e+96) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); elseif (d <= -2e-310) tmp = Float64(sqrt(Float64(-d)) / Float64(sqrt(Float64(h / d)) * sqrt(Float64(-l)))); elseif (d <= 1.2e+43) tmp = Float64(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(Float64(D_m * D_m) / d) * sqrt(Float64(l * h)))) / Float64(l * l)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
D_m = abs(D);
M_m = abs(M);
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 <= -2.7e+96)
tmp = -d * sqrt(((l * h) ^ -1.0));
elseif (d <= -2e-310)
tmp = sqrt(-d) / (sqrt((h / d)) * sqrt(-l));
elseif (d <= 1.2e+43)
tmp = (((M_m * M_m) * -0.125) * (((D_m * D_m) / d) * sqrt((l * h)))) / (l * l);
else
tmp = d / (sqrt(l) * sqrt(h));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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, -2.7e+96], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[Sqrt[(-d)], $MachinePrecision] / N[(N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.2e+43], N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.7 \cdot 10^{+96}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\frac{h}{d}} \cdot \sqrt{-\ell}}\\
\mathbf{elif}\;d \leq 1.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \left(\frac{D\_m \cdot D\_m}{d} \cdot \sqrt{\ell \cdot h}\right)}{\ell \cdot \ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -2.70000000000000022e96Initial program 55.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.4
Applied rewrites76.4%
if -2.70000000000000022e96 < d < -1.999999999999994e-310Initial program 61.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f648.6
Applied rewrites8.6%
Applied rewrites29.9%
Applied rewrites37.7%
if -1.999999999999994e-310 < d < 1.20000000000000012e43Initial program 60.4%
Taylor expanded in l around 0
lower-/.f64N/A
Applied rewrites49.0%
Taylor expanded in d around 0
Applied rewrites42.0%
if 1.20000000000000012e43 < d Initial program 70.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6470.2
Applied rewrites70.2%
Applied rewrites70.2%
Applied rewrites78.5%
Final simplification56.1%
D_m = (fabs.f64 D) M_m = (fabs.f64 M) 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 5.5e-305) (* (- d) (sqrt (pow (* l h) -1.0))) (/ d (* (sqrt l) (sqrt h)))))
D_m = fabs(D);
M_m = fabs(M);
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 <= 5.5e-305) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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 <= 5.5d-305) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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 <= 5.5e-305) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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 <= 5.5e-305: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
D_m = abs(D) M_m = abs(M) 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 <= 5.5e-305) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
D_m = abs(D);
M_m = abs(M);
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 <= 5.5e-305)
tmp = -d * sqrt(((l * h) ^ -1.0));
else
tmp = d / (sqrt(l) * sqrt(h));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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, 5.5e-305], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.5 \cdot 10^{-305}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 5.5e-305Initial program 59.4%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6450.4
Applied rewrites50.4%
if 5.5e-305 < l Initial program 64.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.7
Applied rewrites40.7%
Applied rewrites40.7%
Applied rewrites46.7%
Final simplification48.5%
D_m = (fabs.f64 D) M_m = (fabs.f64 M) 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 (pow (* l h) -1.0)))) (if (<= l -3.3e-240) (* (- d) t_0) (* t_0 d))))
D_m = fabs(D);
M_m = fabs(M);
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(pow((l * h), -1.0));
double tmp;
if (l <= -3.3e-240) {
tmp = -d * t_0;
} else {
tmp = t_0 * d;
}
return tmp;
}
D_m = abs(d)
M_m = abs(m)
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(((l * h) ** (-1.0d0)))
if (l <= (-3.3d-240)) then
tmp = -d * t_0
else
tmp = t_0 * d
end if
code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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(Math.pow((l * h), -1.0));
double tmp;
if (l <= -3.3e-240) {
tmp = -d * t_0;
} else {
tmp = t_0 * d;
}
return tmp;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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(math.pow((l * h), -1.0)) tmp = 0 if l <= -3.3e-240: tmp = -d * t_0 else: tmp = t_0 * d return tmp
D_m = abs(D) M_m = abs(M) 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(l * h) ^ -1.0)) tmp = 0.0 if (l <= -3.3e-240) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(t_0 * d); end return tmp end
D_m = abs(D);
M_m = abs(M);
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(((l * h) ^ -1.0));
tmp = 0.0;
if (l <= -3.3e-240)
tmp = -d * t_0;
else
tmp = t_0 * d;
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -3.3e-240], N[((-d) * t$95$0), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{if}\;\ell \leq -3.3 \cdot 10^{-240}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot d\\
\end{array}
\end{array}
if l < -3.3000000000000002e-240Initial program 56.4%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6452.5
Applied rewrites52.5%
if -3.3000000000000002e-240 < l Initial program 66.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Final simplification45.5%
D_m = (fabs.f64 D) M_m = (fabs.f64 M) 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 (* (sqrt (pow (* l h) -1.0)) d))
D_m = fabs(D);
M_m = fabs(M);
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 sqrt(pow((l * h), -1.0)) * d;
}
D_m = abs(d)
M_m = abs(m)
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 = sqrt(((l * h) ** (-1.0d0))) * d
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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 Math.sqrt(Math.pow((l * h), -1.0)) * d;
}
D_m = math.fabs(D) M_m = math.fabs(M) [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 math.sqrt(math.pow((l * h), -1.0)) * d
D_m = abs(D) M_m = abs(M) 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(sqrt((Float64(l * h) ^ -1.0)) * d) end
D_m = abs(D);
M_m = abs(M);
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 = sqrt(((l * h) ^ -1.0)) * d;
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
\end{array}
Initial program 61.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6423.9
Applied rewrites23.9%
Final simplification23.9%
D_m = (fabs.f64 D) M_m = (fabs.f64 M) 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 (sqrt (* l h))))
D_m = fabs(D);
M_m = fabs(M);
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 / sqrt((l * h));
}
D_m = abs(d)
M_m = abs(m)
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 / sqrt((l * h))
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
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.sqrt((l * h));
}
D_m = math.fabs(D) M_m = math.fabs(M) [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.sqrt((l * h))
D_m = abs(D) M_m = abs(M) 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 / sqrt(Float64(l * h))) end
D_m = abs(D);
M_m = abs(M);
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 / sqrt((l * h));
end
D_m = N[Abs[D], $MachinePrecision] M_m = N[Abs[M], $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[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 61.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6423.9
Applied rewrites23.9%
Applied rewrites23.1%
herbie shell --seed 2024308
(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)))))