
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* (* (/ D d) M) 0.5) l)))
(if (<= d -5e-311)
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (* (sqrt (- d)) (sqrt (/ -1.0 l))))
(- 1.0 (* t_0 (/ (* (* M (* 0.25 D)) h) d))))
(if (<= d 7.6e-44)
(/
(*
(/
(*
(fma (* 0.25 (pow (/ d (* M D)) -2.0)) (* (/ h l) -0.5) 1.0)
(sqrt d))
(sqrt h))
(sqrt d))
(sqrt l))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* t_0 (/ (* (* 0.5 (* D 0.5)) (/ M d)) (pow h -1.0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (((D / d) * M) * 0.5) / l;
double tmp;
if (d <= -5e-311) {
tmp = (pow((d / h), pow(2.0, -1.0)) * (sqrt(-d) * sqrt((-1.0 / l)))) * (1.0 - (t_0 * (((M * (0.25 * D)) * h) / d)));
} else if (d <= 7.6e-44) {
tmp = (((fma((0.25 * pow((d / (M * D)), -2.0)), ((h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l);
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - (t_0 * (((0.5 * (D * 0.5)) * (M / d)) / pow(h, -1.0))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(Float64(D / d) * M) * 0.5) / l) tmp = 0.0 if (d <= -5e-311) tmp = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * Float64(sqrt(Float64(-d)) * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(t_0 * Float64(Float64(Float64(M * Float64(0.25 * D)) * h) / d)))); elseif (d <= 7.6e-44) tmp = Float64(Float64(Float64(Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(t_0 * Float64(Float64(Float64(0.5 * Float64(D * 0.5)) * Float64(M / d)) / (h ^ -1.0))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * 0.5), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[d, -5e-311], N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(N[(N[(M * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.6e-44], N[(N[(N[(N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(N[(N[(0.5 * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\frac{D}{d} \cdot M\right) \cdot 0.5}{\ell}\\
\mathbf{if}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot \left(\sqrt{-d} \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - t\_0 \cdot \frac{\left(M \cdot \left(0.25 \cdot D\right)\right) \cdot h}{d}\right)\\
\mathbf{elif}\;d \leq 7.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{d}}{\sqrt{h}} \cdot \sqrt{d}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - t\_0 \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right)\\
\end{array}
\end{array}
if d < -5.00000000000023e-311Initial program 66.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites70.1%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.4
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval69.4
Applied rewrites69.4%
lift-/.f64N/A
metadata-eval69.4
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6469.4
Applied rewrites69.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
distribute-neg-frac2N/A
unpow-1N/A
lift-pow.f64N/A
lift-neg.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f6477.2
lift-neg.f64N/A
neg-mul-1N/A
lift-pow.f64N/A
unpow-1N/A
un-div-invN/A
lower-/.f6477.2
Applied rewrites77.2%
if -5.00000000000023e-311 < d < 7.6000000000000002e-44Initial program 60.7%
Applied rewrites65.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.8%
if 7.6000000000000002e-44 < d Initial program 80.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.9%
lift-/.f64N/A
metadata-eval87.9
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6494.0
Applied rewrites94.0%
Final simplification83.1%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
5e-228)
(* (sqrt (/ (pow h -1.0) l)) d)
(* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e-228) {
tmp = sqrt((pow(h, -1.0) / l)) * d;
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= 5d-228) then
tmp = sqrt(((h ** (-1.0d0)) / l)) * d
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e-228) {
tmp = Math.sqrt((Math.pow(h, -1.0) / l)) * d;
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e-228: tmp = math.sqrt((math.pow(h, -1.0) / l)) * d else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e-228) tmp = Float64(sqrt(Float64((h ^ -1.0) / l)) * d); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= 5e-228) tmp = sqrt(((h ^ -1.0) / l)) * d; else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], 5e-228], N[(N[Sqrt[N[(N[Power[h, -1.0], $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{-228}:\\
\;\;\;\;\sqrt{\frac{{h}^{-1}}{\ell}} \cdot d\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999972e-228Initial program 86.6%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6419.5
Applied rewrites19.5%
Applied rewrites19.5%
if 4.99999999999999972e-228 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 56.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6433.3
Applied rewrites33.3%
Applied rewrites61.8%
Final simplification43.8%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-5e-249)
(/ (/ (* (* (* (* (sqrt h) -0.125) M) (* M D)) (/ D l)) d) (sqrt l))
(* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = (((((sqrt(h) * -0.125) * M) * (M * D)) * (D / l)) / d) / sqrt(l);
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-5d-249)) then
tmp = (((((sqrt(h) * (-0.125d0)) * m) * (m * d_1)) * (d_1 / l)) / d) / sqrt(l)
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = (((((Math.sqrt(h) * -0.125) * M) * (M * D)) * (D / l)) / d) / Math.sqrt(l);
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249: tmp = (((((math.sqrt(h) * -0.125) * M) * (M * D)) * (D / l)) / d) / math.sqrt(l) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -5e-249) tmp = Float64(Float64(Float64(Float64(Float64(Float64(sqrt(h) * -0.125) * M) * Float64(M * D)) * Float64(D / l)) / d) / sqrt(l)); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -5e-249) tmp = (((((sqrt(h) * -0.125) * M) * (M * D)) * (D / l)) / d) / sqrt(l); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -5e-249], N[(N[(N[(N[(N[(N[(N[Sqrt[h], $MachinePrecision] * -0.125), $MachinePrecision] * M), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-249}:\\
\;\;\;\;\frac{\frac{\left(\left(\left(\sqrt{h} \cdot -0.125\right) \cdot M\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{D}{\ell}}{d}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.9999999999999999e-249Initial program 93.6%
Applied rewrites44.2%
Taylor expanded in d around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6441.1
Applied rewrites41.1%
Applied rewrites39.1%
Applied rewrites44.2%
if -4.9999999999999999e-249 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 56.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Applied rewrites60.5%
Final simplification54.6%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-5e-249)
(/ (/ (* (* (* (* (sqrt h) -0.125) M) (* M D)) D) (* l d)) (sqrt l))
(* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = (((((sqrt(h) * -0.125) * M) * (M * D)) * D) / (l * d)) / sqrt(l);
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-5d-249)) then
tmp = (((((sqrt(h) * (-0.125d0)) * m) * (m * d_1)) * d_1) / (l * d)) / sqrt(l)
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = (((((Math.sqrt(h) * -0.125) * M) * (M * D)) * D) / (l * d)) / Math.sqrt(l);
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249: tmp = (((((math.sqrt(h) * -0.125) * M) * (M * D)) * D) / (l * d)) / math.sqrt(l) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -5e-249) tmp = Float64(Float64(Float64(Float64(Float64(Float64(sqrt(h) * -0.125) * M) * Float64(M * D)) * D) / Float64(l * d)) / sqrt(l)); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -5e-249) tmp = (((((sqrt(h) * -0.125) * M) * (M * D)) * D) / (l * d)) / sqrt(l); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -5e-249], N[(N[(N[(N[(N[(N[(N[Sqrt[h], $MachinePrecision] * -0.125), $MachinePrecision] * M), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-249}:\\
\;\;\;\;\frac{\frac{\left(\left(\left(\sqrt{h} \cdot -0.125\right) \cdot M\right) \cdot \left(M \cdot D\right)\right) \cdot D}{\ell \cdot d}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.9999999999999999e-249Initial program 93.6%
Applied rewrites44.2%
Taylor expanded in d around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6441.1
Applied rewrites41.1%
Applied rewrites39.1%
Applied rewrites44.0%
if -4.9999999999999999e-249 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 56.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Applied rewrites60.5%
Final simplification54.6%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-5e-249)
(/ (* (* -0.125 (sqrt h)) (* (* (* M M) D) (/ D (* l d)))) (sqrt l))
(* (sqrt (/ d l)) (sqrt (/ d h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = ((-0.125 * sqrt(h)) * (((M * M) * D) * (D / (l * d)))) / sqrt(l);
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-5d-249)) then
tmp = (((-0.125d0) * sqrt(h)) * (((m * m) * d_1) * (d_1 / (l * d)))) / sqrt(l)
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249) {
tmp = ((-0.125 * Math.sqrt(h)) * (((M * M) * D) * (D / (l * d)))) / Math.sqrt(l);
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-249: tmp = ((-0.125 * math.sqrt(h)) * (((M * M) * D) * (D / (l * d)))) / math.sqrt(l) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -5e-249) tmp = Float64(Float64(Float64(-0.125 * sqrt(h)) * Float64(Float64(Float64(M * M) * D) * Float64(D / Float64(l * d)))) / sqrt(l)); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -5e-249) tmp = ((-0.125 * sqrt(h)) * (((M * M) * D) * (D / (l * d)))) / sqrt(l); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -5e-249], N[(N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * D), $MachinePrecision] * N[(D / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-249}:\\
\;\;\;\;\frac{\left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot \frac{D}{\ell \cdot d}\right)}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.9999999999999999e-249Initial program 93.6%
Applied rewrites44.2%
Taylor expanded in d around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6441.1
Applied rewrites41.1%
Applied rewrites39.1%
if -4.9999999999999999e-249 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 56.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Applied rewrites60.5%
Final simplification52.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d))))
(if (<= h -8.5e+128)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ d M) (/ 2.0 D)) -2.0) 1.0)
(sqrt (/ d l)))
t_0)
(sqrt (- h)))
(if (<= h -5e-310)
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (* t_0 (sqrt (/ -1.0 l))))
(- 1.0 (* (/ (* (* (/ D d) M) 0.5) l) (/ (* (* M (* 0.25 D)) h) d))))
(/
(*
(/
(*
(fma (* 0.25 (pow (/ d (* M D)) -2.0)) (* (/ h l) -0.5) 1.0)
(sqrt d))
(sqrt h))
(sqrt d))
(sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double tmp;
if (h <= -8.5e+128) {
tmp = ((fma((-0.5 * (h / l)), pow(((d / M) * (2.0 / D)), -2.0), 1.0) * sqrt((d / l))) * t_0) / sqrt(-h);
} else if (h <= -5e-310) {
tmp = (pow((d / h), pow(2.0, -1.0)) * (t_0 * sqrt((-1.0 / l)))) * (1.0 - (((((D / d) * M) * 0.5) / l) * (((M * (0.25 * D)) * h) / d)));
} else {
tmp = (((fma((0.25 * pow((d / (M * D)), -2.0)), ((h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -8.5e+128) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M) * Float64(2.0 / D)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * t_0) / sqrt(Float64(-h))); elseif (h <= -5e-310) tmp = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * Float64(t_0 * sqrt(Float64(-1.0 / l)))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(D / d) * M) * 0.5) / l) * Float64(Float64(Float64(M * Float64(0.25 * D)) * h) / d)))); else tmp = Float64(Float64(Float64(Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -8.5e+128], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] * N[(2.0 / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;h \leq -8.5 \cdot 10^{+128}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0}{\sqrt{-h}}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot \left(t\_0 \cdot \sqrt{\frac{-1}{\ell}}\right)\right) \cdot \left(1 - \frac{\left(\frac{D}{d} \cdot M\right) \cdot 0.5}{\ell} \cdot \frac{\left(M \cdot \left(0.25 \cdot D\right)\right) \cdot h}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{d}}{\sqrt{h}} \cdot \sqrt{d}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if h < -8.50000000000000045e128Initial program 58.3%
Applied rewrites71.9%
if -8.50000000000000045e128 < h < -4.999999999999985e-310Initial program 70.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites75.1%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.1
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval75.1
Applied rewrites75.1%
lift-/.f64N/A
metadata-eval75.1
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.1
Applied rewrites75.1%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
distribute-neg-frac2N/A
unpow-1N/A
lift-pow.f64N/A
lift-neg.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f6483.3
lift-neg.f64N/A
neg-mul-1N/A
lift-pow.f64N/A
unpow-1N/A
un-div-invN/A
lower-/.f6483.3
Applied rewrites83.3%
if -4.999999999999985e-310 < h Initial program 72.1%
Applied rewrites73.7%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites83.7%
Final simplification81.8%
(FPCore (d h l M D)
:precision binary64
(if (<= d -5e-311)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ d M) (/ 2.0 D)) -2.0) 1.0)
(sqrt (/ d l)))
(sqrt (- d)))
(sqrt (- h)))
(if (<= d 7.6e-44)
(/
(*
(/
(*
(fma (* 0.25 (pow (/ d (* M D)) -2.0)) (* (/ h l) -0.5) 1.0)
(sqrt d))
(sqrt h))
(sqrt d))
(sqrt l))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (/ (* (* (/ D d) M) 0.5) l) (/ (* (* M (* 0.25 D)) h) d)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -5e-311) {
tmp = ((fma((-0.5 * (h / l)), pow(((d / M) * (2.0 / D)), -2.0), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
} else if (d <= 7.6e-44) {
tmp = (((fma((0.25 * pow((d / (M * D)), -2.0)), ((h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l);
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - (((((D / d) * M) * 0.5) / l) * (((M * (0.25 * D)) * h) / d)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -5e-311) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M) * Float64(2.0 / D)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h))); elseif (d <= 7.6e-44) tmp = Float64(Float64(Float64(Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(D / d) * M) * 0.5) / l) * Float64(Float64(Float64(M * Float64(0.25 * D)) * h) / d)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] * N[(2.0 / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.6e-44], N[(N[(N[(N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;d \leq 7.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{d}}{\sqrt{h}} \cdot \sqrt{d}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \frac{\left(\frac{D}{d} \cdot M\right) \cdot 0.5}{\ell} \cdot \frac{\left(M \cdot \left(0.25 \cdot D\right)\right) \cdot h}{d}\right)\\
\end{array}
\end{array}
if d < -5.00000000000023e-311Initial program 66.8%
Applied rewrites74.7%
if -5.00000000000023e-311 < d < 7.6000000000000002e-44Initial program 60.7%
Applied rewrites65.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites81.8%
if 7.6000000000000002e-44 < d Initial program 80.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.9%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval85.7
Applied rewrites85.7%
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6491.7
Applied rewrites91.7%
Final simplification81.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-305)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ d M) (/ 2.0 D)) -2.0) 1.0)
(sqrt (/ d l)))
(sqrt (- d)))
(sqrt (- h)))
(/
(*
(/
(* (fma (* 0.25 (pow (/ d (* M D)) -2.0)) (* (/ h l) -0.5) 1.0) (sqrt d))
(sqrt h))
(sqrt d))
(sqrt l))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-305) {
tmp = ((fma((-0.5 * (h / l)), pow(((d / M) * (2.0 / D)), -2.0), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
} else {
tmp = (((fma((0.25 * pow((d / (M * D)), -2.0)), ((h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e-305) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M) * Float64(2.0 / D)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h))); else tmp = Float64(Float64(Float64(Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(d)) / sqrt(h)) * sqrt(d)) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-305], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] * N[(2.0 / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-305}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{d}}{\sqrt{h}} \cdot \sqrt{d}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -6.0000000000000002e-305Initial program 67.4%
Applied rewrites75.3%
if -6.0000000000000002e-305 < l Initial program 71.5%
Applied rewrites73.2%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites83.0%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-305)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ d M) (/ 2.0 D)) -2.0) 1.0)
(sqrt (/ d l)))
(sqrt (- d)))
(sqrt (- h)))
(/
(/
(* (fma (* (* (/ h l) -0.5) 0.25) (pow (/ (/ d M) D) -2.0) 1.0) d)
(sqrt l))
(sqrt h))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-305) {
tmp = ((fma((-0.5 * (h / l)), pow(((d / M) * (2.0 / D)), -2.0), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
} else {
tmp = ((fma((((h / l) * -0.5) * 0.25), pow(((d / M) / D), -2.0), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e-305) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M) * Float64(2.0 / D)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(Float64(h / l) * -0.5) * 0.25), (Float64(Float64(d / M) / D) ^ -2.0), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-305], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] * N[(2.0 / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * 0.25), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-305}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot 0.25, {\left(\frac{\frac{d}{M}}{D}\right)}^{-2}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6.0000000000000002e-305Initial program 67.4%
Applied rewrites75.3%
if -6.0000000000000002e-305 < l Initial program 71.5%
Applied rewrites73.2%
Applied rewrites68.5%
Applied rewrites80.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-305)
(/
(*
(*
(fma (* -0.5 (/ h l)) (pow (* (/ d M) (/ 2.0 D)) -2.0) 1.0)
(sqrt (/ d h)))
(sqrt (- d)))
(sqrt (- l)))
(/
(/
(* (fma (* (* (/ h l) -0.5) 0.25) (pow (/ (/ d M) D) -2.0) 1.0) d)
(sqrt l))
(sqrt h))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-305) {
tmp = ((fma((-0.5 * (h / l)), pow(((d / M) * (2.0 / D)), -2.0), 1.0) * sqrt((d / h))) * sqrt(-d)) / sqrt(-l);
} else {
tmp = ((fma((((h / l) * -0.5) * 0.25), pow(((d / M) / D), -2.0), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e-305) tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M) * Float64(2.0 / D)) ^ -2.0), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(-d))) / sqrt(Float64(-l))); else tmp = Float64(Float64(Float64(fma(Float64(Float64(Float64(h / l) * -0.5) * 0.25), (Float64(Float64(d / M) / D) ^ -2.0), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-305], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] * N[(2.0 / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * 0.25), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-305}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot 0.25, {\left(\frac{\frac{d}{M}}{D}\right)}^{-2}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -6.0000000000000002e-305Initial program 67.4%
Applied rewrites73.0%
if -6.0000000000000002e-305 < l Initial program 71.5%
Applied rewrites73.2%
Applied rewrites68.5%
Applied rewrites80.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)))
(if (<= d -2.3e+55)
(*
(fma (* 0.25 (pow (/ d (* M D)) -2.0)) t_0 1.0)
(/ (sqrt (- d)) (sqrt (* (- h) (/ l d)))))
(if (<= d -6.4e-90)
(*
(*
(sqrt (/ d l))
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0))
(sqrt (/ d h)))
(if (<= d -5e-311)
(/
(/
(fma
(* (* (* M M) -0.125) (* D D))
(/ (/ h l) (sqrt (/ l h)))
(* (sqrt (/ h l)) (* d d)))
h)
d)
(/
(/ (* (fma (* t_0 0.25) (pow (/ (/ d M) D) -2.0) 1.0) d) (sqrt l))
(sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double tmp;
if (d <= -2.3e+55) {
tmp = fma((0.25 * pow((d / (M * D)), -2.0)), t_0, 1.0) * (sqrt(-d) / sqrt((-h * (l / d))));
} else if (d <= -6.4e-90) {
tmp = (sqrt((d / l)) * fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0)) * sqrt((d / h));
} else if (d <= -5e-311) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * (d * d))) / h) / d;
} else {
tmp = ((fma((t_0 * 0.25), pow(((d / M) / D), -2.0), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) tmp = 0.0 if (d <= -2.3e+55) tmp = Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), t_0, 1.0) * Float64(sqrt(Float64(-d)) / sqrt(Float64(Float64(-h) * Float64(l / d))))); elseif (d <= -6.4e-90) tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0)) * sqrt(Float64(d / h))); elseif (d <= -5e-311) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * Float64(d * d))) / h) / d); else tmp = Float64(Float64(Float64(fma(Float64(t_0 * 0.25), (Float64(Float64(d / M) / D) ^ -2.0), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[d, -2.3e+55], N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[N[((-h) * N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.4e-90], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(N[(N[(t$95$0 * 0.25), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, t\_0, 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{\left(-h\right) \cdot \frac{\ell}{d}}}\\
\mathbf{elif}\;d \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(t\_0 \cdot 0.25, {\left(\frac{\frac{d}{M}}{D}\right)}^{-2}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -2.29999999999999987e55Initial program 76.3%
Applied rewrites0.0%
Applied rewrites0.8%
lift-/.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
frac-2negN/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6486.7
Applied rewrites86.7%
if -2.29999999999999987e55 < d < -6.40000000000000014e-90Initial program 84.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites93.4%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.4
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval93.4
Applied rewrites93.4%
lift-/.f64N/A
metadata-eval93.4
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6493.4
Applied rewrites93.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.4%
if -6.40000000000000014e-90 < d < -5.00000000000023e-311Initial program 45.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in h around 0
Applied rewrites47.7%
Applied rewrites56.2%
if -5.00000000000023e-311 < d Initial program 72.1%
Applied rewrites73.7%
Applied rewrites69.0%
Applied rewrites81.0%
Final simplification79.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(*
(sqrt (/ d l))
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0))
(sqrt (/ d h)))))
(if (<= d -6.4e-90)
t_0
(if (<= d -5e-311)
(/
(/
(fma
(* (* (* M M) -0.125) (* D D))
(/ (/ h l) (sqrt (/ l h)))
(* (sqrt (/ h l)) (* d d)))
h)
d)
(if (<= d 1.45e-42)
(/
(fma
(* (* D D) (* (/ (/ (* M M) d) l) -0.125))
(sqrt h)
(* (sqrt (pow h -1.0)) d))
(sqrt l))
t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / l)) * fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0)) * sqrt((d / h));
double tmp;
if (d <= -6.4e-90) {
tmp = t_0;
} else if (d <= -5e-311) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * (d * d))) / h) / d;
} else if (d <= 1.45e-42) {
tmp = fma(((D * D) * ((((M * M) / d) / l) * -0.125)), sqrt(h), (sqrt(pow(h, -1.0)) * d)) / sqrt(l);
} else {
tmp = t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0)) * sqrt(Float64(d / h))) tmp = 0.0 if (d <= -6.4e-90) tmp = t_0; elseif (d <= -5e-311) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * Float64(d * d))) / h) / d); elseif (d <= 1.45e-42) tmp = Float64(fma(Float64(Float64(D * D) * Float64(Float64(Float64(Float64(M * M) / d) / l) * -0.125)), sqrt(h), Float64(sqrt((h ^ -1.0)) * d)) / sqrt(l)); else tmp = t_0; end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.4e-90], t$95$0, If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 1.45e-42], N[(N[(N[(N[(D * D), $MachinePrecision] * N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[h], $MachinePrecision] + N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\frac{\frac{M \cdot M}{d}}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -6.40000000000000014e-90 or 1.4500000000000001e-42 < d Initial program 80.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.0%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval84.7
Applied rewrites84.7%
lift-/.f64N/A
metadata-eval84.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6484.6
Applied rewrites84.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.6%
if -6.40000000000000014e-90 < d < -5.00000000000023e-311Initial program 45.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in h around 0
Applied rewrites47.7%
Applied rewrites56.2%
if -5.00000000000023e-311 < d < 1.4500000000000001e-42Initial program 59.7%
Applied rewrites64.5%
Taylor expanded in l around inf
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites70.1%
Final simplification76.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(*
(sqrt (/ d l))
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0))
(sqrt (/ d h))))
(t_1 (sqrt (/ h l))))
(if (<= d -6.4e-90)
t_0
(if (<= d -5e-311)
(/
(/
(fma (* (* (* M M) -0.125) (* D D)) (* (/ h l) t_1) (* t_1 (* d d)))
h)
d)
(if (<= d 1.45e-42)
(/
(fma
(* (* D D) (* (/ (/ (* M M) d) l) -0.125))
(sqrt h)
(* (sqrt (pow h -1.0)) d))
(sqrt l))
t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (sqrt((d / l)) * fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0)) * sqrt((d / h));
double t_1 = sqrt((h / l));
double tmp;
if (d <= -6.4e-90) {
tmp = t_0;
} else if (d <= -5e-311) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) * t_1), (t_1 * (d * d))) / h) / d;
} else if (d <= 1.45e-42) {
tmp = fma(((D * D) * ((((M * M) / d) / l) * -0.125)), sqrt(h), (sqrt(pow(h, -1.0)) * d)) / sqrt(l);
} else {
tmp = t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0)) * sqrt(Float64(d / h))) t_1 = sqrt(Float64(h / l)) tmp = 0.0 if (d <= -6.4e-90) tmp = t_0; elseif (d <= -5e-311) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) * t_1), Float64(t_1 * Float64(d * d))) / h) / d); elseif (d <= 1.45e-42) tmp = Float64(fma(Float64(Float64(D * D) * Float64(Float64(Float64(Float64(M * M) / d) / l) * -0.125)), sqrt(h), Float64(sqrt((h ^ -1.0)) * d)) / sqrt(l)); else tmp = t_0; end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -6.4e-90], t$95$0, If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$1 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 1.45e-42], N[(N[(N[(N[(D * D), $MachinePrecision] * N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[h], $MachinePrecision] + N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;d \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{h}{\ell} \cdot t\_1, t\_1 \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\frac{\frac{M \cdot M}{d}}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -6.40000000000000014e-90 or 1.4500000000000001e-42 < d Initial program 80.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.0%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval84.7
Applied rewrites84.7%
lift-/.f64N/A
metadata-eval84.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6484.6
Applied rewrites84.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.6%
if -6.40000000000000014e-90 < d < -5.00000000000023e-311Initial program 45.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in h around 0
Applied rewrites47.7%
Applied rewrites56.2%
if -5.00000000000023e-311 < d < 1.4500000000000001e-42Initial program 59.7%
Applied rewrites64.5%
Taylor expanded in l around inf
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites70.1%
Final simplification76.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l))))
(if (<= d -1.6e+77)
(/ (sqrt (- d)) (sqrt (* (- h) (/ l d))))
(if (<= d -5e-311)
(/
(/
(fma (* (* (* M M) -0.125) (* D D)) (* (/ h l) t_0) (* t_0 (* d d)))
h)
d)
(if (<= d 3.5e-44)
(/
(fma
(* (* D D) (* (/ (/ (* M M) d) l) -0.125))
(sqrt h)
(* (sqrt (pow h -1.0)) d))
(sqrt l))
(*
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0)
(/ d (sqrt (* l h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
double tmp;
if (d <= -1.6e+77) {
tmp = sqrt(-d) / sqrt((-h * (l / d)));
} else if (d <= -5e-311) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) * t_0), (t_0 * (d * d))) / h) / d;
} else if (d <= 3.5e-44) {
tmp = fma(((D * D) * ((((M * M) / d) / l) * -0.125)), sqrt(h), (sqrt(pow(h, -1.0)) * d)) / sqrt(l);
} else {
tmp = fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0) * (d / sqrt((l * h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) tmp = 0.0 if (d <= -1.6e+77) tmp = Float64(sqrt(Float64(-d)) / sqrt(Float64(Float64(-h) * Float64(l / d)))); elseif (d <= -5e-311) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) * t_0), Float64(t_0 * Float64(d * d))) / h) / d); elseif (d <= 3.5e-44) tmp = Float64(fma(Float64(Float64(D * D) * Float64(Float64(Float64(Float64(M * M) / d) / l) * -0.125)), sqrt(h), Float64(sqrt((h ^ -1.0)) * d)) / sqrt(l)); else tmp = Float64(fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.6e+77], N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[N[((-h) * N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 3.5e-44], N[(N[(N[(N[(D * D), $MachinePrecision] * N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[h], $MachinePrecision] + N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;d \leq -1.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\left(-h\right) \cdot \frac{\ell}{d}}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{h}{\ell} \cdot t\_0, t\_0 \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{elif}\;d \leq 3.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\frac{\frac{M \cdot M}{d}}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.6000000000000001e77Initial program 76.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f644.4
Applied rewrites4.4%
Applied rewrites69.4%
if -1.6000000000000001e77 < d < -5.00000000000023e-311Initial program 61.9%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites2.1%
Taylor expanded in h around 0
Applied rewrites47.2%
Applied rewrites56.7%
if -5.00000000000023e-311 < d < 3.4999999999999998e-44Initial program 60.7%
Applied rewrites65.6%
Taylor expanded in l around inf
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites69.6%
if 3.4999999999999998e-44 < d Initial program 80.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.9%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval85.7
Applied rewrites85.7%
lift-/.f64N/A
metadata-eval85.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6485.6
Applied rewrites85.6%
Applied rewrites83.0%
Final simplification69.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.4e-90)
(*
(*
(sqrt (/ d l))
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0))
(sqrt (/ d h)))
(if (<= d -5e-311)
(/
(/
(fma
(* (* (* M M) -0.125) (* D D))
(/ (/ h l) (sqrt (/ l h)))
(* (sqrt (/ h l)) (* d d)))
h)
d)
(/
(/
(* (fma (* (* (/ h l) -0.5) 0.25) (pow (/ (/ d M) D) -2.0) 1.0) d)
(sqrt l))
(sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.4e-90) {
tmp = (sqrt((d / l)) * fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0)) * sqrt((d / h));
} else if (d <= -5e-311) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * (d * d))) / h) / d;
} else {
tmp = ((fma((((h / l) * -0.5) * 0.25), pow(((d / M) / D), -2.0), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.4e-90) tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0)) * sqrt(Float64(d / h))); elseif (d <= -5e-311) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * Float64(d * d))) / h) / d); else tmp = Float64(Float64(Float64(fma(Float64(Float64(Float64(h / l) * -0.5) * 0.25), (Float64(Float64(d / M) / D) ^ -2.0), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.4e-90], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-311], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * 0.25), $MachinePrecision] * N[Power[N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot 0.25, {\left(\frac{\frac{d}{M}}{D}\right)}^{-2}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if d < -6.40000000000000014e-90Initial program 79.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites85.1%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval82.7
Applied rewrites82.7%
lift-/.f64N/A
metadata-eval82.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6482.7
Applied rewrites82.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.7%
if -6.40000000000000014e-90 < d < -5.00000000000023e-311Initial program 45.0%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites2.7%
Taylor expanded in h around 0
Applied rewrites47.7%
Applied rewrites56.2%
if -5.00000000000023e-311 < d Initial program 72.1%
Applied rewrites73.7%
Applied rewrites69.0%
Applied rewrites81.0%
(FPCore (d h l M D)
:precision binary64
(if (<= d -6.4e-90)
(*
(*
(sqrt (/ d l))
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0))
(sqrt (/ d h)))
(if (<= d 4.1e-279)
(/
(/
(fma
(* (* (* M M) -0.125) (* D D))
(/ (/ h l) (sqrt (/ l h)))
(* (sqrt (/ h l)) (* d d)))
h)
d)
(/
(*
(fma (* 0.25 (pow (/ d (* M D)) -2.0)) (* (/ h l) -0.5) 1.0)
(/ d (sqrt h)))
(sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -6.4e-90) {
tmp = (sqrt((d / l)) * fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0)) * sqrt((d / h));
} else if (d <= 4.1e-279) {
tmp = (fma((((M * M) * -0.125) * (D * D)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * (d * d))) / h) / d;
} else {
tmp = (fma((0.25 * pow((d / (M * D)), -2.0)), ((h / l) * -0.5), 1.0) * (d / sqrt(h))) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -6.4e-90) tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0)) * sqrt(Float64(d / h))); elseif (d <= 4.1e-279) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * M) * -0.125) * Float64(D * D)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * Float64(d * d))) / h) / d); else tmp = Float64(Float64(fma(Float64(0.25 * (Float64(d / Float64(M * D)) ^ -2.0)), Float64(Float64(h / l) * -0.5), 1.0) * Float64(d / sqrt(h))) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.4e-90], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.1e-279], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / d), $MachinePrecision], N[(N[(N[(N[(0.25 * N[Power[N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.4 \cdot 10^{-90}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq 4.1 \cdot 10^{-279}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(D \cdot D\right), \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot \left(d \cdot d\right)\right)}{h}}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.25 \cdot {\left(\frac{d}{M \cdot D}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.40000000000000014e-90Initial program 79.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites85.1%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.7
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval82.7
Applied rewrites82.7%
lift-/.f64N/A
metadata-eval82.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6482.7
Applied rewrites82.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.7%
if -6.40000000000000014e-90 < d < 4.10000000000000017e-279Initial program 44.3%
Taylor expanded in d around 0
lower-/.f64N/A
Applied rewrites5.8%
Taylor expanded in h around 0
Applied rewrites49.0%
Applied rewrites57.1%
if 4.10000000000000017e-279 < d Initial program 72.8%
Applied rewrites74.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites82.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.45e-277) (* (- d) (sqrt (pow (* l h) -1.0))) (* (pow (* (sqrt l) (sqrt h)) -1.0) d)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.45e-277) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.45d-277) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = ((sqrt(l) * sqrt(h)) ** (-1.0d0)) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.45e-277) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = Math.pow((Math.sqrt(l) * Math.sqrt(h)), -1.0) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.45e-277: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = math.pow((math.sqrt(l) * math.sqrt(h)), -1.0) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.45e-277) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.45e-277) tmp = -d * sqrt(((l * h) ^ -1.0)); else tmp = ((sqrt(l) * sqrt(h)) ^ -1.0) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.45e-277], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.45 \cdot 10^{-277}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
\end{array}
\end{array}
if l < 1.44999999999999989e-277Initial program 68.6%
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.8
Applied rewrites32.8%
if 1.44999999999999989e-277 < l Initial program 70.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites46.5%
Applied rewrites53.3%
Final simplification42.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.1e-232)
(/ (sqrt (- d)) (sqrt (* (- h) (/ l d))))
(if (<= l 1.45e-277)
(* (- d) (sqrt (pow (* l h) -1.0)))
(* (/ (sqrt (/ -1.0 (- l))) (sqrt h)) d))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.1e-232) {
tmp = sqrt(-d) / sqrt((-h * (l / d)));
} else if (l <= 1.45e-277) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = (sqrt((-1.0 / -l)) / sqrt(h)) * d;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-2.1d-232)) then
tmp = sqrt(-d) / sqrt((-h * (l / d)))
else if (l <= 1.45d-277) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = (sqrt(((-1.0d0) / -l)) / sqrt(h)) * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.1e-232) {
tmp = Math.sqrt(-d) / Math.sqrt((-h * (l / d)));
} else if (l <= 1.45e-277) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = (Math.sqrt((-1.0 / -l)) / Math.sqrt(h)) * d;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.1e-232: tmp = math.sqrt(-d) / math.sqrt((-h * (l / d))) elif l <= 1.45e-277: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = (math.sqrt((-1.0 / -l)) / math.sqrt(h)) * d return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.1e-232) tmp = Float64(sqrt(Float64(-d)) / sqrt(Float64(Float64(-h) * Float64(l / d)))); elseif (l <= 1.45e-277) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(Float64(sqrt(Float64(-1.0 / Float64(-l))) / sqrt(h)) * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.1e-232) tmp = sqrt(-d) / sqrt((-h * (l / d))); elseif (l <= 1.45e-277) tmp = -d * sqrt(((l * h) ^ -1.0)); else tmp = (sqrt((-1.0 / -l)) / sqrt(h)) * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.1e-232], N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[N[((-h) * N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e-277], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(-1.0 / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.1 \cdot 10^{-232}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\left(-h\right) \cdot \frac{\ell}{d}}}\\
\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{-277}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{-1}{-\ell}}}{\sqrt{h}} \cdot d\\
\end{array}
\end{array}
if l < -2.1e-232Initial program 67.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f648.7
Applied rewrites8.7%
Applied rewrites35.8%
if -2.1e-232 < l < 1.44999999999999989e-277Initial program 75.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-*.f6450.4
Applied rewrites50.4%
if 1.44999999999999989e-277 < l Initial program 70.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites46.5%
Applied rewrites53.3%
Final simplification45.4%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.45e-277) (* (- d) (sqrt (pow (* l h) -1.0))) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.45e-277) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 1.45d-277) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.45e-277) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.45e-277: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.45e-277) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 1.45e-277) tmp = -d * sqrt(((l * h) ^ -1.0)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.45e-277], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.45 \cdot 10^{-277}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 1.44999999999999989e-277Initial program 68.6%
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.8
Applied rewrites32.8%
if 1.44999999999999989e-277 < l Initial program 70.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites46.4%
Applied rewrites53.3%
Final simplification42.6%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (pow (* l h) -1.0)))) (if (<= l 1.5e-277) (* (- d) t_0) (* t_0 d))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(pow((l * h), -1.0));
double tmp;
if (l <= 1.5e-277) {
tmp = -d * t_0;
} else {
tmp = t_0 * d;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(((l * h) ** (-1.0d0)))
if (l <= 1.5d-277) then
tmp = -d * t_0
else
tmp = t_0 * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(Math.pow((l * h), -1.0));
double tmp;
if (l <= 1.5e-277) {
tmp = -d * t_0;
} else {
tmp = t_0 * d;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(math.pow((l * h), -1.0)) tmp = 0 if l <= 1.5e-277: tmp = -d * t_0 else: tmp = t_0 * d return tmp
function code(d, h, l, M, D) t_0 = sqrt((Float64(l * h) ^ -1.0)) tmp = 0.0 if (l <= 1.5e-277) tmp = Float64(Float64(-d) * t_0); else tmp = Float64(t_0 * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(((l * h) ^ -1.0)); tmp = 0.0; if (l <= 1.5e-277) tmp = -d * t_0; else tmp = t_0 * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 1.5e-277], N[((-d) * t$95$0), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{if}\;\ell \leq 1.5 \cdot 10^{-277}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot d\\
\end{array}
\end{array}
if l < 1.49999999999999989e-277Initial program 68.6%
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.8
Applied rewrites32.8%
if 1.49999999999999989e-277 < l Initial program 70.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites46.5%
Final simplification39.4%
(FPCore (d h l M D) :precision binary64 (* (sqrt (pow (* l h) -1.0)) d))
double code(double d, double h, double l, double M, double D) {
return sqrt(pow((l * h), -1.0)) * d;
}
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 = sqrt(((l * h) ** (-1.0d0))) * d
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt(Math.pow((l * h), -1.0)) * d;
}
def code(d, h, l, M, D): return math.sqrt(math.pow((l * h), -1.0)) * d
function code(d, h, l, M, D) return Float64(sqrt((Float64(l * h) ^ -1.0)) * d) end
function tmp = code(d, h, l, M, D) tmp = sqrt(((l * h) ^ -1.0)) * d; end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
\end{array}
Initial program 69.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6427.4
Applied rewrites27.4%
Final simplification27.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6e-305)
(/ (sqrt (- d)) (sqrt (* (- h) (/ l d))))
(if (<= l 7.6e+117)
(*
(fma (/ (* -0.5 (* M (/ D d))) l) (/ (* (* (* 0.25 D) M) h) d) 1.0)
(/ d (sqrt (* l h))))
(if (<= l 1.8e+237)
(/ (/ (* (* (* (* (sqrt h) -0.125) M) (* M D)) D) (* l d)) (sqrt l))
(/ (/ d (sqrt h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6e-305) {
tmp = sqrt(-d) / sqrt((-h * (l / d)));
} else if (l <= 7.6e+117) {
tmp = fma(((-0.5 * (M * (D / d))) / l), ((((0.25 * D) * M) * h) / d), 1.0) * (d / sqrt((l * h)));
} else if (l <= 1.8e+237) {
tmp = (((((sqrt(h) * -0.125) * M) * (M * D)) * D) / (l * d)) / sqrt(l);
} else {
tmp = (d / sqrt(h)) / sqrt(l);
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6e-305) tmp = Float64(sqrt(Float64(-d)) / sqrt(Float64(Float64(-h) * Float64(l / d)))); elseif (l <= 7.6e+117) tmp = Float64(fma(Float64(Float64(-0.5 * Float64(M * Float64(D / d))) / l), Float64(Float64(Float64(Float64(0.25 * D) * M) * h) / d), 1.0) * Float64(d / sqrt(Float64(l * h)))); elseif (l <= 1.8e+237) tmp = Float64(Float64(Float64(Float64(Float64(Float64(sqrt(h) * -0.125) * M) * Float64(M * D)) * D) / Float64(l * d)) / sqrt(l)); else tmp = Float64(Float64(d / sqrt(h)) / sqrt(l)); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6e-305], N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[N[((-h) * N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7.6e+117], N[(N[(N[(N[(-0.5 * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(0.25 * D), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.8e+237], N[(N[(N[(N[(N[(N[(N[Sqrt[h], $MachinePrecision] * -0.125), $MachinePrecision] * M), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{-305}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{\left(-h\right) \cdot \frac{\ell}{d}}}\\
\mathbf{elif}\;\ell \leq 7.6 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.5 \cdot \left(M \cdot \frac{D}{d}\right)}{\ell}, \frac{\left(\left(0.25 \cdot D\right) \cdot M\right) \cdot h}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq 1.8 \cdot 10^{+237}:\\
\;\;\;\;\frac{\frac{\left(\left(\left(\sqrt{h} \cdot -0.125\right) \cdot M\right) \cdot \left(M \cdot D\right)\right) \cdot D}{\ell \cdot d}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -6.0000000000000002e-305Initial program 67.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f649.6
Applied rewrites9.6%
Applied rewrites35.7%
if -6.0000000000000002e-305 < l < 7.6000000000000003e117Initial program 80.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites83.9%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.0
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval82.0
Applied rewrites82.0%
lift-/.f64N/A
metadata-eval82.0
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6482.0
Applied rewrites82.0%
Applied rewrites86.1%
if 7.6000000000000003e117 < l < 1.80000000000000007e237Initial program 45.6%
Applied rewrites51.3%
Taylor expanded in d around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
Applied rewrites37.9%
Applied rewrites62.1%
if 1.80000000000000007e237 < l Initial program 60.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.2
Applied rewrites64.2%
Applied rewrites79.4%
Final simplification58.8%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 69.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6427.4
Applied rewrites27.4%
Applied rewrites27.1%
herbie shell --seed 2024320
(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)))))