
(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 14 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 (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))))
(*
t_s
(if (<= l_m 1.3e+152)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(if (<= l_m 7.5e+230)
(* t_m (/ (sqrt 2.0) (* l_m (sqrt t_2))))
(if (<= l_m 4.9e+272)
(+ 1.0 (/ -1.0 x))
(* t_m (* (/ (sqrt 2.0) l_m) (sqrt (/ 1.0 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 = (1.0 / (x + -1.0)) + (1.0 / x);
double tmp;
if (l_m <= 1.3e+152) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else if (l_m <= 7.5e+230) {
tmp = t_m * (sqrt(2.0) / (l_m * sqrt(t_2)));
} else if (l_m <= 4.9e+272) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / t_2)));
}
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))) + (1.0d0 / x)
if (l_m <= 1.3d+152) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (l_m <= 7.5d+230) then
tmp = t_m * (sqrt(2.0d0) / (l_m * sqrt(t_2)))
else if (l_m <= 4.9d+272) then
tmp = 1.0d0 + ((-1.0d0) / x)
else
tmp = t_m * ((sqrt(2.0d0) / l_m) * sqrt((1.0d0 / t_2)))
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 = (1.0 / (x + -1.0)) + (1.0 / x);
double tmp;
if (l_m <= 1.3e+152) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (l_m <= 7.5e+230) {
tmp = t_m * (Math.sqrt(2.0) / (l_m * Math.sqrt(t_2)));
} else if (l_m <= 4.9e+272) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_m * ((Math.sqrt(2.0) / l_m) * Math.sqrt((1.0 / t_2)));
}
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 = (1.0 / (x + -1.0)) + (1.0 / x) tmp = 0 if l_m <= 1.3e+152: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) elif l_m <= 7.5e+230: tmp = t_m * (math.sqrt(2.0) / (l_m * math.sqrt(t_2))) elif l_m <= 4.9e+272: tmp = 1.0 + (-1.0 / x) else: tmp = t_m * ((math.sqrt(2.0) / l_m) * math.sqrt((1.0 / 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(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)) tmp = 0.0 if (l_m <= 1.3e+152) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); elseif (l_m <= 7.5e+230) tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(l_m * sqrt(t_2)))); elseif (l_m <= 4.9e+272) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(t_m * Float64(Float64(sqrt(2.0) / l_m) * sqrt(Float64(1.0 / t_2)))); 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)) + (1.0 / x); tmp = 0.0; if (l_m <= 1.3e+152) tmp = sqrt(((x + -1.0) / (x + 1.0))); elseif (l_m <= 7.5e+230) tmp = t_m * (sqrt(2.0) / (l_m * sqrt(t_2))); elseif (l_m <= 4.9e+272) tmp = 1.0 + (-1.0 / x); else tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / t_2))); 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[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 1.3e+152], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 7.5e+230], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l$95$m * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 4.9e+272], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $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 := \frac{1}{x + -1} + \frac{1}{x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;l_m \leq 1.3 \cdot 10^{+152}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;l_m \leq 7.5 \cdot 10^{+230}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{l_m \cdot \sqrt{t_2}}\\
\mathbf{elif}\;l_m \leq 4.9 \cdot 10^{+272}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;t_m \cdot \left(\frac{\sqrt{2}}{l_m} \cdot \sqrt{\frac{1}{t_2}}\right)\\
\end{array}
\end{array}
\end{array}
if l < 1.3e152Initial program 37.3%
Simplified37.4%
Taylor expanded in t around inf 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in t around 0 41.5%
if 1.3e152 < l < 7.5000000000000004e230Initial program 0.2%
Simplified0.2%
Taylor expanded in l around inf 3.4%
associate--l+42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
sub-neg42.3%
metadata-eval42.3%
+-commutative42.3%
Simplified42.3%
Taylor expanded in x around inf 72.8%
if 7.5000000000000004e230 < l < 4.9000000000000002e272Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 50.9%
associate-*l*50.9%
+-commutative50.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in x around inf 50.9%
if 4.9000000000000002e272 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+36.1%
sub-neg36.1%
metadata-eval36.1%
+-commutative36.1%
sub-neg36.1%
metadata-eval36.1%
+-commutative36.1%
Simplified36.1%
Taylor expanded in x around inf 99.4%
Final simplification45.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
(if (<= (* l_m l_m) 4e+293)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(*
(/
(sqrt 2.0)
(* l_m (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 2.0)))))))
t_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 ((l_m * l_m) <= 4e+293) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (sqrt(2.0) / (l_m * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / pow(x, 2.0))))))) * t_m;
}
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 * l_m) <= 4d+293) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = (sqrt(2.0d0) / (l_m * sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + (1.0d0 / (x ** 2.0d0))))))) * t_m
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 * l_m) <= 4e+293) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (Math.sqrt(2.0) / (l_m * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 2.0))))))) * t_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 (l_m * l_m) <= 4e+293: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = (math.sqrt(2.0) / (l_m * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / math.pow(x, 2.0))))))) * t_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(l_m * l_m) <= 4e+293) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(Float64(sqrt(2.0) / Float64(l_m * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0))))))) * t_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 ((l_m * l_m) <= 4e+293) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = (sqrt(2.0) / (l_m * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / (x ^ 2.0))))))) * t_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[(l$95$m * l$95$m), $MachinePrecision], 4e+293], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(l$95$m * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $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 \cdot l_m \leq 4 \cdot 10^{+293}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{l_m \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}} \cdot t_m\\
\end{array}
\end{array}
if (*.f64 l l) < 3.9999999999999997e293Initial program 41.3%
Simplified41.4%
Taylor expanded in t around inf 43.5%
associate-*l*43.5%
+-commutative43.5%
sub-neg43.5%
metadata-eval43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in t around 0 44.2%
if 3.9999999999999997e293 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 6.2%
associate--l+36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 55.6%
Final simplification46.4%
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 l_m) 4e+293)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(*
(/ (sqrt 2.0) l_m)
(* t_m (pow (+ (/ 1.0 x) (+ (/ 1.0 (+ x -1.0)) (pow x -2.0))) -0.5))))))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 * l_m) <= 4e+293) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (sqrt(2.0) / l_m) * (t_m * pow(((1.0 / x) + ((1.0 / (x + -1.0)) + pow(x, -2.0))), -0.5));
}
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 * l_m) <= 4d+293) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = (sqrt(2.0d0) / l_m) * (t_m * (((1.0d0 / x) + ((1.0d0 / (x + (-1.0d0))) + (x ** (-2.0d0)))) ** (-0.5d0)))
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 * l_m) <= 4e+293) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (Math.sqrt(2.0) / l_m) * (t_m * Math.pow(((1.0 / x) + ((1.0 / (x + -1.0)) + Math.pow(x, -2.0))), -0.5));
}
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 * l_m) <= 4e+293: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = (math.sqrt(2.0) / l_m) * (t_m * math.pow(((1.0 / x) + ((1.0 / (x + -1.0)) + math.pow(x, -2.0))), -0.5)) 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(l_m * l_m) <= 4e+293) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(Float64(sqrt(2.0) / l_m) * Float64(t_m * (Float64(Float64(1.0 / x) + Float64(Float64(1.0 / Float64(x + -1.0)) + (x ^ -2.0))) ^ -0.5))); 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 * l_m) <= 4e+293) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = (sqrt(2.0) / l_m) * (t_m * (((1.0 / x) + ((1.0 / (x + -1.0)) + (x ^ -2.0))) ^ -0.5)); 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[(l$95$m * l$95$m), $MachinePrecision], 4e+293], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m * N[Power[N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $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}\;l_m \cdot l_m \leq 4 \cdot 10^{+293}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{l_m} \cdot \left(t_m \cdot {\left(\frac{1}{x} + \left(\frac{1}{x + -1} + {x}^{-2}\right)\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 3.9999999999999997e293Initial program 41.3%
Simplified41.4%
Taylor expanded in t around inf 43.5%
associate-*l*43.5%
+-commutative43.5%
sub-neg43.5%
metadata-eval43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in t around 0 44.2%
if 3.9999999999999997e293 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 6.2%
*-commutative6.2%
associate--l+36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 55.5%
associate-*r/55.5%
inv-pow55.5%
sqrt-pow155.5%
associate-+r+55.5%
+-commutative55.5%
pow-flip55.5%
metadata-eval55.5%
metadata-eval55.5%
Applied egg-rr55.5%
expm1-log1p-u55.3%
expm1-udef32.5%
*-commutative32.5%
associate-/l*32.5%
associate-+l+32.5%
Applied egg-rr32.5%
expm1-def55.3%
expm1-log1p55.6%
*-commutative55.6%
associate-/r/55.5%
associate-*l/55.5%
*-commutative55.5%
associate-*l/55.5%
associate-*l*55.5%
Simplified55.5%
Final simplification46.3%
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 l_m) 4e+293)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(*
t_m
(/
(*
(sqrt 2.0)
(pow (+ (pow x -2.0) (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))) -0.5))
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 ((l_m * l_m) <= 4e+293) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((sqrt(2.0) * pow((pow(x, -2.0) + ((1.0 / (x + -1.0)) + (1.0 / x))), -0.5)) / l_m);
}
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 * l_m) <= 4d+293) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = t_m * ((sqrt(2.0d0) * (((x ** (-2.0d0)) + ((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x))) ** (-0.5d0))) / l_m)
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 * l_m) <= 4e+293) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((Math.sqrt(2.0) * Math.pow((Math.pow(x, -2.0) + ((1.0 / (x + -1.0)) + (1.0 / x))), -0.5)) / 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 (l_m * l_m) <= 4e+293: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = t_m * ((math.sqrt(2.0) * math.pow((math.pow(x, -2.0) + ((1.0 / (x + -1.0)) + (1.0 / x))), -0.5)) / 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(l_m * l_m) <= 4e+293) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(t_m * Float64(Float64(sqrt(2.0) * (Float64((x ^ -2.0) + Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x))) ^ -0.5)) / 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 ((l_m * l_m) <= 4e+293) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = t_m * ((sqrt(2.0) * (((x ^ -2.0) + ((1.0 / (x + -1.0)) + (1.0 / x))) ^ -0.5)) / 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[(l$95$m * l$95$m), $MachinePrecision], 4e+293], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[(N[Power[x, -2.0], $MachinePrecision] + N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / l$95$m), $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 \cdot l_m \leq 4 \cdot 10^{+293}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2} \cdot {\left({x}^{-2} + \left(\frac{1}{x + -1} + \frac{1}{x}\right)\right)}^{-0.5}}{l_m}\\
\end{array}
\end{array}
if (*.f64 l l) < 3.9999999999999997e293Initial program 41.3%
Simplified41.4%
Taylor expanded in t around inf 43.5%
associate-*l*43.5%
+-commutative43.5%
sub-neg43.5%
metadata-eval43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in t around 0 44.2%
if 3.9999999999999997e293 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 6.2%
*-commutative6.2%
associate--l+36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 55.5%
associate-*r/55.5%
inv-pow55.5%
sqrt-pow155.5%
associate-+r+55.5%
+-commutative55.5%
pow-flip55.5%
metadata-eval55.5%
metadata-eval55.5%
Applied egg-rr55.5%
Final simplification46.3%
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 l_m) 4e+293)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(*
t_m
(*
(/ (sqrt 2.0) l_m)
(sqrt
(/
1.0
(+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (* (/ 1.0 x) (/ 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 ((l_m * l_m) <= 4e+293) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / ((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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 ((l_m * l_m) <= 4d+293) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = t_m * ((sqrt(2.0d0) / l_m) * sqrt((1.0d0 / ((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + ((1.0d0 / x) * (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 ((l_m * l_m) <= 4e+293) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((Math.sqrt(2.0) / l_m) * Math.sqrt((1.0 / ((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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 (l_m * l_m) <= 4e+293: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = t_m * ((math.sqrt(2.0) / l_m) * math.sqrt((1.0 / ((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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 (Float64(l_m * l_m) <= 4e+293) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(t_m * Float64(Float64(sqrt(2.0) / l_m) * sqrt(Float64(1.0 / Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / x) * 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 ((l_m * l_m) <= 4e+293) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((1.0 / ((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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[N[(l$95$m * l$95$m), $MachinePrecision], 4e+293], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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}\;l_m \cdot l_m \leq 4 \cdot 10^{+293}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;t_m \cdot \left(\frac{\sqrt{2}}{l_m} \cdot \sqrt{\frac{1}{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 3.9999999999999997e293Initial program 41.3%
Simplified41.4%
Taylor expanded in t around inf 43.5%
associate-*l*43.5%
+-commutative43.5%
sub-neg43.5%
metadata-eval43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in t around 0 44.2%
if 3.9999999999999997e293 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 6.2%
*-commutative6.2%
associate--l+36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
sub-neg36.2%
metadata-eval36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in x around inf 55.5%
inv-pow55.5%
unpow255.5%
pow-prod-down55.5%
inv-pow55.5%
inv-pow55.5%
Applied egg-rr55.5%
Final simplification46.3%
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 6.1e+150)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(if (or (<= l_m 8.2e+230) (not (<= l_m 4.9e+272)))
(* t_m (/ (sqrt 2.0) (* l_m (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 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 (l_m <= 6.1e+150) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 8.2e+230) || !(l_m <= 4.9e+272)) {
tmp = t_m * (sqrt(2.0) / (l_m * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
} else {
tmp = 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 (l_m <= 6.1d+150) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if ((l_m <= 8.2d+230) .or. (.not. (l_m <= 4.9d+272))) then
tmp = t_m * (sqrt(2.0d0) / (l_m * sqrt(((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x)))))
else
tmp = 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 (l_m <= 6.1e+150) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 8.2e+230) || !(l_m <= 4.9e+272)) {
tmp = t_m * (Math.sqrt(2.0) / (l_m * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
} else {
tmp = 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 l_m <= 6.1e+150: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) elif (l_m <= 8.2e+230) or not (l_m <= 4.9e+272): tmp = t_m * (math.sqrt(2.0) / (l_m * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))) else: tmp = 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 (l_m <= 6.1e+150) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); elseif ((l_m <= 8.2e+230) || !(l_m <= 4.9e+272)) tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(l_m * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))))); else tmp = Float64(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 (l_m <= 6.1e+150) tmp = sqrt(((x + -1.0) / (x + 1.0))); elseif ((l_m <= 8.2e+230) || ~((l_m <= 4.9e+272))) tmp = t_m * (sqrt(2.0) / (l_m * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))); else tmp = 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[l$95$m, 6.1e+150], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 8.2e+230], N[Not[LessEqual[l$95$m, 4.9e+272]], $MachinePrecision]], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l$95$m * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;l_m \leq 6.1 \cdot 10^{+150}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;l_m \leq 8.2 \cdot 10^{+230} \lor \neg \left(l_m \leq 4.9 \cdot 10^{+272}\right):\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{l_m \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if l < 6.10000000000000026e150Initial program 37.3%
Simplified37.4%
Taylor expanded in t around inf 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in t around 0 41.5%
if 6.10000000000000026e150 < l < 8.20000000000000026e230 or 4.9000000000000002e272 < l Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 3.0%
associate--l+40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 78.6%
if 8.20000000000000026e230 < l < 4.9000000000000002e272Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 50.9%
associate-*l*50.9%
+-commutative50.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in x around inf 50.9%
Final simplification45.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
(if (<= l_m 1.95e+152)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(if (or (<= l_m 7.5e+230) (not (<= l_m 4.9e+272)))
(* (/ (* (sqrt 2.0) t_m) l_m) (sqrt (- (* x 0.5) 0.25)))
(+ 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 (l_m <= 1.95e+152) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 7.5e+230) || !(l_m <= 4.9e+272)) {
tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt(((x * 0.5) - 0.25));
} else {
tmp = 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 (l_m <= 1.95d+152) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if ((l_m <= 7.5d+230) .or. (.not. (l_m <= 4.9d+272))) then
tmp = ((sqrt(2.0d0) * t_m) / l_m) * sqrt(((x * 0.5d0) - 0.25d0))
else
tmp = 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 (l_m <= 1.95e+152) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 7.5e+230) || !(l_m <= 4.9e+272)) {
tmp = ((Math.sqrt(2.0) * t_m) / l_m) * Math.sqrt(((x * 0.5) - 0.25));
} else {
tmp = 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 l_m <= 1.95e+152: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) elif (l_m <= 7.5e+230) or not (l_m <= 4.9e+272): tmp = ((math.sqrt(2.0) * t_m) / l_m) * math.sqrt(((x * 0.5) - 0.25)) else: tmp = 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 (l_m <= 1.95e+152) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); elseif ((l_m <= 7.5e+230) || !(l_m <= 4.9e+272)) tmp = Float64(Float64(Float64(sqrt(2.0) * t_m) / l_m) * sqrt(Float64(Float64(x * 0.5) - 0.25))); else tmp = Float64(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 (l_m <= 1.95e+152) tmp = sqrt(((x + -1.0) / (x + 1.0))); elseif ((l_m <= 7.5e+230) || ~((l_m <= 4.9e+272))) tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt(((x * 0.5) - 0.25)); else tmp = 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[l$95$m, 1.95e+152], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 7.5e+230], N[Not[LessEqual[l$95$m, 4.9e+272]], $MachinePrecision]], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;l_m \leq 1.95 \cdot 10^{+152}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;l_m \leq 7.5 \cdot 10^{+230} \lor \neg \left(l_m \leq 4.9 \cdot 10^{+272}\right):\\
\;\;\;\;\frac{\sqrt{2} \cdot t_m}{l_m} \cdot \sqrt{x \cdot 0.5 - 0.25}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if l < 1.95000000000000006e152Initial program 37.3%
Simplified37.4%
Taylor expanded in t around inf 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in t around 0 41.5%
if 1.95000000000000006e152 < l < 7.5000000000000004e230 or 4.9000000000000002e272 < l Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 3.0%
associate--l+40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 78.6%
Taylor expanded in l around 0 76.8%
Taylor expanded in x around inf 76.9%
if 7.5000000000000004e230 < l < 4.9000000000000002e272Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 50.9%
associate-*l*50.9%
+-commutative50.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in x around inf 50.9%
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 (<= l_m 4e+148)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(if (or (<= l_m 4.25e+229) (not (<= l_m 4.9e+272)))
(* (/ (* (sqrt 2.0) t_m) l_m) (sqrt (* x 0.5)))
(+ 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 (l_m <= 4e+148) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 4.25e+229) || !(l_m <= 4.9e+272)) {
tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt((x * 0.5));
} else {
tmp = 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 (l_m <= 4d+148) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if ((l_m <= 4.25d+229) .or. (.not. (l_m <= 4.9d+272))) then
tmp = ((sqrt(2.0d0) * t_m) / l_m) * sqrt((x * 0.5d0))
else
tmp = 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 (l_m <= 4e+148) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 4.25e+229) || !(l_m <= 4.9e+272)) {
tmp = ((Math.sqrt(2.0) * t_m) / l_m) * Math.sqrt((x * 0.5));
} else {
tmp = 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 l_m <= 4e+148: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) elif (l_m <= 4.25e+229) or not (l_m <= 4.9e+272): tmp = ((math.sqrt(2.0) * t_m) / l_m) * math.sqrt((x * 0.5)) else: tmp = 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 (l_m <= 4e+148) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); elseif ((l_m <= 4.25e+229) || !(l_m <= 4.9e+272)) tmp = Float64(Float64(Float64(sqrt(2.0) * t_m) / l_m) * sqrt(Float64(x * 0.5))); else tmp = Float64(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 (l_m <= 4e+148) tmp = sqrt(((x + -1.0) / (x + 1.0))); elseif ((l_m <= 4.25e+229) || ~((l_m <= 4.9e+272))) tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt((x * 0.5)); else tmp = 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[l$95$m, 4e+148], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 4.25e+229], N[Not[LessEqual[l$95$m, 4.9e+272]], $MachinePrecision]], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;l_m \leq 4 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;l_m \leq 4.25 \cdot 10^{+229} \lor \neg \left(l_m \leq 4.9 \cdot 10^{+272}\right):\\
\;\;\;\;\frac{\sqrt{2} \cdot t_m}{l_m} \cdot \sqrt{x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if l < 4.0000000000000002e148Initial program 37.3%
Simplified37.4%
Taylor expanded in t around inf 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in t around 0 41.5%
if 4.0000000000000002e148 < l < 4.24999999999999983e229 or 4.9000000000000002e272 < l Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 3.0%
associate--l+40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 78.6%
Taylor expanded in l around 0 76.8%
Taylor expanded in x around inf 76.8%
*-commutative76.8%
Simplified76.8%
if 4.24999999999999983e229 < l < 4.9000000000000002e272Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 50.9%
associate-*l*50.9%
+-commutative50.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in x around inf 50.9%
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 (<= l_m 8.4e+151)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(if (or (<= l_m 4.8e+230) (not (<= l_m 4.9e+272)))
(/ (* t_m (/ (sqrt 2.0) l_m)) (sqrt (/ 2.0 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 (l_m <= 8.4e+151) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 4.8e+230) || !(l_m <= 4.9e+272)) {
tmp = (t_m * (sqrt(2.0) / l_m)) / sqrt((2.0 / x));
} else {
tmp = 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 (l_m <= 8.4d+151) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if ((l_m <= 4.8d+230) .or. (.not. (l_m <= 4.9d+272))) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) / sqrt((2.0d0 / x))
else
tmp = 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 (l_m <= 8.4e+151) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if ((l_m <= 4.8e+230) || !(l_m <= 4.9e+272)) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) / Math.sqrt((2.0 / x));
} else {
tmp = 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 l_m <= 8.4e+151: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) elif (l_m <= 4.8e+230) or not (l_m <= 4.9e+272): tmp = (t_m * (math.sqrt(2.0) / l_m)) / math.sqrt((2.0 / x)) else: tmp = 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 (l_m <= 8.4e+151) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); elseif ((l_m <= 4.8e+230) || !(l_m <= 4.9e+272)) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) / sqrt(Float64(2.0 / x))); else tmp = Float64(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 (l_m <= 8.4e+151) tmp = sqrt(((x + -1.0) / (x + 1.0))); elseif ((l_m <= 4.8e+230) || ~((l_m <= 4.9e+272))) tmp = (t_m * (sqrt(2.0) / l_m)) / sqrt((2.0 / x)); else tmp = 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[l$95$m, 8.4e+151], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 4.8e+230], N[Not[LessEqual[l$95$m, 4.9e+272]], $MachinePrecision]], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;l_m \leq 8.4 \cdot 10^{+151}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;l_m \leq 4.8 \cdot 10^{+230} \lor \neg \left(l_m \leq 4.9 \cdot 10^{+272}\right):\\
\;\;\;\;\frac{t_m \cdot \frac{\sqrt{2}}{l_m}}{\sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if l < 8.4000000000000002e151Initial program 37.3%
Simplified37.4%
Taylor expanded in t around inf 40.9%
associate-*l*40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in t around 0 41.5%
if 8.4000000000000002e151 < l < 4.79999999999999996e230 or 4.9000000000000002e272 < l Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 3.0%
associate--l+40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
*-un-lft-identity40.9%
*-commutative40.9%
frac-times40.9%
metadata-eval40.9%
sqrt-div40.9%
expm1-log1p-u40.4%
expm1-udef33.2%
Applied egg-rr33.2%
expm1-def40.4%
expm1-log1p40.9%
associate-*r/40.9%
+-commutative40.9%
associate-+r+2.6%
metadata-eval2.6%
sub-neg2.6%
metadata-eval2.6%
sub-neg2.6%
+-commutative2.6%
sub-neg2.6%
metadata-eval2.6%
sub-neg2.6%
metadata-eval2.6%
associate-+l+2.7%
Simplified2.7%
Taylor expanded in x around inf 76.9%
if 4.79999999999999996e230 < l < 4.9000000000000002e272Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 50.9%
associate-*l*50.9%
+-commutative50.9%
sub-neg50.9%
metadata-eval50.9%
+-commutative50.9%
Simplified50.9%
Taylor expanded in x around inf 50.9%
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 3.15e-255)
(* (/ (* (sqrt 2.0) t_m) l_m) (sqrt x))
(sqrt (/ (+ x -1.0) (+ x 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) {
double tmp;
if (t_m <= 3.15e-255) {
tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt(x);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
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 <= 3.15d-255) then
tmp = ((sqrt(2.0d0) * t_m) / l_m) * sqrt(x)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
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 <= 3.15e-255) {
tmp = ((Math.sqrt(2.0) * t_m) / l_m) * Math.sqrt(x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
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 <= 3.15e-255: tmp = ((math.sqrt(2.0) * t_m) / l_m) * math.sqrt(x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) 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 <= 3.15e-255) tmp = Float64(Float64(Float64(sqrt(2.0) * t_m) / l_m) * sqrt(x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); 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 <= 3.15e-255) tmp = ((sqrt(2.0) * t_m) / l_m) * sqrt(x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); 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, 3.15e-255], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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 3.15 \cdot 10^{-255}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t_m}{l_m} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 3.15e-255Initial program 31.8%
Simplified31.9%
Taylor expanded in l around inf 2.6%
associate--l+11.5%
sub-neg11.5%
metadata-eval11.5%
+-commutative11.5%
sub-neg11.5%
metadata-eval11.5%
+-commutative11.5%
Simplified11.5%
Taylor expanded in x around inf 20.7%
Taylor expanded in l around 0 20.4%
Taylor expanded in x around 0 11.5%
if 3.15e-255 < t Initial program 35.2%
Simplified35.3%
Taylor expanded in t around inf 79.8%
associate-*l*79.8%
+-commutative79.8%
sub-neg79.8%
metadata-eval79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in t around 0 80.9%
Final simplification43.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 4.7e-254)
(* x (/ t_m (/ l_m (sqrt 2.0))))
(sqrt (/ (+ x -1.0) (+ x 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) {
double tmp;
if (t_m <= 4.7e-254) {
tmp = x * (t_m / (l_m / sqrt(2.0)));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
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 <= 4.7d-254) then
tmp = x * (t_m / (l_m / sqrt(2.0d0)))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
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 <= 4.7e-254) {
tmp = x * (t_m / (l_m / Math.sqrt(2.0)));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
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 <= 4.7e-254: tmp = x * (t_m / (l_m / math.sqrt(2.0))) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) 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 <= 4.7e-254) tmp = Float64(x * Float64(t_m / Float64(l_m / sqrt(2.0)))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); 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 <= 4.7e-254) tmp = x * (t_m / (l_m / sqrt(2.0))); else tmp = sqrt(((x + -1.0) / (x + 1.0))); 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, 4.7e-254], N[(x * 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[(x + 1.0), $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 4.7 \cdot 10^{-254}:\\
\;\;\;\;x \cdot \frac{t_m}{\frac{l_m}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 4.70000000000000027e-254Initial program 31.8%
Simplified31.9%
Taylor expanded in l around inf 2.6%
*-commutative2.6%
associate--l+11.5%
sub-neg11.5%
metadata-eval11.5%
+-commutative11.5%
sub-neg11.5%
metadata-eval11.5%
+-commutative11.5%
Simplified11.5%
Taylor expanded in x around inf 20.6%
Taylor expanded in x around 0 7.2%
*-commutative7.2%
associate-*l*7.2%
*-commutative7.2%
Simplified7.2%
associate-/l*10.6%
div-inv10.6%
clear-num10.6%
associate-/l*10.6%
Applied egg-rr10.6%
if 4.70000000000000027e-254 < t Initial program 35.2%
Simplified35.3%
Taylor expanded in t around inf 79.8%
associate-*l*79.8%
+-commutative79.8%
sub-neg79.8%
metadata-eval79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in t around 0 80.9%
Final simplification43.3%
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) (+ x 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 * sqrt(((x + -1.0) / (x + 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 * sqrt(((x + (-1.0d0)) / (x + 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 * Math.sqrt(((x + -1.0) / (x + 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 * math.sqrt(((x + -1.0) / (x + 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 * sqrt(Float64(Float64(x + -1.0) / Float64(x + 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 * sqrt(((x + -1.0) / (x + 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 * N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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}{x + 1}}
\end{array}
Initial program 33.4%
Simplified33.5%
Taylor expanded in t around inf 38.4%
associate-*l*38.4%
+-commutative38.4%
sub-neg38.4%
metadata-eval38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in t around 0 38.9%
Final simplification38.9%
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 33.4%
Simplified33.5%
Taylor expanded in t around inf 38.4%
associate-*l*38.4%
+-commutative38.4%
sub-neg38.4%
metadata-eval38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in x around inf 38.3%
Final simplification38.3%
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 33.4%
Simplified33.5%
Taylor expanded in t around inf 38.4%
associate-*l*38.4%
+-commutative38.4%
sub-neg38.4%
metadata-eval38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in x around inf 37.9%
Final simplification37.9%
herbie shell --seed 2023318
(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)))))