
(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 9 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}
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) -4e-307)
(* c0 (/ (sqrt (- A)) (sqrt (- (* l V)))))
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 2e+291)
(* (/ c0 (sqrt (* l V))) (sqrt A))
(/ c0 (sqrt (* l (/ V A)))))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= -4e-307) {
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / sqrt((l * V))) * sqrt(A);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= -4e-307) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / Math.sqrt((l * V))) * Math.sqrt(A);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= -4e-307: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(l * V))) elif (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 2e+291: tmp = (c0 / math.sqrt((l * V))) * math.sqrt(A) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= -4e-307) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(l * V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 2e+291) tmp = Float64(Float64(c0 / sqrt(Float64(l * V))) * sqrt(A)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((l * V) <= -Inf) tmp = c0 * sqrt(((A / V) / l)); elseif ((l * V) <= -4e-307) tmp = c0 * (sqrt(-A) / sqrt(-(l * V))); elseif ((l * V) <= 0.0) tmp = c0 * sqrt(((A / l) / V)); elseif ((l * V) <= 2e+291) tmp = (c0 / sqrt((l * V))) * sqrt(A); else tmp = c0 / sqrt((l * (V / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-307], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(l * V), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+291], N[(N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V}} \cdot \sqrt{A}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 24.0%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6470.7
Applied egg-rr70.7%
if -inf.0 < (*.f64 V l) < -3.99999999999999964e-307Initial program 85.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6481.1
Applied egg-rr81.1%
associate-/r*N/A
lift-*.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.4
Applied egg-rr99.4%
if -3.99999999999999964e-307 < (*.f64 V l) < 0.0Initial program 41.6%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6460.3
Applied egg-rr60.3%
if 0.0 < (*.f64 V l) < 1.9999999999999999e291Initial program 83.9%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6497.5
Applied egg-rr97.5%
if 1.9999999999999999e291 < (*.f64 V l) Initial program 46.4%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr81.7%
Applied egg-rr46.4%
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6482.0
Applied egg-rr82.0%
Final simplification91.0%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 4e-278)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+269)
(/ c0 (sqrt (/ (* l V) A)))
(/ c0 (sqrt (* l (/ V A))))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 4e-278) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+269) {
tmp = c0 / sqrt(((l * V) / A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
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 / (l * v)
if (t_0 <= 4d-278) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+269) then
tmp = c0 / sqrt(((l * v) / a))
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 4e-278) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+269) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 4e-278: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+269: tmp = c0 / math.sqrt(((l * V) / A)) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 4e-278) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+269) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (l * V); tmp = 0.0; if (t_0 <= 4e-278) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 2e+269) tmp = c0 / sqrt(((l * V) / A)); else tmp = c0 / sqrt((l * (V / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-278], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+269], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-278}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.99999999999999975e-278Initial program 45.3%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6458.5
Applied egg-rr58.5%
if 3.99999999999999975e-278 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e269Initial program 99.6%
lift-*.f64N/A
sqrt-divN/A
clear-numN/A
sqrt-divN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.6
Applied egg-rr99.6%
if 2.0000000000000001e269 < (/.f64 A (*.f64 V l)) Initial program 44.5%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr55.3%
Applied egg-rr45.6%
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6455.4
Applied egg-rr55.4%
Final simplification79.4%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 2e-273)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+269) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-273) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+269) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
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 / (l * v)
if (t_0 <= 2d-273) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+269) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-273) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+269) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-273: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+269: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-273) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+269) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (l * V); tmp = 0.0; if (t_0 <= 2e-273) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 2e+269) tmp = c0 * sqrt(t_0); else tmp = c0 / sqrt((l * (V / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-273], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+269], 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}
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;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)) < 2e-273Initial program 47.1%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.8
Applied egg-rr59.8%
if 2e-273 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e269Initial program 99.6%
if 2.0000000000000001e269 < (/.f64 A (*.f64 V l)) Initial program 44.5%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr55.3%
Applied egg-rr45.6%
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6455.4
Applied egg-rr55.4%
Final simplification79.4%
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 2e-273)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+225) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-273) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+225) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
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 / (l * v)
if (t_0 <= 2d-273) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+225) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-273) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+225) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-273: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+225: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-273) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+225) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (l * V); tmp = 0.0; if (t_0 <= 2e-273) tmp = c0 * sqrt(((A / V) / l)); elseif (t_0 <= 1e+225) tmp = c0 * sqrt(t_0); else tmp = c0 * sqrt(((A / l) / V)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-273], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+225], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+225}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2e-273Initial program 47.1%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.8
Applied egg-rr59.8%
if 2e-273 < (/.f64 A (*.f64 V l)) < 9.99999999999999928e224Initial program 99.6%
if 9.99999999999999928e224 < (/.f64 A (*.f64 V l)) Initial program 49.4%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6459.3
Applied egg-rr59.3%
Final simplification79.4%
(FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* l V))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 2e-273) t_1 (if (<= t_0 2e+269) (* c0 (sqrt t_0)) t_1))))
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 2e-273) {
tmp = t_1;
} else if (t_0 <= 2e+269) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (l * v)
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 2d-273) then
tmp = t_1
else if (t_0 <= 2d+269) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 2e-273) {
tmp = t_1;
} else if (t_0 <= 2e+269) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
def code(c0, A, V, l): t_0 = A / (l * V) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 2e-273: tmp = t_1 elif t_0 <= 2e+269: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 2e-273) tmp = t_1; elseif (t_0 <= 2e+269) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; end return tmp end
function tmp_2 = code(c0, A, V, l) t_0 = A / (l * V); t_1 = c0 * sqrt(((A / V) / l)); tmp = 0.0; if (t_0 <= 2e-273) tmp = t_1; elseif (t_0 <= 2e+269) tmp = c0 * sqrt(t_0); else tmp = t_1; end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-273], t$95$1, If[LessEqual[t$95$0, 2e+269], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2e-273 or 2.0000000000000001e269 < (/.f64 A (*.f64 V l)) Initial program 45.8%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.6
Applied egg-rr57.6%
if 2e-273 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e269Initial program 99.6%
Final simplification79.4%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) 2e+291)
(* (/ c0 (sqrt (* l V))) (sqrt A))
(/ c0 (sqrt (* l (/ V A)))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / sqrt((l * V))) * sqrt(A);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
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 ((l * v) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((l * v) <= 2d+291) then
tmp = (c0 / sqrt((l * v))) * sqrt(a)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / Math.sqrt((l * V))) * Math.sqrt(A);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (l * V) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= 2e+291: tmp = (c0 / math.sqrt((l * V))) * math.sqrt(A) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= 2e+291) tmp = Float64(Float64(c0 / sqrt(Float64(l * V))) * sqrt(A)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((l * V) <= 0.0) tmp = c0 * (sqrt((A / V)) / sqrt(l)); elseif ((l * V) <= 2e+291) tmp = (c0 / sqrt((l * V))) * sqrt(A); else tmp = c0 / sqrt((l * (V / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+291], N[(N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V}} \cdot \sqrt{A}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 69.7%
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6451.5
Applied egg-rr51.5%
if 0.0 < (*.f64 V l) < 1.9999999999999999e291Initial program 83.9%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6497.5
Applied egg-rr97.5%
if 1.9999999999999999e291 < (*.f64 V l) Initial program 46.4%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr81.7%
Applied egg-rr46.4%
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6482.0
Applied egg-rr82.0%
Final simplification71.2%
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) 2e+291)
(* (/ c0 (sqrt (* l V))) (sqrt A))
(/ c0 (sqrt (* l (/ V A)))))))
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / sqrt((l * V))) * sqrt(A);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
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 ((l * v) <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= 2d+291) then
tmp = (c0 / sqrt((l * v))) * sqrt(a)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= 2e+291) {
tmp = (c0 / Math.sqrt((l * V))) * Math.sqrt(A);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= 2e+291: tmp = (c0 / math.sqrt((l * V))) * math.sqrt(A) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= 2e+291) tmp = Float64(Float64(c0 / sqrt(Float64(l * V))) * sqrt(A)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if ((l * V) <= 0.0) tmp = c0 * sqrt(((A / V) / l)); elseif ((l * V) <= 2e+291) tmp = (c0 / sqrt((l * V))) * sqrt(A); else tmp = c0 / sqrt((l * (V / A))); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+291], N[(N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V}} \cdot \sqrt{A}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 69.7%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6475.0
Applied egg-rr75.0%
if 0.0 < (*.f64 V l) < 1.9999999999999999e291Initial program 83.9%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6497.5
Applied egg-rr97.5%
if 1.9999999999999999e291 < (*.f64 V l) Initial program 46.4%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr81.7%
Applied egg-rr46.4%
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6482.0
Applied egg-rr82.0%
Final simplification84.2%
(FPCore (c0 A V l) :precision binary64 (if (<= l 3.1e-298) (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 3.1e-298) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
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 (l <= 3.1d-298) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 3.1e-298) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
def code(c0, A, V, l): tmp = 0 if l <= 3.1e-298: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
function code(c0, A, V, l) tmp = 0.0 if (l <= 3.1e-298) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
function tmp_2 = code(c0, A, V, l) tmp = 0.0; if (l <= 3.1e-298) tmp = c0 * (sqrt((A / -l)) / sqrt(-V)); else tmp = c0 * (sqrt((A / V)) / sqrt(l)); end tmp_2 = tmp; end
code[c0_, A_, V_, l_] := If[LessEqual[l, 3.1e-298], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.1 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.1000000000000002e-298Initial program 70.5%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.5
Applied egg-rr71.5%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
div-invN/A
distribute-frac-negN/A
distribute-frac-neg2N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6448.5
Applied egg-rr48.5%
if 3.1000000000000002e-298 < l Initial program 76.5%
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6485.5
Applied egg-rr85.5%
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (l * V))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 73.7%
Final simplification73.7%
herbie shell --seed 2024207
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))