
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -2e-285)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-316)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 5e+262)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -2e-285) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-285) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -2e-285: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-316: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 5e+262: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-285) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-316) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 5e+262) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -2e-285)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-316)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 5e+262)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-285], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-316], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+262], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-285}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-316}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 52.1%
associate-/r*68.3%
div-inv68.3%
div-inv68.3%
associate-*l*58.5%
Applied egg-rr58.5%
*-commutative58.5%
associate-*r*68.2%
div-inv68.3%
div-inv68.3%
frac-2neg68.3%
sqrt-div41.7%
distribute-neg-frac241.7%
Applied egg-rr41.7%
distribute-frac-neg241.7%
distribute-frac-neg41.7%
Simplified41.7%
if -inf.0 < (*.f64 V l) < -2.00000000000000015e-285Initial program 88.5%
frac-2neg88.5%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.00000000000000015e-285 < (*.f64 V l) < 9.999999837e-317Initial program 52.6%
associate-/r*72.5%
div-inv72.4%
div-inv72.5%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt29.8%
sqrt-unprod26.7%
swap-sqr26.3%
add-sqr-sqrt26.3%
frac-times26.3%
metadata-eval26.3%
div-inv26.3%
clear-num26.3%
associate-*r/30.4%
metadata-eval30.4%
add-sqr-sqrt30.4%
frac-times30.4%
swap-sqr33.8%
sqrt-unprod40.0%
Applied egg-rr72.6%
if 9.999999837e-317 < (*.f64 V l) < 5.00000000000000008e262Initial program 79.2%
sqrt-div99.2%
associate-*r/96.5%
Applied egg-rr96.5%
associate-/l*99.2%
Simplified99.2%
if 5.00000000000000008e262 < (*.f64 V l) Initial program 45.9%
associate-/r*79.7%
div-inv79.7%
div-inv79.8%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt45.5%
sqrt-unprod40.9%
swap-sqr34.7%
add-sqr-sqrt34.7%
frac-times34.8%
metadata-eval34.8%
div-inv34.7%
clear-num34.7%
associate-*r/34.9%
metadata-eval34.9%
add-sqr-sqrt34.9%
frac-times34.9%
swap-sqr40.8%
sqrt-unprod48.0%
Applied egg-rr79.6%
*-commutative79.6%
associate-*l/45.9%
associate-/l*79.8%
Simplified79.8%
clear-num79.8%
div-inv79.8%
Applied egg-rr79.8%
Final simplification92.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+251)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+251)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+251))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+251)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+251): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+251)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+251)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+251]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+251}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.0000000000000002e251 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.1%
*-commutative65.1%
associate-/l/68.1%
Simplified68.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000002e251Initial program 99.5%
Final simplification78.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-311) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l)) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-311) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-311)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0) / sqrt(l)
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-311) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-311: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / math.sqrt(l) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-311) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-311)
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-311], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -9.99999999999948e-312Initial program 81.3%
*-commutative81.3%
associate-/r*74.0%
sqrt-div39.5%
associate-*l/38.2%
Applied egg-rr38.2%
frac-2neg38.2%
sqrt-div46.2%
Applied egg-rr46.2%
if -9.99999999999948e-312 < A Initial program 70.8%
sqrt-div85.6%
associate-*r/83.6%
Applied egg-rr83.6%
associate-/l*85.6%
Simplified85.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e-285)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-316)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 5e+262)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-285) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d-285)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 1d-316) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 5d+262) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-285) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e-285: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-316: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 5e+262: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-285) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-316) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 5e+262) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e-285)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-316)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 5e+262)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e-285], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-316], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+262], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-285}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-316}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000015e-285Initial program 85.1%
frac-2neg85.1%
sqrt-div94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
Applied egg-rr94.9%
if -2.00000000000000015e-285 < (*.f64 V l) < 9.999999837e-317Initial program 52.6%
associate-/r*72.5%
div-inv72.4%
div-inv72.5%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt29.8%
sqrt-unprod26.7%
swap-sqr26.3%
add-sqr-sqrt26.3%
frac-times26.3%
metadata-eval26.3%
div-inv26.3%
clear-num26.3%
associate-*r/30.4%
metadata-eval30.4%
add-sqr-sqrt30.4%
frac-times30.4%
swap-sqr33.8%
sqrt-unprod40.0%
Applied egg-rr72.6%
if 9.999999837e-317 < (*.f64 V l) < 5.00000000000000008e262Initial program 79.2%
sqrt-div99.2%
associate-*r/96.5%
Applied egg-rr96.5%
associate-/l*99.2%
Simplified99.2%
if 5.00000000000000008e262 < (*.f64 V l) Initial program 45.9%
associate-/r*79.7%
div-inv79.7%
div-inv79.8%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt45.5%
sqrt-unprod40.9%
swap-sqr34.7%
add-sqr-sqrt34.7%
frac-times34.8%
metadata-eval34.8%
div-inv34.7%
clear-num34.7%
associate-*r/34.9%
metadata-eval34.9%
add-sqr-sqrt34.9%
frac-times34.9%
swap-sqr40.8%
sqrt-unprod48.0%
Applied egg-rr79.6%
*-commutative79.6%
associate-*l/45.9%
associate-/l*79.8%
Simplified79.8%
clear-num79.8%
div-inv79.8%
Applied egg-rr79.8%
Final simplification92.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-122)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+262)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-122) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+262) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-122)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+262) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-122) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+262) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-122: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+262: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-122) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+262) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-122)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+262)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-122], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+262], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-122}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e-122Initial program 87.5%
associate-/r*75.2%
div-inv75.2%
div-inv75.2%
associate-*l*88.3%
Applied egg-rr88.3%
if -4.9999999999999999e-122 < (*.f64 V l) < 0.0Initial program 65.1%
associate-/r*72.6%
div-inv72.6%
div-inv72.6%
associate-*l*64.0%
Applied egg-rr64.0%
frac-times64.1%
metadata-eval64.1%
div-inv65.1%
clear-num65.0%
associate-*r/70.9%
metadata-eval70.9%
add-sqr-sqrt70.9%
frac-times70.9%
sqrt-unprod70.9%
add-sqr-sqrt70.9%
inv-pow70.9%
sqrt-pow271.0%
associate-*r/65.0%
*-commutative65.0%
*-un-lft-identity65.0%
times-frac72.8%
/-rgt-identity72.8%
metadata-eval72.8%
Applied egg-rr72.8%
metadata-eval72.8%
pow-flip72.6%
pow1/272.6%
div-inv72.8%
sqrt-prod41.3%
associate-/r*39.8%
Applied egg-rr39.8%
associate-/r*41.3%
Simplified41.3%
if 0.0 < (*.f64 V l) < 5.00000000000000008e262Initial program 78.9%
sqrt-div98.7%
associate-*r/96.1%
Applied egg-rr96.1%
associate-/l*98.7%
Simplified98.7%
if 5.00000000000000008e262 < (*.f64 V l) Initial program 45.9%
associate-/r*79.7%
div-inv79.7%
div-inv79.8%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt45.5%
sqrt-unprod40.9%
swap-sqr34.7%
add-sqr-sqrt34.7%
frac-times34.8%
metadata-eval34.8%
div-inv34.7%
clear-num34.7%
associate-*r/34.9%
metadata-eval34.9%
add-sqr-sqrt34.9%
frac-times34.9%
swap-sqr40.8%
sqrt-unprod48.0%
Applied egg-rr79.6%
*-commutative79.6%
associate-*l/45.9%
associate-/l*79.8%
Simplified79.8%
clear-num79.8%
div-inv79.8%
Applied egg-rr79.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-124)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e+262)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-124) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e+262) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d-124)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d+262) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-124) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e+262) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-124: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e+262: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-124) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e+262) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-124)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e+262)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-124], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+262], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999933e-125Initial program 87.6%
associate-/r*75.5%
div-inv75.4%
div-inv75.4%
associate-*l*88.4%
Applied egg-rr88.4%
if -9.99999999999999933e-125 < (*.f64 V l) < 0.0Initial program 64.5%
associate-/r*72.2%
sqrt-div42.2%
associate-*r/42.2%
Applied egg-rr42.2%
associate-/l*42.2%
Simplified42.2%
if 0.0 < (*.f64 V l) < 5.00000000000000008e262Initial program 78.9%
sqrt-div98.7%
associate-*r/96.1%
Applied egg-rr96.1%
associate-/l*98.7%
Simplified98.7%
if 5.00000000000000008e262 < (*.f64 V l) Initial program 45.9%
associate-/r*79.7%
div-inv79.7%
div-inv79.8%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt45.5%
sqrt-unprod40.9%
swap-sqr34.7%
add-sqr-sqrt34.7%
frac-times34.8%
metadata-eval34.8%
div-inv34.7%
clear-num34.7%
associate-*r/34.9%
metadata-eval34.9%
add-sqr-sqrt34.9%
frac-times34.9%
swap-sqr40.8%
sqrt-unprod48.0%
Applied egg-rr79.6%
*-commutative79.6%
associate-*l/45.9%
associate-/l*79.8%
Simplified79.8%
clear-num79.8%
div-inv79.8%
Applied egg-rr79.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e-214)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 1e-316)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 5e+262)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-214) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d-214)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 1d-316) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 5d+262) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-214) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 1e-316) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 5e+262) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e-214: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 1e-316: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 5e+262: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-214) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 1e-316) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 5e+262) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e-214)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 1e-316)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 5e+262)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e-214], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-316], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+262], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-214}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-316}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999983e-214Initial program 86.6%
associate-/r*75.2%
div-inv75.1%
div-inv75.1%
associate-*l*87.3%
Applied egg-rr87.3%
if -1.99999999999999983e-214 < (*.f64 V l) < 9.999999837e-317Initial program 59.3%
associate-/r*72.5%
div-inv72.4%
div-inv72.5%
associate-*l*56.6%
Applied egg-rr56.6%
add-sqr-sqrt24.9%
sqrt-unprod21.0%
swap-sqr20.8%
add-sqr-sqrt20.8%
frac-times20.8%
metadata-eval20.8%
div-inv20.8%
clear-num20.8%
associate-*r/23.5%
metadata-eval23.5%
add-sqr-sqrt23.5%
frac-times23.4%
swap-sqr25.8%
sqrt-unprod31.8%
Applied egg-rr72.7%
if 9.999999837e-317 < (*.f64 V l) < 5.00000000000000008e262Initial program 79.2%
sqrt-div99.2%
associate-*r/96.5%
Applied egg-rr96.5%
associate-/l*99.2%
Simplified99.2%
if 5.00000000000000008e262 < (*.f64 V l) Initial program 45.9%
associate-/r*79.7%
div-inv79.7%
div-inv79.8%
associate-*l*48.8%
Applied egg-rr48.8%
add-sqr-sqrt45.5%
sqrt-unprod40.9%
swap-sqr34.7%
add-sqr-sqrt34.7%
frac-times34.8%
metadata-eval34.8%
div-inv34.7%
clear-num34.7%
associate-*r/34.9%
metadata-eval34.9%
add-sqr-sqrt34.9%
frac-times34.9%
swap-sqr40.8%
sqrt-unprod48.0%
Applied egg-rr79.6%
*-commutative79.6%
associate-*l/45.9%
associate-/l*79.8%
Simplified79.8%
clear-num79.8%
div-inv79.8%
Applied egg-rr79.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 2e-312) (not (<= t_0 1e+297)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-312) || !(t_0 <= 1e+297)) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 2d-312) .or. (.not. (t_0 <= 1d+297))) then
tmp = sqrt(((a / l) * (c0 * (c0 / v))))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-312) || !(t_0 <= 1e+297)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 2e-312) or not (t_0 <= 1e+297): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 2e-312) || !(t_0 <= 1e+297)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 2e-312) || ~((t_0 <= 1e+297)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-312], N[Not[LessEqual[t$95$0, 1e+297]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-312} \lor \neg \left(t\_0 \leq 10^{+297}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000000000019e-312 or 1e297 < (/.f64 A (*.f64 V l)) Initial program 36.0%
add-sqr-sqrt23.8%
sqrt-unprod23.8%
*-commutative23.8%
*-commutative23.8%
swap-sqr23.0%
add-sqr-sqrt23.0%
pow223.0%
Applied egg-rr23.0%
associate-*l/29.5%
*-commutative29.5%
times-frac30.8%
Simplified30.8%
unpow230.8%
*-un-lft-identity30.8%
times-frac38.4%
/-rgt-identity38.4%
Applied egg-rr38.4%
if 2.0000000000019e-312 < (/.f64 A (*.f64 V l)) < 1e297Initial program 99.1%
Final simplification77.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= t_0 4e+282) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if (t_0 <= 4e+282) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if (t_0 <= 4d+282) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if (t_0 <= 4e+282) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.pow((V / (A / l)), -0.5) elif t_0 <= 4e+282: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (t_0 <= 4e+282) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif (t_0 <= 4e+282)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+282], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 30.5%
associate-/r*51.0%
div-inv51.0%
div-inv51.0%
associate-*l*33.7%
Applied egg-rr33.7%
frac-times30.5%
metadata-eval30.5%
div-inv30.5%
clear-num30.5%
associate-*r/51.0%
metadata-eval51.0%
add-sqr-sqrt50.9%
frac-times51.0%
sqrt-unprod50.9%
add-sqr-sqrt51.0%
inv-pow51.0%
sqrt-pow251.0%
associate-*r/30.5%
*-commutative30.5%
*-un-lft-identity30.5%
times-frac51.0%
/-rgt-identity51.0%
metadata-eval51.0%
Applied egg-rr51.0%
associate-*r/30.5%
*-commutative30.5%
associate-*r/51.0%
clear-num51.0%
un-div-inv51.0%
Applied egg-rr51.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000013e282Initial program 99.2%
if 4.00000000000000013e282 < (/.f64 A (*.f64 V l)) Initial program 43.4%
associate-/r*51.4%
div-inv51.3%
div-inv51.4%
associate-*l*42.4%
Applied egg-rr42.4%
add-sqr-sqrt19.0%
sqrt-unprod19.2%
swap-sqr17.0%
add-sqr-sqrt17.0%
frac-times17.0%
metadata-eval17.0%
div-inv17.0%
clear-num17.0%
associate-*r/19.0%
metadata-eval19.0%
add-sqr-sqrt19.0%
frac-times19.0%
swap-sqr21.1%
sqrt-unprod22.6%
Applied egg-rr51.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+282) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+282) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+282) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+282) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+282: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+282) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+282)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+282], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 30.5%
*-commutative30.5%
associate-/l/51.0%
Simplified51.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000013e282Initial program 99.2%
if 4.00000000000000013e282 < (/.f64 A (*.f64 V l)) Initial program 43.4%
associate-/r*51.4%
div-inv51.3%
div-inv51.4%
associate-*l*42.4%
Applied egg-rr42.4%
add-sqr-sqrt19.0%
sqrt-unprod19.2%
swap-sqr17.0%
add-sqr-sqrt17.0%
frac-times17.0%
metadata-eval17.0%
div-inv17.0%
clear-num17.0%
associate-*r/19.0%
metadata-eval19.0%
add-sqr-sqrt19.0%
frac-times19.0%
swap-sqr21.1%
sqrt-unprod22.6%
Applied egg-rr51.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 76.7%
herbie shell --seed 2024165
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))