
(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 25 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
(-
1.0
(*
(/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
(/ (* M_m (* D_m (/ 0.5 d))) l))))
(t_1 (pow (/ d l) (/ 1.0 2.0)))
(t_2 (sqrt (- d)))
(t_3 (* (* M_m (/ 0.5 d)) D_m)))
(if (<= d -1.25e-176)
(* t_0 (* t_1 (/ t_2 (sqrt (- h)))))
(if (<= d -1.22e-300)
(*
(/ t_2 (sqrt (- l)))
(* (sqrt (/ d h)) (fma (* t_3 (* -0.5 (/ h l))) t_3 1.0)))
(if (<= d 5.2e-260)
(*
(/ d (sqrt (* l h)))
(fma t_3 (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 1.0))
(* (* (/ (sqrt d) (sqrt h)) t_1) t_0))))))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 = 1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((M_m * (D_m * (0.5 / d))) / l));
double t_1 = pow((d / l), (1.0 / 2.0));
double t_2 = sqrt(-d);
double t_3 = (M_m * (0.5 / d)) * D_m;
double tmp;
if (d <= -1.25e-176) {
tmp = t_0 * (t_1 * (t_2 / sqrt(-h)));
} else if (d <= -1.22e-300) {
tmp = (t_2 / sqrt(-l)) * (sqrt((d / h)) * fma((t_3 * (-0.5 * (h / l))), t_3, 1.0));
} else if (d <= 5.2e-260) {
tmp = (d / sqrt((l * h))) * fma(t_3, (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * t_0;
}
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(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l))) t_1 = Float64(d / l) ^ Float64(1.0 / 2.0) t_2 = sqrt(Float64(-d)) t_3 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m) tmp = 0.0 if (d <= -1.25e-176) tmp = Float64(t_0 * Float64(t_1 * Float64(t_2 / sqrt(Float64(-h))))); elseif (d <= -1.22e-300) tmp = Float64(Float64(t_2 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * fma(Float64(t_3 * Float64(-0.5 * Float64(h / l))), t_3, 1.0))); elseif (d <= 5.2e-260) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(t_3, Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * t_0); 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[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$3 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[d, -1.25e-176], N[(t$95$0 * N[(t$95$1 * N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.22e-300], N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$3 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.2e-260], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$3 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$0), $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 := 1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\\
t_1 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
t_2 := \sqrt{-d}\\
t_3 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{-176}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{t\_2}{\sqrt{-h}}\right)\\
\mathbf{elif}\;d \leq -1.22 \cdot 10^{-300}:\\
\;\;\;\;\frac{t\_2}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(t\_3 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_3, 1\right)\right)\\
\mathbf{elif}\;d \leq 5.2 \cdot 10^{-260}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_3, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if d < -1.25e-176Initial program 80.2%
Applied rewrites84.6%
lift-/.f64N/A
metadata-eval84.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lower-/.f6492.4
Applied rewrites92.4%
if -1.25e-176 < d < -1.22e-300Initial program 37.9%
Applied rewrites36.0%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites37.9%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6460.5
Applied rewrites60.5%
if -1.22e-300 < d < 5.19999999999999987e-260Initial program 21.4%
Applied rewrites21.4%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites30.9%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6431.1
Applied rewrites31.1%
Applied rewrites60.4%
if 5.19999999999999987e-260 < d Initial program 64.6%
Applied rewrites67.0%
lift-/.f64N/A
metadata-eval67.0
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6481.9
Applied rewrites81.9%
Final simplification83.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 (/ 0.5 d)) D_m))
(t_1 (fma (* t_0 (* -0.5 (/ h l))) t_0 1.0))
(t_2 (sqrt (- d))))
(if (<= l -3.05e+137)
(* (/ t_2 (sqrt (- l))) (* (sqrt (/ d h)) t_1))
(if (<= l -2e-310)
(/ (* (* (sqrt (/ d l)) t_1) t_2) (sqrt (- h)))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(*
(/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
(/ (* M_m (* D_m (/ 0.5 d))) 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 = (M_m * (0.5 / d)) * D_m;
double t_1 = fma((t_0 * (-0.5 * (h / l))), t_0, 1.0);
double t_2 = sqrt(-d);
double tmp;
if (l <= -3.05e+137) {
tmp = (t_2 / sqrt(-l)) * (sqrt((d / h)) * t_1);
} else if (l <= -2e-310) {
tmp = ((sqrt((d / l)) * t_1) * t_2) / sqrt(-h);
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((M_m * (D_m * (0.5 / d))) / 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(M_m * Float64(0.5 / d)) * D_m) t_1 = fma(Float64(t_0 * Float64(-0.5 * Float64(h / l))), t_0, 1.0) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -3.05e+137) tmp = Float64(Float64(t_2 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * t_1)); elseif (l <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(d / l)) * t_1) * t_2) / sqrt(Float64(-h))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / 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[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -3.05e+137], N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
t_1 := \mathsf{fma}\left(t\_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_0, 1\right)\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -3.05 \cdot 10^{+137}:\\
\;\;\;\;\frac{t\_2}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(\sqrt{\frac{d}{\ell}} \cdot t\_1\right) \cdot t\_2}{\sqrt{-h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\right)\\
\end{array}
\end{array}
if l < -3.05000000000000002e137Initial program 70.1%
Applied rewrites70.1%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.9%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6480.4
Applied rewrites80.4%
if -3.05000000000000002e137 < l < -1.999999999999994e-310Initial program 73.3%
Applied rewrites84.3%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.9%
if -1.999999999999994e-310 < l Initial program 61.7%
Applied rewrites63.9%
lift-/.f64N/A
metadata-eval63.9
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6478.5
Applied rewrites78.5%
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 (sqrt (- d)))
(t_1 (* (* M_m (/ 0.5 d)) D_m))
(t_2 (fma (* t_1 (* -0.5 (/ h l))) t_1 1.0))
(t_3 (sqrt (/ d l))))
(if (<= l -3.05e+137)
(* (/ t_0 (sqrt (- l))) (* (sqrt (/ d h)) t_2))
(if (<= l -2e-310)
(/ (* (* t_3 t_2) t_0) (sqrt (- h)))
(* (* (/ (sqrt d) (sqrt h)) t_2) t_3)))))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 t_1 = (M_m * (0.5 / d)) * D_m;
double t_2 = fma((t_1 * (-0.5 * (h / l))), t_1, 1.0);
double t_3 = sqrt((d / l));
double tmp;
if (l <= -3.05e+137) {
tmp = (t_0 / sqrt(-l)) * (sqrt((d / h)) * t_2);
} else if (l <= -2e-310) {
tmp = ((t_3 * t_2) * t_0) / sqrt(-h);
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_2) * t_3;
}
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)) t_1 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m) t_2 = fma(Float64(t_1 * Float64(-0.5 * Float64(h / l))), t_1, 1.0) t_3 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -3.05e+137) tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * t_2)); elseif (l <= -2e-310) tmp = Float64(Float64(Float64(t_3 * t_2) * t_0) / sqrt(Float64(-h))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_2) * t_3); 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]}, Block[{t$95$1 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -3.05e+137], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(N[(t$95$3 * t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $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}\\
t_1 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
t_2 := \mathsf{fma}\left(t\_1 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_1, 1\right)\\
t_3 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -3.05 \cdot 10^{+137}:\\
\;\;\;\;\frac{t\_0}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_2\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(t\_3 \cdot t\_2\right) \cdot t\_0}{\sqrt{-h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_2\right) \cdot t\_3\\
\end{array}
\end{array}
if l < -3.05000000000000002e137Initial program 70.1%
Applied rewrites70.1%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.9%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6480.4
Applied rewrites80.4%
if -3.05000000000000002e137 < l < -1.999999999999994e-310Initial program 73.3%
Applied rewrites84.3%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites85.9%
if -1.999999999999994e-310 < l Initial program 61.7%
Applied rewrites60.9%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites62.5%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f6477.0
Applied rewrites77.0%
Final simplification80.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 (/ 0.5 d)) D_m))
(t_1 (fma (* t_0 (* -0.5 (/ h l))) t_0 1.0))
(t_2 (sqrt (/ d l)))
(t_3 (sqrt (- d))))
(if (<= l -3.4e+137)
(* (/ t_3 (sqrt (- l))) (* (sqrt (/ d h)) t_1))
(if (<= l -2e-310)
(* (* t_1 (/ t_3 (sqrt (- h)))) t_2)
(* (* (/ (sqrt d) (sqrt h)) t_1) t_2)))))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 * (0.5 / d)) * D_m;
double t_1 = fma((t_0 * (-0.5 * (h / l))), t_0, 1.0);
double t_2 = sqrt((d / l));
double t_3 = sqrt(-d);
double tmp;
if (l <= -3.4e+137) {
tmp = (t_3 / sqrt(-l)) * (sqrt((d / h)) * t_1);
} else if (l <= -2e-310) {
tmp = (t_1 * (t_3 / sqrt(-h))) * t_2;
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * t_2;
}
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(M_m * Float64(0.5 / d)) * D_m) t_1 = fma(Float64(t_0 * Float64(-0.5 * Float64(h / l))), t_0, 1.0) t_2 = sqrt(Float64(d / l)) t_3 = sqrt(Float64(-d)) tmp = 0.0 if (l <= -3.4e+137) tmp = Float64(Float64(t_3 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * t_1)); elseif (l <= -2e-310) tmp = Float64(Float64(t_1 * Float64(t_3 / sqrt(Float64(-h)))) * t_2); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * t_2); 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[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[l, -3.4e+137], N[(N[(t$95$3 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(t$95$1 * N[(t$95$3 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $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 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
t_1 := \mathsf{fma}\left(t\_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_0, 1\right)\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_3 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{+137}:\\
\;\;\;\;\frac{t\_3}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_1 \cdot \frac{t\_3}{\sqrt{-h}}\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right) \cdot t\_2\\
\end{array}
\end{array}
if l < -3.39999999999999986e137Initial program 70.1%
Applied rewrites70.1%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.9%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6480.4
Applied rewrites80.4%
if -3.39999999999999986e137 < l < -1.999999999999994e-310Initial program 73.3%
Applied rewrites72.8%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites74.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6486.8
Applied rewrites86.8%
if -1.999999999999994e-310 < l Initial program 61.7%
Applied rewrites60.9%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites62.5%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f6477.0
Applied rewrites77.0%
Final simplification80.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
(let* ((t_0 (sqrt (/ d l)))
(t_1 (sqrt (/ d h)))
(t_2 (* (* M_m (/ 0.5 d)) D_m))
(t_3 (fma t_2 (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 1.0)))
(if (<= l -2e-310)
(* (* t_0 t_3) t_1)
(if (<= l 8.6e+132)
(* (/ (* (sqrt d) t_3) (sqrt h)) t_0)
(*
(/ (sqrt d) (sqrt l))
(* t_1 (fma (* t_2 (* -0.5 (/ h l))) t_2 1.0)))))))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 / l));
double t_1 = sqrt((d / h));
double t_2 = (M_m * (0.5 / d)) * D_m;
double t_3 = fma(t_2, (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
double tmp;
if (l <= -2e-310) {
tmp = (t_0 * t_3) * t_1;
} else if (l <= 8.6e+132) {
tmp = ((sqrt(d) * t_3) / sqrt(h)) * t_0;
} else {
tmp = (sqrt(d) / sqrt(l)) * (t_1 * fma((t_2 * (-0.5 * (h / l))), t_2, 1.0));
}
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 / l)) t_1 = sqrt(Float64(d / h)) t_2 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m) t_3 = fma(t_2, Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(t_0 * t_3) * t_1); elseif (l <= 8.6e+132) tmp = Float64(Float64(Float64(sqrt(d) * t_3) / sqrt(h)) * t_0); else tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_1 * fma(Float64(t_2 * Float64(-0.5 * Float64(h / l))), t_2, 1.0))); 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[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(t$95$0 * t$95$3), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 8.6e+132], N[(N[(N[(N[Sqrt[d], $MachinePrecision] * t$95$3), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$2 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2 + 1.0), $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 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
t_3 := \mathsf{fma}\left(t\_2, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_0 \cdot t\_3\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq 8.6 \cdot 10^{+132}:\\
\;\;\;\;\frac{\sqrt{d} \cdot t\_3}{\sqrt{h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_1 \cdot \mathsf{fma}\left(t\_2 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_2, 1\right)\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 72.2%
Applied rewrites71.8%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6472.2
Applied rewrites72.2%
Applied rewrites72.2%
if -1.999999999999994e-310 < l < 8.59999999999999964e132Initial program 63.1%
Applied rewrites61.9%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.1%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.0
Applied rewrites65.0%
Applied rewrites78.7%
if 8.59999999999999964e132 < l Initial program 58.3%
Applied rewrites58.3%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites61.0%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
Final simplification74.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
(let* ((t_0 (* (* M_m (/ 0.5 d)) D_m))
(t_1 (fma (* t_0 (* -0.5 (/ h l))) t_0 1.0)))
(if (<= h -2e-310)
(* (/ (sqrt (- d)) (sqrt (- l))) (* (sqrt (/ d h)) t_1))
(* (* (/ (sqrt d) (sqrt h)) t_1) (sqrt (/ d 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 = (M_m * (0.5 / d)) * D_m;
double t_1 = fma((t_0 * (-0.5 * (h / l))), t_0, 1.0);
double tmp;
if (h <= -2e-310) {
tmp = (sqrt(-d) / sqrt(-l)) * (sqrt((d / h)) * t_1);
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * sqrt((d / 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(M_m * Float64(0.5 / d)) * D_m) t_1 = fma(Float64(t_0 * Float64(-0.5 * Float64(h / l))), t_0, 1.0) tmp = 0.0 if (h <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * t_1)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * sqrt(Float64(d / 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[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[h, -2e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Sqrt[N[(d / l), $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 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
t_1 := \mathsf{fma}\left(t\_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_0, 1\right)\\
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right) \cdot \sqrt{\frac{d}{\ell}}\\
\end{array}
\end{array}
if h < -1.999999999999994e-310Initial program 72.2%
Applied rewrites71.8%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites72.8%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6478.2
Applied rewrites78.2%
if -1.999999999999994e-310 < h Initial program 61.7%
Applied rewrites60.9%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites62.5%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f6477.0
Applied rewrites77.0%
Final simplification77.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 (sqrt (/ d l)))
(t_1
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
1.0)))
(if (<= l -2e-310)
(* (* t_0 t_1) (sqrt (/ d h)))
(if (<= l 6.2e+194)
(* (/ (* (sqrt d) t_1) (sqrt 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 = sqrt((d / l));
double t_1 = fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
double tmp;
if (l <= -2e-310) {
tmp = (t_0 * t_1) * sqrt((d / h));
} else if (l <= 6.2e+194) {
tmp = ((sqrt(d) * t_1) / sqrt(h)) * t_0;
} else {
tmp = 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 = sqrt(Float64(d / l)) t_1 = fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(t_0 * t_1) * sqrt(Float64(d / h))); elseif (l <= 6.2e+194) tmp = Float64(Float64(Float64(sqrt(d) * t_1) / sqrt(h)) * t_0); else tmp = Float64(d / Float64(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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e+194], N[(N[(N[(N[Sqrt[d], $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $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}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+194}:\\
\;\;\;\;\frac{\sqrt{d} \cdot t\_1}{\sqrt{h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 72.2%
Applied rewrites71.8%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6472.2
Applied rewrites72.2%
Applied rewrites72.2%
if -1.999999999999994e-310 < l < 6.1999999999999999e194Initial program 63.5%
Applied rewrites62.5%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.5%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.2
Applied rewrites65.2%
Applied rewrites77.3%
if 6.1999999999999999e194 < l Initial program 54.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
Applied rewrites70.1%
Applied rewrites79.6%
Final simplification74.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
(let* ((t_0 (sqrt (/ d l))) (t_1 (* (* M_m (/ 0.5 d)) D_m)))
(if (<= l 1.55e-230)
(*
(* t_0 (fma t_1 (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 1.0))
(sqrt (/ d h)))
(*
(* (/ (sqrt d) (sqrt h)) (fma (* t_1 (* -0.5 (/ h l))) t_1 1.0))
t_0))))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 / l));
double t_1 = (M_m * (0.5 / d)) * D_m;
double tmp;
if (l <= 1.55e-230) {
tmp = (t_0 * fma(t_1, (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0)) * sqrt((d / h));
} else {
tmp = ((sqrt(d) / sqrt(h)) * fma((t_1 * (-0.5 * (h / l))), t_1, 1.0)) * t_0;
}
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 / l)) t_1 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m) tmp = 0.0 if (l <= 1.55e-230) tmp = Float64(Float64(t_0 * fma(t_1, Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)) * sqrt(Float64(d / h))); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * fma(Float64(t_1 * Float64(-0.5 * Float64(h / l))), t_1, 1.0)) * t_0); 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[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[l, 1.55e-230], N[(N[(t$95$0 * N[(t$95$1 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $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{\frac{d}{\ell}}\\
t_1 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
\mathbf{if}\;\ell \leq 1.55 \cdot 10^{-230}:\\
\;\;\;\;\left(t\_0 \cdot \mathsf{fma}\left(t\_1, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \mathsf{fma}\left(t\_1 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), t\_1, 1\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if l < 1.55e-230Initial program 73.5%
Applied rewrites72.5%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites74.1%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6474.1
Applied rewrites74.1%
Applied rewrites74.1%
if 1.55e-230 < l Initial program 58.3%
Applied rewrites58.3%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites59.2%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f6475.9
Applied rewrites75.9%
Final simplification74.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
(let* ((t_0 (* M_m (/ 0.5 d))))
(if (<= l -2.35e+104)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l 4.4e-281)
(*
(sqrt (* (/ (/ d l) h) d))
(fma t_0 (* (* (* (* -0.5 (/ h l)) D_m) t_0) D_m) 1.0))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma (* t_0 D_m) (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 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 * (0.5 / d);
double tmp;
if (l <= -2.35e+104) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= 4.4e-281) {
tmp = sqrt((((d / l) / h) * d)) * fma(t_0, ((((-0.5 * (h / l)) * D_m) * t_0) * D_m), 1.0);
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma((t_0 * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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(0.5 / d)) tmp = 0.0 if (l <= -2.35e+104) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= 4.4e-281) tmp = Float64(sqrt(Float64(Float64(Float64(d / l) / h) * d)) * fma(t_0, Float64(Float64(Float64(Float64(-0.5 * Float64(h / l)) * D_m) * t_0) * D_m), 1.0)); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(t_0 * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.35e+104], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.4e-281], N[(N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * t$95$0), $MachinePrecision] * D$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
t_0 := M\_m \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq -2.35 \cdot 10^{+104}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 4.4 \cdot 10^{-281}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{\ell}}{h} \cdot d} \cdot \mathsf{fma}\left(t\_0, \left(\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot D\_m\right) \cdot t\_0\right) \cdot D\_m, 1\right)\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0 \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.35000000000000008e104Initial program 69.2%
Applied rewrites75.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
if -2.35000000000000008e104 < l < 4.40000000000000008e-281Initial program 74.9%
Applied rewrites65.8%
Applied rewrites66.9%
if 4.40000000000000008e-281 < l < 5.8000000000000003e205Initial program 61.6%
Applied rewrites60.6%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites61.7%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.4
Applied rewrites63.4%
Applied rewrites74.0%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification70.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
(let* ((t_0 (* M_m (/ 0.5 d))))
(if (<= l -2.35e+104)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l -1.4e-295)
(*
(fma (* (* (* (* (* -0.5 (/ h l)) D_m) t_0) (/ 0.5 d)) M_m) D_m 1.0)
(sqrt (* (/ (/ d l) h) d)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma (* t_0 D_m) (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 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 * (0.5 / d);
double tmp;
if (l <= -2.35e+104) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= -1.4e-295) {
tmp = fma((((((-0.5 * (h / l)) * D_m) * t_0) * (0.5 / d)) * M_m), D_m, 1.0) * sqrt((((d / l) / h) * d));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma((t_0 * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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(0.5 / d)) tmp = 0.0 if (l <= -2.35e+104) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -1.4e-295) tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(h / l)) * D_m) * t_0) * Float64(0.5 / d)) * M_m), D_m, 1.0) * sqrt(Float64(Float64(Float64(d / l) / h) * d))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(t_0 * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.35e+104], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.4e-295], N[(N[(N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
t_0 := M\_m \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq -2.35 \cdot 10^{+104}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -1.4 \cdot 10^{-295}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot D\_m\right) \cdot t\_0\right) \cdot \frac{0.5}{d}\right) \cdot M\_m, D\_m, 1\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{h} \cdot d}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0 \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -2.35000000000000008e104Initial program 69.2%
Applied rewrites75.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
if -2.35000000000000008e104 < l < -1.4e-295Initial program 74.9%
Applied rewrites64.9%
Applied rewrites64.9%
if -1.4e-295 < l < 5.8000000000000003e205Initial program 62.6%
Applied rewrites61.6%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites62.7%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.2
Applied rewrites65.2%
Applied rewrites73.2%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification70.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 (* M_m (/ 0.5 d))))
(if (<= l -1.5e+102)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l -1.4e-295)
(*
(fma M_m (* (* (* (* -0.5 (/ h l)) D_m) t_0) (* D_m (/ 0.5 d))) 1.0)
(sqrt (* (/ (/ d l) h) d)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma (* t_0 D_m) (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 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 * (0.5 / d);
double tmp;
if (l <= -1.5e+102) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= -1.4e-295) {
tmp = fma(M_m, ((((-0.5 * (h / l)) * D_m) * t_0) * (D_m * (0.5 / d))), 1.0) * sqrt((((d / l) / h) * d));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma((t_0 * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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(0.5 / d)) tmp = 0.0 if (l <= -1.5e+102) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -1.4e-295) tmp = Float64(fma(M_m, Float64(Float64(Float64(Float64(-0.5 * Float64(h / l)) * D_m) * t_0) * Float64(D_m * Float64(0.5 / d))), 1.0) * sqrt(Float64(Float64(Float64(d / l) / h) * d))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(t_0 * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5e+102], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.4e-295], N[(N[(M$95$m * N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
t_0 := M\_m \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{+102}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -1.4 \cdot 10^{-295}:\\
\;\;\;\;\mathsf{fma}\left(M\_m, \left(\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot D\_m\right) \cdot t\_0\right) \cdot \left(D\_m \cdot \frac{0.5}{d}\right), 1\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{h} \cdot d}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0 \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.4999999999999999e102Initial program 69.2%
Applied rewrites75.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
if -1.4999999999999999e102 < l < -1.4e-295Initial program 74.9%
Applied rewrites64.9%
Applied rewrites63.6%
if -1.4e-295 < l < 5.8000000000000003e205Initial program 62.6%
Applied rewrites61.6%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites62.7%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.2
Applied rewrites65.2%
Applied rewrites73.2%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification69.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 (sqrt (/ d l))))
(if (<= l -1.6e-139)
(/ (* t_0 (sqrt (- d))) (sqrt (- h)))
(if (<= l -2e-310)
(*
(*
(/ (fma (/ (* -0.125 (* (* M_m M_m) h)) d) (/ (* D_m D_m) d) l) l)
(sqrt (/ d h)))
t_0)
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
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 = sqrt((d / l));
double tmp;
if (l <= -1.6e-139) {
tmp = (t_0 * sqrt(-d)) / sqrt(-h);
} else if (l <= -2e-310) {
tmp = ((fma(((-0.125 * ((M_m * M_m) * h)) / d), ((D_m * D_m) / d), l) / l) * sqrt((d / h))) * t_0;
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -1.6e-139) tmp = Float64(Float64(t_0 * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -2e-310) tmp = Float64(Float64(Float64(fma(Float64(Float64(-0.125 * Float64(Float64(M_m * M_m) * h)) / d), Float64(Float64(D_m * D_m) / d), l) / l) * sqrt(Float64(d / h))) * t_0); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.6e-139], N[(N[(t$95$0 * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(N[(N[(N[(N[(-0.125 * N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] + l), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-139}:\\
\;\;\;\;\frac{t\_0 \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(\frac{-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot h\right)}{d}, \frac{D\_m \cdot D\_m}{d}, \ell\right)}{\ell} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_0\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.6e-139Initial program 73.2%
Applied rewrites80.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6459.2
Applied rewrites59.2%
if -1.6e-139 < l < -1.999999999999994e-310Initial program 68.7%
Applied rewrites70.7%
Taylor expanded in l around 0
lower-/.f64N/A
Applied rewrites64.2%
if -1.999999999999994e-310 < l < 5.8000000000000003e205Initial program 63.3%
Applied rewrites62.2%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
Applied rewrites73.9%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification67.7%
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
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
1.0)))
(if (<= l 8.5e-259)
(* (* (sqrt (/ d l)) t_0) (sqrt (/ d h)))
(if (<= l 5.8e+205)
(* (/ d (sqrt (* l 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(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
double tmp;
if (l <= 8.5e-259) {
tmp = (sqrt((d / l)) * t_0) * sqrt((d / h));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * t_0;
} else {
tmp = 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(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0) tmp = 0.0 if (l <= 8.5e-259) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_0) * sqrt(Float64(d / h))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * t_0); else tmp = Float64(d / Float64(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[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, 8.5e-259], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $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}
t_0 := \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{if}\;\ell \leq 8.5 \cdot 10^{-259}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 8.4999999999999994e-259Initial program 73.1%
Applied rewrites72.1%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites73.7%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
Applied rewrites73.8%
if 8.4999999999999994e-259 < l < 5.8000000000000003e205Initial program 60.6%
Applied rewrites60.5%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites60.6%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
Applied rewrites73.6%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification74.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
(let* ((t_0 (* (* M_m (/ 0.5 d)) D_m)))
(if (<= l 8.5e-259)
(*
(* (fma (* (/ (* (* M_m D_m) -0.25) l) (/ h d)) t_0 1.0) (sqrt (/ d h)))
(sqrt (/ d l)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma t_0 (* (/ (* M_m D_m) l) (* -0.25 (/ h d))) 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 * (0.5 / d)) * D_m;
double tmp;
if (l <= 8.5e-259) {
tmp = (fma(((((M_m * D_m) * -0.25) / l) * (h / d)), t_0, 1.0) * sqrt((d / h))) * sqrt((d / l));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(t_0, (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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(Float64(M_m * Float64(0.5 / d)) * D_m) tmp = 0.0 if (l <= 8.5e-259) tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(M_m * D_m) * -0.25) / l) * Float64(h / d)), t_0, 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(t_0, Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[l, 8.5e-259], N[(N[(N[(N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * -0.25), $MachinePrecision] / l), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
t_0 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
\mathbf{if}\;\ell \leq 8.5 \cdot 10^{-259}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot D\_m\right) \cdot -0.25}{\ell} \cdot \frac{h}{d}, t\_0, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 8.4999999999999994e-259Initial program 73.1%
Applied rewrites72.1%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites73.7%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
if 8.4999999999999994e-259 < l < 5.8000000000000003e205Initial program 60.6%
Applied rewrites60.5%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites60.6%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
Applied rewrites73.6%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification74.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 -7.8e+101)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l -2e-310)
(*
(fma (- h) (* (/ (/ (* D_m D_m) d) d) (/ (* 0.125 (* M_m M_m)) l)) 1.0)
(sqrt (* (/ (/ d l) h) d)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
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 <= -7.8e+101) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= -2e-310) {
tmp = fma(-h, ((((D_m * D_m) / d) / d) * ((0.125 * (M_m * M_m)) / l)), 1.0) * sqrt((((d / l) / h) * d));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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 (l <= -7.8e+101) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -2e-310) tmp = Float64(fma(Float64(-h), Float64(Float64(Float64(Float64(D_m * D_m) / d) / d) * Float64(Float64(0.125 * Float64(M_m * M_m)) / l)), 1.0) * sqrt(Float64(Float64(Float64(d / l) / h) * d))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[l, -7.8e+101], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[((-h) * N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * N[(N[(0.125 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -7.8 \cdot 10^{+101}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(-h, \frac{\frac{D\_m \cdot D\_m}{d}}{d} \cdot \frac{0.125 \cdot \left(M\_m \cdot M\_m\right)}{\ell}, 1\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{h} \cdot d}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -7.8e101Initial program 69.2%
Applied rewrites75.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
if -7.8e101 < l < -1.999999999999994e-310Initial program 74.0%
Applied rewrites64.1%
Taylor expanded in h around -inf
associate-*r*N/A
sub-negN/A
distribute-lft-inN/A
distribute-neg-frac2N/A
mul-1-negN/A
rgt-mult-inverseN/A
lower-fma.f64N/A
Applied rewrites52.8%
if -1.999999999999994e-310 < l < 5.8000000000000003e205Initial program 63.3%
Applied rewrites62.2%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
Applied rewrites73.9%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification66.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
(if (<= l -1.35e-139)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l -2e-310)
(*
(/ (fma (/ (* -0.125 (* (* M_m M_m) h)) d) (/ (* D_m D_m) d) l) l)
(sqrt (* (/ (/ d l) h) d)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
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 <= -1.35e-139) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= -2e-310) {
tmp = (fma(((-0.125 * ((M_m * M_m) * h)) / d), ((D_m * D_m) / d), l) / l) * sqrt((((d / l) / h) * d));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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 (l <= -1.35e-139) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -2e-310) tmp = Float64(Float64(fma(Float64(Float64(-0.125 * Float64(Float64(M_m * M_m) * h)) / d), Float64(Float64(D_m * D_m) / d), l) / l) * sqrt(Float64(Float64(Float64(d / l) / h) * d))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[l, -1.35e-139], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(N[(N[(N[(-0.125 * N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] + l), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -1.35 \cdot 10^{-139}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot h\right)}{d}, \frac{D\_m \cdot D\_m}{d}, \ell\right)}{\ell} \cdot \sqrt{\frac{\frac{d}{\ell}}{h} \cdot d}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.3499999999999999e-139Initial program 73.2%
Applied rewrites80.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6459.2
Applied rewrites59.2%
if -1.3499999999999999e-139 < l < -1.999999999999994e-310Initial program 68.7%
Applied rewrites64.8%
Taylor expanded in l around 0
lower-/.f64N/A
Applied rewrites61.2%
if -1.999999999999994e-310 < l < 5.8000000000000003e205Initial program 63.3%
Applied rewrites62.2%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
Applied rewrites73.9%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification67.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 (<= l -1.7e-220)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l -2e-310)
(*
(* (/ (/ (* M_m M_m) d) d) (* (* (/ (* D_m D_m) l) h) -0.125))
(sqrt (* (/ (/ d l) h) d)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
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 <= -1.7e-220) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= -2e-310) {
tmp = ((((M_m * M_m) / d) / d) * ((((D_m * D_m) / l) * h) * -0.125)) * sqrt((((d / l) / h) * d));
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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 (l <= -1.7e-220) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= -2e-310) tmp = Float64(Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) * Float64(Float64(Float64(Float64(D_m * D_m) / l) * h) * -0.125)) * sqrt(Float64(Float64(Float64(d / l) / h) * d))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[l, -1.7e-220], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(N[(d / l), $MachinePrecision] / h), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -1.7 \cdot 10^{-220}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\frac{M\_m \cdot M\_m}{d}}{d} \cdot \left(\left(\frac{D\_m \cdot D\_m}{\ell} \cdot h\right) \cdot -0.125\right)\right) \cdot \sqrt{\frac{\frac{d}{\ell}}{h} \cdot d}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.69999999999999997e-220Initial program 72.6%
Applied rewrites80.4%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6457.4
Applied rewrites57.4%
if -1.69999999999999997e-220 < l < -1.999999999999994e-310Initial program 69.2%
Applied rewrites72.7%
Taylor expanded in h around inf
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites55.9%
if -1.999999999999994e-310 < l < 5.8000000000000003e205Initial program 63.3%
Applied rewrites62.2%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
Applied rewrites73.9%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification66.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 -2e-310)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= l 5.8e+205)
(*
(/ d (sqrt (* l h)))
(fma
(* (* M_m (/ 0.5 d)) D_m)
(* (/ (* M_m D_m) l) (* -0.25 (/ h d)))
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 <= -2e-310) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (l <= 5.8e+205) {
tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((M_m * D_m) / l) * (-0.25 * (h / d))), 1.0);
} else {
tmp = 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 (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (l <= 5.8e+205) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(M_m * D_m) / l) * Float64(-0.25 * Float64(h / d))), 1.0)); else tmp = Float64(d / Float64(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[l, -2e-310], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e+205], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(-0.25 * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+205}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \frac{M\_m \cdot D\_m}{\ell} \cdot \left(-0.25 \cdot \frac{h}{d}\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 72.2%
Applied rewrites80.1%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6451.9
Applied rewrites51.9%
if -1.999999999999994e-310 < l < 5.8000000000000003e205Initial program 63.3%
Applied rewrites62.2%
lift-fma.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites63.3%
Taylor expanded in h around 0
associate-*r/N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
Applied rewrites73.9%
if 5.8000000000000003e205 < l Initial program 54.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied rewrites75.8%
Applied rewrites75.9%
Applied rewrites82.2%
Final simplification63.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 -6e-199)
(/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
(if (<= d 4.3e-128)
(* (sqrt (/ 1.0 (* l h))) (- d))
(/ 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 <= -6e-199) {
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
} else if (d <= 4.3e-128) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 <= (-6d-199)) then
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h)
else if (d <= 4.3d-128) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 <= -6e-199) {
tmp = (Math.sqrt((d / l)) * Math.sqrt(-d)) / Math.sqrt(-h);
} else if (d <= 4.3e-128) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} 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 <= -6e-199: tmp = (math.sqrt((d / l)) * math.sqrt(-d)) / math.sqrt(-h) elif d <= 4.3e-128: tmp = math.sqrt((1.0 / (l * h))) * -d 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 <= -6e-199) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (d <= 4.3e-128) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 <= -6e-199)
tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
elseif (d <= 4.3e-128)
tmp = sqrt((1.0 / (l * h))) * -d;
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, -6e-199], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.3e-128], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $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 -6 \cdot 10^{-199}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;d \leq 4.3 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -5.99999999999999966e-199Initial program 80.1%
Applied rewrites85.2%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6457.2
Applied rewrites57.2%
if -5.99999999999999966e-199 < d < 4.29999999999999994e-128Initial program 40.1%
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-*.f6434.4
Applied rewrites34.4%
if 4.29999999999999994e-128 < d Initial program 69.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.5
Applied rewrites53.5%
Applied rewrites53.6%
Applied rewrites58.9%
Final simplification52.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 (<= d -5.1e-54)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(if (<= d 4.3e-128)
(* (sqrt (/ 1.0 (* l h))) (- d))
(/ 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 <= -5.1e-54) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else if (d <= 4.3e-128) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 <= (-5.1d-54)) then
tmp = sqrt((d / l)) / sqrt((h / d))
else if (d <= 4.3d-128) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 <= -5.1e-54) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else if (d <= 4.3e-128) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} 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 <= -5.1e-54: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) elif d <= 4.3e-128: tmp = math.sqrt((1.0 / (l * h))) * -d 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 <= -5.1e-54) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); elseif (d <= 4.3e-128) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 <= -5.1e-54)
tmp = sqrt((d / l)) / sqrt((h / d));
elseif (d <= 4.3e-128)
tmp = sqrt((1.0 / (l * h))) * -d;
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, -5.1e-54], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.3e-128], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $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 -5.1 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{elif}\;d \leq 4.3 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -5.1000000000000001e-54Initial program 87.0%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f647.1
Applied rewrites7.1%
Applied rewrites61.9%
if -5.1000000000000001e-54 < d < 4.29999999999999994e-128Initial program 46.3%
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-*.f6432.0
Applied rewrites32.0%
if 4.29999999999999994e-128 < d Initial program 69.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.5
Applied rewrites53.5%
Applied rewrites53.6%
Applied rewrites58.9%
Final simplification50.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
(if (<= d -5.1e-54)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= d 4.3e-128)
(* (sqrt (/ 1.0 (* l h))) (- d))
(/ 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 <= -5.1e-54) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (d <= 4.3e-128) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 <= (-5.1d-54)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (d <= 4.3d-128) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 <= -5.1e-54) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (d <= 4.3e-128) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} 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 <= -5.1e-54: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif d <= 4.3e-128: tmp = math.sqrt((1.0 / (l * h))) * -d 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 <= -5.1e-54) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (d <= 4.3e-128) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 <= -5.1e-54)
tmp = sqrt((d / h)) * sqrt((d / l));
elseif (d <= 4.3e-128)
tmp = sqrt((1.0 / (l * h))) * -d;
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, -5.1e-54], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.3e-128], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $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 -5.1 \cdot 10^{-54}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq 4.3 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -5.1000000000000001e-54Initial program 87.0%
Applied rewrites87.0%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
if -5.1000000000000001e-54 < d < 4.29999999999999994e-128Initial program 46.3%
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-*.f6432.0
Applied rewrites32.0%
if 4.29999999999999994e-128 < d Initial program 69.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.5
Applied rewrites53.5%
Applied rewrites53.6%
Applied rewrites58.9%
Final simplification50.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
(if (<= l -3e+150)
(sqrt (* (/ d h) (/ d l)))
(if (<= l 6.3e-197)
(* (sqrt (/ 1.0 (* l h))) (- d))
(/ 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 <= -3e+150) {
tmp = sqrt(((d / h) * (d / l)));
} else if (l <= 6.3e-197) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 <= (-3d+150)) then
tmp = sqrt(((d / h) * (d / l)))
else if (l <= 6.3d-197) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 <= -3e+150) {
tmp = Math.sqrt(((d / h) * (d / l)));
} else if (l <= 6.3e-197) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} 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 <= -3e+150: tmp = math.sqrt(((d / h) * (d / l))) elif l <= 6.3e-197: tmp = math.sqrt((1.0 / (l * h))) * -d 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 <= -3e+150) tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); elseif (l <= 6.3e-197) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 <= -3e+150)
tmp = sqrt(((d / h) * (d / l)));
elseif (l <= 6.3e-197)
tmp = sqrt((1.0 / (l * h))) * -d;
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, -3e+150], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 6.3e-197], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $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 \cdot 10^{+150}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\mathbf{elif}\;\ell \leq 6.3 \cdot 10^{-197}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.00000000000000012e150Initial program 75.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f648.5
Applied rewrites8.5%
Applied rewrites65.0%
if -3.00000000000000012e150 < l < 6.2999999999999994e-197Initial program 72.3%
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-*.f6438.8
Applied rewrites38.8%
if 6.2999999999999994e-197 < l Initial program 57.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites49.9%
Applied rewrites53.5%
Final simplification48.7%
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 4.3e-128) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ 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 <= 4.3e-128) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 <= 4.3d-128) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 <= 4.3e-128) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} 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 <= 4.3e-128: tmp = math.sqrt((1.0 / (l * h))) * -d 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 <= 4.3e-128) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 <= 4.3e-128)
tmp = sqrt((1.0 / (l * h))) * -d;
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, 4.3e-128], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $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 4.3 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < 4.29999999999999994e-128Initial program 66.0%
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-*.f6437.0
Applied rewrites37.0%
if 4.29999999999999994e-128 < d Initial program 69.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.5
Applied rewrites53.5%
Applied rewrites53.6%
Applied rewrites58.9%
Final simplification44.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 (if (<= l 6.3e-197) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ 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) {
double tmp;
if (l <= 6.3e-197) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / sqrt((l * 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 <= 6.3d-197) then
tmp = sqrt((1.0d0 / (l * h))) * -d
else
tmp = d / sqrt((l * 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 <= 6.3e-197) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / Math.sqrt((l * 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 <= 6.3e-197: tmp = math.sqrt((1.0 / (l * h))) * -d else: tmp = d / math.sqrt((l * 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 <= 6.3e-197) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); else tmp = Float64(d / sqrt(Float64(l * 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 <= 6.3e-197)
tmp = sqrt((1.0 / (l * h))) * -d;
else
tmp = d / sqrt((l * 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, 6.3e-197], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.3 \cdot 10^{-197}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < 6.2999999999999994e-197Initial program 73.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-*.f6437.9
Applied rewrites37.9%
if 6.2999999999999994e-197 < l Initial program 57.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites49.9%
Final simplification42.7%
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 67.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6425.7
Applied rewrites25.7%
Applied rewrites25.7%
herbie shell --seed 2024268
(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)))))