
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))))
(*
t_s
(if (<= t_m 2.3e-178)
(/
(* t_m (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5))
(/ l_m (sqrt 2.0)))
(if (<= t_m 1.75e+104)
(*
t_m
(/
(sqrt 2.0)
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
(/ (+ t_2 (pow l_m 2.0)) x)))))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = 2.0 * pow(t_m, 2.0);
double tmp;
if (t_m <= 2.3e-178) {
tmp = (t_m * pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / sqrt(2.0));
} else if (t_m <= 1.75e+104) {
tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + ((t_2 + pow(l_m, 2.0)) / x))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = 2.0d0 * (t_m ** 2.0d0)
if (t_m <= 2.3d-178) then
tmp = (t_m * (((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0))) / (l_m / sqrt(2.0d0))
else if (t_m <= 1.75d+104) then
tmp = t_m * (sqrt(2.0d0) / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + ((t_2 + (l_m ** 2.0d0)) / x))))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double t_2 = 2.0 * Math.pow(t_m, 2.0);
double tmp;
if (t_m <= 2.3e-178) {
tmp = (t_m * Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / Math.sqrt(2.0));
} else if (t_m <= 1.75e+104) {
tmp = t_m * (Math.sqrt(2.0) / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + ((t_2 + Math.pow(l_m, 2.0)) / x))));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): t_2 = 2.0 * math.pow(t_m, 2.0) tmp = 0 if t_m <= 2.3e-178: tmp = (t_m * math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / math.sqrt(2.0)) elif t_m <= 1.75e+104: tmp = t_m * (math.sqrt(2.0) / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + ((t_2 + math.pow(l_m, 2.0)) / x)))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) tmp = 0.0 if (t_m <= 2.3e-178) tmp = Float64(Float64(t_m * (Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5)) / Float64(l_m / sqrt(2.0))); elseif (t_m <= 1.75e+104) tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(Float64(t_2 + (l_m ^ 2.0)) / x))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) t_2 = 2.0 * (t_m ^ 2.0); tmp = 0.0; if (t_m <= 2.3e-178) tmp = (t_m * (((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5)) / (l_m / sqrt(2.0)); elseif (t_m <= 1.75e+104) tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + ((t_2 + (l_m ^ 2.0)) / x)))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.3e-178], N[(N[(t$95$m * N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.75e+104], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := 2 \cdot {t\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-178}:\\
\;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\
\mathbf{elif}\;t\_m \leq 1.75 \cdot 10^{+104}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_2 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_2 + {l\_m}^{2}}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 2.29999999999999994e-178Initial program 28.5%
Simplified28.4%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.6%
sub-neg10.6%
metadata-eval10.6%
+-commutative10.6%
sub-neg10.6%
metadata-eval10.6%
+-commutative10.6%
associate-/l*10.6%
Simplified10.6%
Taylor expanded in x around inf 18.2%
associate-/r/18.2%
Applied egg-rr18.2%
associate-/r/18.2%
add-cube-cbrt18.1%
pow318.1%
sqrt-pow118.1%
cbrt-div18.1%
metadata-eval18.1%
+-commutative18.1%
+-commutative18.1%
sqrt-pow118.1%
Applied egg-rr20.1%
if 2.29999999999999994e-178 < t < 1.7500000000000001e104Initial program 55.7%
Simplified55.9%
Taylor expanded in x around inf 84.3%
if 1.7500000000000001e104 < t Initial program 13.3%
Simplified13.3%
Taylor expanded in t around inf 96.8%
+-commutative96.8%
sub-neg96.8%
metadata-eval96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 97.1%
Final simplification47.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (/ (+ x -1.0) (+ 1.0 x))))
(*
t_s
(if (<= t_m 1.05e-178)
(/
(* t_m (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5))
(/ l_m (sqrt 2.0)))
(if (<= t_m 1.8e+104)
(*
(sqrt 2.0)
(/
t_m
(sqrt (fma 2.0 (/ (pow t_m 2.0) t_2) (/ (* 2.0 (pow l_m 2.0)) x)))))
(sqrt t_2))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = (x + -1.0) / (1.0 + x);
double tmp;
if (t_m <= 1.05e-178) {
tmp = (t_m * pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5)) / (l_m / sqrt(2.0));
} else if (t_m <= 1.8e+104) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), ((2.0 * pow(l_m, 2.0)) / x))));
} else {
tmp = sqrt(t_2);
}
return t_s * tmp;
}
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(Float64(x + -1.0) / Float64(1.0 + x)) tmp = 0.0 if (t_m <= 1.05e-178) tmp = Float64(Float64(t_m * (Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5)) / Float64(l_m / sqrt(2.0))); elseif (t_m <= 1.8e+104) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(Float64(2.0 * (l_m ^ 2.0)) / x))))); else tmp = sqrt(t_2); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.05e-178], N[(N[(t$95$m * N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.8e+104], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{x + -1}{1 + x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-178}:\\
\;\;\;\;\frac{t\_m \cdot {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}}{\frac{l\_m}{\sqrt{2}}}\\
\mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{+104}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, \frac{{t\_m}^{2}}{t\_2}, \frac{2 \cdot {l\_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2}\\
\end{array}
\end{array}
\end{array}
if t < 1.05e-178Initial program 28.5%
Simplified28.4%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.6%
sub-neg10.6%
metadata-eval10.6%
+-commutative10.6%
sub-neg10.6%
metadata-eval10.6%
+-commutative10.6%
associate-/l*10.6%
Simplified10.6%
Taylor expanded in x around inf 18.2%
associate-/r/18.2%
Applied egg-rr18.2%
associate-/r/18.2%
add-cube-cbrt18.1%
pow318.1%
sqrt-pow118.1%
cbrt-div18.1%
metadata-eval18.1%
+-commutative18.1%
+-commutative18.1%
sqrt-pow118.1%
Applied egg-rr20.1%
if 1.05e-178 < t < 1.8e104Initial program 55.7%
Simplified55.7%
Taylor expanded in l around 0 54.4%
fma-define54.4%
associate-/l*69.3%
sub-neg69.3%
metadata-eval69.3%
+-commutative69.3%
+-commutative69.3%
associate--l+72.2%
sub-neg72.2%
metadata-eval72.2%
+-commutative72.2%
sub-neg72.2%
metadata-eval72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in x around inf 84.0%
associate-*r/84.0%
Simplified84.0%
if 1.8e104 < t Initial program 13.3%
Simplified13.3%
Taylor expanded in t around inf 96.8%
+-commutative96.8%
sub-neg96.8%
metadata-eval96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 97.1%
Final simplification47.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<=
(/
(* t_m (sqrt 2.0))
(sqrt
(-
(* (/ (+ 1.0 x) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
(* l_m l_m))))
INFINITY)
(sqrt (/ (+ x -1.0) (+ 1.0 x)))
(*
t_m
(* (sqrt (/ 1.0 (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))))) (/ (sqrt 2.0) l_m))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (((t_m * sqrt(2.0)) / sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= ((double) INFINITY)) {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (sqrt(2.0) / l_m));
}
return t_s * tmp;
}
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = t_m * (Math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (Math.sqrt(2.0) / l_m));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if ((t_m * math.sqrt(2.0)) / math.sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= math.inf: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) else: tmp = t_m * (math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (math.sqrt(2.0) / l_m)) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (Float64(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(1.0 + x) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= Inf) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); else tmp = Float64(t_m * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))))) * Float64(sqrt(2.0) / l_m))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (((t_m * sqrt(2.0)) / sqrt(((((1.0 + x) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= Inf) tmp = sqrt(((x + -1.0) / (1.0 + x))); else tmp = t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (sqrt(2.0) / l_m)); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_m \cdot \sqrt{2}}{\sqrt{\frac{1 + x}{x + -1} \cdot \left(l\_m \cdot l\_m + 2 \cdot \left(t\_m \cdot t\_m\right)\right) - l\_m \cdot l\_m}} \leq \infty:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(\sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x + -1}}} \cdot \frac{\sqrt{2}}{l\_m}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 37.2%
Simplified37.1%
Taylor expanded in t around inf 40.6%
+-commutative40.6%
sub-neg40.6%
metadata-eval40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in t around 0 40.7%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 8.0%
*-commutative8.0%
associate--l+29.3%
sub-neg29.3%
metadata-eval29.3%
+-commutative29.3%
sub-neg29.3%
metadata-eval29.3%
+-commutative29.3%
Simplified29.3%
Taylor expanded in x around inf 50.6%
Final simplification42.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2
(*
t_m
(* (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5) (/ (sqrt 2.0) l_m)))))
(*
t_s
(if (<= t_m 1.5e-165)
t_2
(if (<= t_m 1.5e-95)
(- 1.0 (/ 1.0 x))
(if (<= t_m 5.5e-86) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = t_m * (pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (sqrt(2.0) / l_m));
double tmp;
if (t_m <= 1.5e-165) {
tmp = t_2;
} else if (t_m <= 1.5e-95) {
tmp = 1.0 - (1.0 / x);
} else if (t_m <= 5.5e-86) {
tmp = t_2;
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = t_m * ((((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0)) * (sqrt(2.0d0) / l_m))
if (t_m <= 1.5d-165) then
tmp = t_2
else if (t_m <= 1.5d-95) then
tmp = 1.0d0 - (1.0d0 / x)
else if (t_m <= 5.5d-86) then
tmp = t_2
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double t_2 = t_m * (Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (Math.sqrt(2.0) / l_m));
double tmp;
if (t_m <= 1.5e-165) {
tmp = t_2;
} else if (t_m <= 1.5e-95) {
tmp = 1.0 - (1.0 / x);
} else if (t_m <= 5.5e-86) {
tmp = t_2;
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): t_2 = t_m * (math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) * (math.sqrt(2.0) / l_m)) tmp = 0 if t_m <= 1.5e-165: tmp = t_2 elif t_m <= 1.5e-95: tmp = 1.0 - (1.0 / x) elif t_m <= 5.5e-86: tmp = t_2 else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(t_m * Float64((Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5) * Float64(sqrt(2.0) / l_m))) tmp = 0.0 if (t_m <= 1.5e-165) tmp = t_2; elseif (t_m <= 1.5e-95) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (t_m <= 5.5e-86) tmp = t_2; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) t_2 = t_m * ((((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5) * (sqrt(2.0) / l_m)); tmp = 0.0; if (t_m <= 1.5e-165) tmp = t_2; elseif (t_m <= 1.5e-95) tmp = 1.0 - (1.0 / x); elseif (t_m <= 5.5e-86) tmp = t_2; else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.5e-165], t$95$2, If[LessEqual[t$95$m, 1.5e-95], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.5e-86], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \left({\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5} \cdot \frac{\sqrt{2}}{l\_m}\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.5 \cdot 10^{-165}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{-86}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.49999999999999989e-165 or 1.5e-95 < t < 5.5e-86Initial program 28.0%
Simplified27.9%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.7%
sub-neg10.7%
metadata-eval10.7%
+-commutative10.7%
sub-neg10.7%
metadata-eval10.7%
+-commutative10.7%
associate-/l*10.7%
Simplified10.7%
Taylor expanded in x around inf 19.1%
associate-/r/19.1%
Applied egg-rr19.1%
associate-/r/19.1%
add-cube-cbrt19.0%
pow319.0%
sqrt-pow119.0%
cbrt-div19.0%
metadata-eval19.0%
+-commutative19.0%
+-commutative19.0%
sqrt-pow119.0%
Applied egg-rr20.9%
associate-/r/20.9%
associate-*l/21.0%
associate-*r/21.0%
*-commutative21.0%
associate-*l*20.9%
metadata-eval20.9%
sub-neg20.9%
+-commutative20.9%
sub-neg20.9%
metadata-eval20.9%
+-commutative20.9%
Simplified20.9%
if 1.49999999999999989e-165 < t < 1.5e-95Initial program 43.4%
Simplified43.4%
Taylor expanded in t around inf 45.7%
+-commutative45.7%
sub-neg45.7%
metadata-eval45.7%
+-commutative45.7%
Simplified45.7%
Taylor expanded in x around inf 45.7%
if 5.5e-86 < t Initial program 32.7%
Simplified32.7%
Taylor expanded in t around inf 90.0%
+-commutative90.0%
sub-neg90.0%
metadata-eval90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in t around 0 90.1%
Final simplification45.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (pow (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))) -0.5)))
(*
t_s
(if (<= t_m 1.8e-166)
(/ (* t_m t_2) (/ l_m (sqrt 2.0)))
(if (<= t_m 1.5e-95)
(- 1.0 (/ 1.0 x))
(if (<= t_m 3.3e-86)
(* t_m (* t_2 (/ (sqrt 2.0) l_m)))
(sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5);
double tmp;
if (t_m <= 1.8e-166) {
tmp = (t_m * t_2) / (l_m / sqrt(2.0));
} else if (t_m <= 1.5e-95) {
tmp = 1.0 - (1.0 / x);
} else if (t_m <= 3.3e-86) {
tmp = t_m * (t_2 * (sqrt(2.0) / l_m));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = ((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))) ** (-0.5d0)
if (t_m <= 1.8d-166) then
tmp = (t_m * t_2) / (l_m / sqrt(2.0d0))
else if (t_m <= 1.5d-95) then
tmp = 1.0d0 - (1.0d0 / x)
else if (t_m <= 3.3d-86) then
tmp = t_m * (t_2 * (sqrt(2.0d0) / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double t_2 = Math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5);
double tmp;
if (t_m <= 1.8e-166) {
tmp = (t_m * t_2) / (l_m / Math.sqrt(2.0));
} else if (t_m <= 1.5e-95) {
tmp = 1.0 - (1.0 / x);
} else if (t_m <= 3.3e-86) {
tmp = t_m * (t_2 * (Math.sqrt(2.0) / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): t_2 = math.pow(((1.0 / x) + (1.0 / (x + -1.0))), -0.5) tmp = 0 if t_m <= 1.8e-166: tmp = (t_m * t_2) / (l_m / math.sqrt(2.0)) elif t_m <= 1.5e-95: tmp = 1.0 - (1.0 / x) elif t_m <= 3.3e-86: tmp = t_m * (t_2 * (math.sqrt(2.0) / l_m)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))) ^ -0.5 tmp = 0.0 if (t_m <= 1.8e-166) tmp = Float64(Float64(t_m * t_2) / Float64(l_m / sqrt(2.0))); elseif (t_m <= 1.5e-95) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (t_m <= 3.3e-86) tmp = Float64(t_m * Float64(t_2 * Float64(sqrt(2.0) / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) t_2 = ((1.0 / x) + (1.0 / (x + -1.0))) ^ -0.5; tmp = 0.0; if (t_m <= 1.8e-166) tmp = (t_m * t_2) / (l_m / sqrt(2.0)); elseif (t_m <= 1.5e-95) tmp = 1.0 - (1.0 / x); elseif (t_m <= 3.3e-86) tmp = t_m * (t_2 * (sqrt(2.0) / l_m)); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.8e-166], N[(N[(t$95$m * t$95$2), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.5e-95], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-86], N[(t$95$m * N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := {\left(\frac{1}{x} + \frac{1}{x + -1}\right)}^{-0.5}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.8 \cdot 10^{-166}:\\
\;\;\;\;\frac{t\_m \cdot t\_2}{\frac{l\_m}{\sqrt{2}}}\\
\mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-95}:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-86}:\\
\;\;\;\;t\_m \cdot \left(t\_2 \cdot \frac{\sqrt{2}}{l\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.8e-166Initial program 28.2%
Simplified28.1%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
associate-/l*10.8%
Simplified10.8%
Taylor expanded in x around inf 19.2%
associate-/r/19.2%
Applied egg-rr19.2%
associate-/r/19.2%
add-cube-cbrt19.1%
pow319.1%
sqrt-pow119.1%
cbrt-div19.1%
metadata-eval19.1%
+-commutative19.1%
+-commutative19.1%
sqrt-pow119.1%
Applied egg-rr21.0%
if 1.8e-166 < t < 1.5e-95Initial program 43.4%
Simplified43.4%
Taylor expanded in t around inf 45.7%
+-commutative45.7%
sub-neg45.7%
metadata-eval45.7%
+-commutative45.7%
Simplified45.7%
Taylor expanded in x around inf 45.7%
if 1.5e-95 < t < 3.29999999999999987e-86Initial program 2.2%
Simplified2.2%
Taylor expanded in l around inf 1.1%
*-commutative1.1%
associate--l+3.3%
sub-neg3.3%
metadata-eval3.3%
+-commutative3.3%
sub-neg3.3%
metadata-eval3.3%
+-commutative3.3%
associate-/l*3.3%
Simplified3.3%
Taylor expanded in x around inf 3.3%
associate-/r/3.3%
Applied egg-rr3.3%
associate-/r/3.3%
add-cube-cbrt3.3%
pow33.3%
sqrt-pow13.3%
cbrt-div3.3%
metadata-eval3.3%
+-commutative3.3%
+-commutative3.3%
sqrt-pow13.3%
Applied egg-rr3.3%
associate-/r/3.3%
associate-*l/3.3%
associate-*r/3.3%
*-commutative3.3%
associate-*l*3.3%
metadata-eval3.3%
sub-neg3.3%
+-commutative3.3%
sub-neg3.3%
metadata-eval3.3%
+-commutative3.3%
Simplified3.3%
if 3.29999999999999987e-86 < t Initial program 32.7%
Simplified32.7%
Taylor expanded in t around inf 90.0%
+-commutative90.0%
sub-neg90.0%
metadata-eval90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in t around 0 90.1%
Final simplification45.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.55e-166)
(* (sqrt (- (* x 0.5) 0.5)) (/ t_m (/ l_m (sqrt 2.0))))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.55e-166) {
tmp = sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / sqrt(2.0)));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.55d-166) then
tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (t_m / (l_m / sqrt(2.0d0)))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.55e-166) {
tmp = Math.sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / Math.sqrt(2.0)));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.55e-166: tmp = math.sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / math.sqrt(2.0))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.55e-166) tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(t_m / Float64(l_m / sqrt(2.0)))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.55e-166) tmp = sqrt(((x * 0.5) - 0.5)) * (t_m / (l_m / sqrt(2.0))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.55e-166], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(t$95$m / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.55 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \frac{t\_m}{\frac{l\_m}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.54999999999999992e-166Initial program 28.2%
Simplified28.1%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
associate-/l*10.8%
Simplified10.8%
Taylor expanded in x around 0 19.7%
if 1.54999999999999992e-166 < t Initial program 33.2%
Simplified33.2%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in t around 0 86.0%
Final simplification44.8%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 2.65e-166)
(* (sqrt (* x 0.5)) (* (sqrt 2.0) (/ t_m l_m)))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 2.65e-166) {
tmp = sqrt((x * 0.5)) * (sqrt(2.0) * (t_m / l_m));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 2.65d-166) then
tmp = sqrt((x * 0.5d0)) * (sqrt(2.0d0) * (t_m / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 2.65e-166) {
tmp = Math.sqrt((x * 0.5)) * (Math.sqrt(2.0) * (t_m / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 2.65e-166: tmp = math.sqrt((x * 0.5)) * (math.sqrt(2.0) * (t_m / l_m)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 2.65e-166) tmp = Float64(sqrt(Float64(x * 0.5)) * Float64(sqrt(2.0) * Float64(t_m / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 2.65e-166) tmp = sqrt((x * 0.5)) * (sqrt(2.0) * (t_m / l_m)); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.65e-166], N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.65 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 2.64999999999999998e-166Initial program 28.2%
Simplified28.1%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
associate-/l*10.8%
Simplified10.8%
Taylor expanded in x around inf 19.2%
associate-/r/19.2%
Applied egg-rr19.2%
Taylor expanded in x around inf 19.2%
*-commutative19.2%
Simplified19.2%
if 2.64999999999999998e-166 < t Initial program 33.2%
Simplified33.2%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in t around 0 86.0%
Final simplification44.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.85e-165)
(* (/ t_m (/ l_m (sqrt 2.0))) (sqrt (* x 0.5)))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.85e-165) {
tmp = (t_m / (l_m / sqrt(2.0))) * sqrt((x * 0.5));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.85d-165) then
tmp = (t_m / (l_m / sqrt(2.0d0))) * sqrt((x * 0.5d0))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.85e-165) {
tmp = (t_m / (l_m / Math.sqrt(2.0))) * Math.sqrt((x * 0.5));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.85e-165: tmp = (t_m / (l_m / math.sqrt(2.0))) * math.sqrt((x * 0.5)) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.85e-165) tmp = Float64(Float64(t_m / Float64(l_m / sqrt(2.0))) * sqrt(Float64(x * 0.5))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.85e-165) tmp = (t_m / (l_m / sqrt(2.0))) * sqrt((x * 0.5)); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.85e-165], N[(N[(t$95$m / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.85 \cdot 10^{-165}:\\
\;\;\;\;\frac{t\_m}{\frac{l\_m}{\sqrt{2}}} \cdot \sqrt{x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.85000000000000001e-165Initial program 28.2%
Simplified28.1%
Taylor expanded in l around inf 2.8%
*-commutative2.8%
associate--l+10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
sub-neg10.8%
metadata-eval10.8%
+-commutative10.8%
associate-/l*10.8%
Simplified10.8%
Taylor expanded in x around inf 19.2%
*-commutative19.2%
Simplified19.2%
if 1.85000000000000001e-165 < t Initial program 33.2%
Simplified33.2%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in t around 0 86.0%
Final simplification44.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 5.3e+262)
(sqrt (/ (+ x -1.0) (+ 1.0 x)))
(* (* (sqrt 2.0) (/ t_m l_m)) (sqrt x)))))l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 5.3e+262) {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = (sqrt(2.0) * (t_m / l_m)) * sqrt(x);
}
return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (l_m <= 5.3d+262) then
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
else
tmp = (sqrt(2.0d0) * (t_m / l_m)) * sqrt(x)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 5.3e+262) {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = (Math.sqrt(2.0) * (t_m / l_m)) * Math.sqrt(x);
}
return t_s * tmp;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if l_m <= 5.3e+262: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) else: tmp = (math.sqrt(2.0) * (t_m / l_m)) * math.sqrt(x) return t_s * tmp
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 5.3e+262) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); else tmp = Float64(Float64(sqrt(2.0) * Float64(t_m / l_m)) * sqrt(x)); end return Float64(t_s * tmp) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (l_m <= 5.3e+262) tmp = sqrt(((x + -1.0) / (1.0 + x))); else tmp = (sqrt(2.0) * (t_m / l_m)) * sqrt(x); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 5.3e+262], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.3 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \frac{t\_m}{l\_m}\right) \cdot \sqrt{x}\\
\end{array}
\end{array}
if l < 5.30000000000000002e262Initial program 31.1%
Simplified31.0%
Taylor expanded in t around inf 37.2%
+-commutative37.2%
sub-neg37.2%
metadata-eval37.2%
+-commutative37.2%
Simplified37.2%
Taylor expanded in t around 0 37.3%
if 5.30000000000000002e262 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 13.7%
*-commutative13.7%
associate--l+60.2%
sub-neg60.2%
metadata-eval60.2%
+-commutative60.2%
sub-neg60.2%
metadata-eval60.2%
+-commutative60.2%
associate-/l*60.2%
Simplified60.2%
Taylor expanded in x around inf 90.1%
associate-/r/89.9%
Applied egg-rr89.9%
Taylor expanded in x around 0 50.1%
Final simplification37.7%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (sqrt (/ (+ x -1.0) (+ 1.0 x)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * sqrt(((x + -1.0) / (1.0 + x)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * Math.sqrt(((x + -1.0) / (1.0 + x)));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * math.sqrt(((x + -1.0) / (1.0 + x)))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * sqrt(((x + -1.0) / (1.0 + x))); end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \sqrt{\frac{x + -1}{1 + x}}
\end{array}
Initial program 30.1%
Simplified30.0%
Taylor expanded in t around inf 36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in t around 0 36.2%
Final simplification36.2%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (- 1.0 (/ 1.0 x))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - (1.0 / x));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 - (1.0d0 / x))
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - (1.0 / x));
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 - (1.0 / x))
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 - Float64(1.0 / x))) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 - (1.0 / x)); end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 - \frac{1}{x}\right)
\end{array}
Initial program 30.1%
Simplified30.0%
Taylor expanded in t around inf 36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 36.0%
Final simplification36.0%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = math.fabs(l) t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * 1.0
l_m = abs(l) t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * 1.0) end
l_m = abs(l); t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * 1.0; end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot 1
\end{array}
Initial program 30.1%
Simplified30.0%
Taylor expanded in t around inf 36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 35.6%
Final simplification35.6%
herbie shell --seed 2024030
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))