
(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}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) t_m)))
(*
t_s
(if (<= x -2000000000.0)
(+ 1.0 (/ -1.0 x))
(/ t_2 (hypot (/ (* (sqrt 2.0) (hypot l t_2)) (sqrt x)) t_2))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = sqrt(2.0) * t_m;
double tmp;
if (x <= -2000000000.0) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_2 / hypot(((sqrt(2.0) * hypot(l, t_2)) / sqrt(x)), t_2);
}
return t_s * tmp;
}
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double t_2 = Math.sqrt(2.0) * t_m;
double tmp;
if (x <= -2000000000.0) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_2 / Math.hypot(((Math.sqrt(2.0) * Math.hypot(l, t_2)) / Math.sqrt(x)), t_2);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): t_2 = math.sqrt(2.0) * t_m tmp = 0 if x <= -2000000000.0: tmp = 1.0 + (-1.0 / x) else: tmp = t_2 / math.hypot(((math.sqrt(2.0) * math.hypot(l, t_2)) / math.sqrt(x)), t_2) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(sqrt(2.0) * t_m) tmp = 0.0 if (x <= -2000000000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(t_2 / hypot(Float64(Float64(sqrt(2.0) * hypot(l, t_2)) / sqrt(x)), t_2)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) t_2 = sqrt(2.0) * t_m; tmp = 0.0; if (x <= -2000000000.0) tmp = 1.0 + (-1.0 / x); else tmp = t_2 / hypot(((sqrt(2.0) * hypot(l, t_2)) / sqrt(x)), t_2); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[x, -2000000000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[Sqrt[N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2 + t$95$2 ^ 2], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2000000000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\mathsf{hypot}\left(\frac{\sqrt{2} \cdot \mathsf{hypot}\left(\ell, t\_2\right)}{\sqrt{x}}, t\_2\right)}\\
\end{array}
\end{array}
\end{array}
if x < -2e9Initial program 39.7%
Simplified36.4%
Taylor expanded in t around inf 56.3%
Taylor expanded in x around inf 56.5%
if -2e9 < x Initial program 32.9%
flip-+18.6%
sub-neg18.6%
metadata-eval18.6%
clear-num18.6%
metadata-eval18.6%
fma-neg18.6%
metadata-eval18.6%
Applied egg-rr18.6%
Taylor expanded in x around inf 58.3%
add-sqr-sqrt58.3%
add-sqr-sqrt58.3%
hypot-define58.3%
Applied egg-rr98.4%
associate-*r/98.4%
*-commutative98.4%
*-commutative98.4%
Simplified98.4%
Final simplification82.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) t_m)))
(*
t_s
(if (<= x -2000000000.0)
(+ 1.0 (/ -1.0 x))
(/ t_2 (hypot (* (sqrt 2.0) (/ (hypot l t_2) (sqrt x))) t_2))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = sqrt(2.0) * t_m;
double tmp;
if (x <= -2000000000.0) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_2 / hypot((sqrt(2.0) * (hypot(l, t_2) / sqrt(x))), t_2);
}
return t_s * tmp;
}
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double t_2 = Math.sqrt(2.0) * t_m;
double tmp;
if (x <= -2000000000.0) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = t_2 / Math.hypot((Math.sqrt(2.0) * (Math.hypot(l, t_2) / Math.sqrt(x))), t_2);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): t_2 = math.sqrt(2.0) * t_m tmp = 0 if x <= -2000000000.0: tmp = 1.0 + (-1.0 / x) else: tmp = t_2 / math.hypot((math.sqrt(2.0) * (math.hypot(l, t_2) / math.sqrt(x))), t_2) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(sqrt(2.0) * t_m) tmp = 0.0 if (x <= -2000000000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(t_2 / hypot(Float64(sqrt(2.0) * Float64(hypot(l, t_2) / sqrt(x))), t_2)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) t_2 = sqrt(2.0) * t_m; tmp = 0.0; if (x <= -2000000000.0) tmp = 1.0 + (-1.0 / x); else tmp = t_2 / hypot((sqrt(2.0) * (hypot(l, t_2) / sqrt(x))), t_2); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[x, -2000000000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2 + t$95$2 ^ 2], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2000000000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\mathsf{hypot}\left(\sqrt{2} \cdot \frac{\mathsf{hypot}\left(\ell, t\_2\right)}{\sqrt{x}}, t\_2\right)}\\
\end{array}
\end{array}
\end{array}
if x < -2e9Initial program 39.7%
Simplified36.4%
Taylor expanded in t around inf 56.3%
Taylor expanded in x around inf 56.5%
if -2e9 < x Initial program 32.9%
flip-+18.6%
sub-neg18.6%
metadata-eval18.6%
clear-num18.6%
metadata-eval18.6%
fma-neg18.6%
metadata-eval18.6%
Applied egg-rr18.6%
Taylor expanded in x around inf 58.3%
add-sqr-sqrt58.3%
add-sqr-sqrt58.3%
hypot-define58.3%
Applied egg-rr98.4%
Final simplification82.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) t_m)) (t_3 (* x (sqrt 2.0))))
(*
t_s
(if (<= t_m 1.4e-228)
(/ (* t_m (sqrt x)) l)
(if (<= t_m 7.5e-150)
(/ t_2 (+ (* 2.0 (/ t_m t_3)) (+ t_2 (/ (pow l 2.0) (* t_m t_3)))))
(if (<= t_m 5.2e+43)
(*
t_2
(pow
(* 2.0 (+ (pow t_m 2.0) (/ (fma 2.0 (pow t_m 2.0) (pow l 2.0)) x)))
-0.5))
(+ 1.0 (/ (+ (/ 0.5 x) -1.0) x))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = sqrt(2.0) * t_m;
double t_3 = x * sqrt(2.0);
double tmp;
if (t_m <= 1.4e-228) {
tmp = (t_m * sqrt(x)) / l;
} else if (t_m <= 7.5e-150) {
tmp = t_2 / ((2.0 * (t_m / t_3)) + (t_2 + (pow(l, 2.0) / (t_m * t_3))));
} else if (t_m <= 5.2e+43) {
tmp = t_2 * pow((2.0 * (pow(t_m, 2.0) + (fma(2.0, pow(t_m, 2.0), pow(l, 2.0)) / x))), -0.5);
} else {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(sqrt(2.0) * t_m) t_3 = Float64(x * sqrt(2.0)) tmp = 0.0 if (t_m <= 1.4e-228) tmp = Float64(Float64(t_m * sqrt(x)) / l); elseif (t_m <= 7.5e-150) tmp = Float64(t_2 / Float64(Float64(2.0 * Float64(t_m / t_3)) + Float64(t_2 + Float64((l ^ 2.0) / Float64(t_m * t_3))))); elseif (t_m <= 5.2e+43) tmp = Float64(t_2 * (Float64(2.0 * Float64((t_m ^ 2.0) + Float64(fma(2.0, (t_m ^ 2.0), (l ^ 2.0)) / x))) ^ -0.5)); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); end return Float64(t_s * tmp) end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.4e-228], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t$95$m, 7.5e-150], N[(t$95$2 / N[(N[(2.0 * N[(t$95$m / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / N[(t$95$m * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.2e+43], N[(t$95$2 * N[Power[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[(N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot t\_m\\
t_3 := x \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.4 \cdot 10^{-228}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t\_m \leq 7.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{t\_2}{2 \cdot \frac{t\_m}{t\_3} + \left(t\_2 + \frac{{\ell}^{2}}{t\_m \cdot t\_3}\right)}\\
\mathbf{elif}\;t\_m \leq 5.2 \cdot 10^{+43}:\\
\;\;\;\;t\_2 \cdot {\left(2 \cdot \left({t\_m}^{2} + \frac{\mathsf{fma}\left(2, {t\_m}^{2}, {\ell}^{2}\right)}{x}\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\end{array}
\end{array}
\end{array}
if t < 1.4000000000000001e-228Initial program 31.9%
flip-+16.0%
sub-neg16.0%
metadata-eval16.0%
clear-num16.1%
metadata-eval16.1%
fma-neg16.1%
metadata-eval16.1%
Applied egg-rr16.1%
Taylor expanded in x around inf 53.8%
Taylor expanded in t around 0 19.3%
*-commutative19.3%
Simplified19.3%
Taylor expanded in t around 0 16.8%
associate-*l/19.4%
Simplified19.4%
if 1.4000000000000001e-228 < t < 7.5000000000000004e-150Initial program 2.5%
flip-+1.9%
sub-neg1.9%
metadata-eval1.9%
clear-num1.9%
metadata-eval1.9%
fma-neg1.9%
metadata-eval1.9%
Applied egg-rr1.9%
Taylor expanded in x around inf 81.8%
if 7.5000000000000004e-150 < t < 5.20000000000000042e43Initial program 51.4%
flip-+27.5%
sub-neg27.5%
metadata-eval27.5%
clear-num27.7%
metadata-eval27.7%
fma-neg27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Taylor expanded in x around inf 87.3%
div-inv87.4%
pow1/287.4%
pow-flip87.5%
distribute-lft-out87.5%
fma-define87.5%
metadata-eval87.5%
Applied egg-rr87.5%
if 5.20000000000000042e43 < t Initial program 40.0%
Simplified40.2%
Taylor expanded in t around inf 96.7%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified97.1%
Taylor expanded in x around -inf 97.1%
associate-*r/97.1%
sub-neg97.1%
associate-*r/97.1%
metadata-eval97.1%
distribute-frac-neg297.1%
neg-mul-197.1%
distribute-frac-neg97.1%
sub-neg97.1%
distribute-frac-neg297.1%
metadata-eval97.1%
associate-*r/97.1%
sub-neg97.1%
associate-*r/97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification53.0%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* 2.0 (pow t_m 2.0))))
(*
t_s
(if (<= t_m 2.9e-214)
(/ (* t_m (sqrt x)) l)
(if (or (<= t_m 7.5e-150) (not (<= t_m 2.8e+43)))
(+ 1.0 (/ (+ (/ 0.5 x) -1.0) x))
(/
(* (sqrt 2.0) t_m)
(sqrt (+ t_2 (* 2.0 (/ (+ (pow l 2.0) t_2) x))))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = 2.0 * pow(t_m, 2.0);
double tmp;
if (t_m <= 2.9e-214) {
tmp = (t_m * sqrt(x)) / l;
} else if ((t_m <= 7.5e-150) || !(t_m <= 2.8e+43)) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (sqrt(2.0) * t_m) / sqrt((t_2 + (2.0 * ((pow(l, 2.0) + t_2) / x))));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
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.9d-214) then
tmp = (t_m * sqrt(x)) / l
else if ((t_m <= 7.5d-150) .or. (.not. (t_m <= 2.8d+43))) then
tmp = 1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x)
else
tmp = (sqrt(2.0d0) * t_m) / sqrt((t_2 + (2.0d0 * (((l ** 2.0d0) + t_2) / x))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double t_2 = 2.0 * Math.pow(t_m, 2.0);
double tmp;
if (t_m <= 2.9e-214) {
tmp = (t_m * Math.sqrt(x)) / l;
} else if ((t_m <= 7.5e-150) || !(t_m <= 2.8e+43)) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (Math.sqrt(2.0) * t_m) / Math.sqrt((t_2 + (2.0 * ((Math.pow(l, 2.0) + t_2) / x))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): t_2 = 2.0 * math.pow(t_m, 2.0) tmp = 0 if t_m <= 2.9e-214: tmp = (t_m * math.sqrt(x)) / l elif (t_m <= 7.5e-150) or not (t_m <= 2.8e+43): tmp = 1.0 + (((0.5 / x) + -1.0) / x) else: tmp = (math.sqrt(2.0) * t_m) / math.sqrt((t_2 + (2.0 * ((math.pow(l, 2.0) + t_2) / x)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(2.0 * (t_m ^ 2.0)) tmp = 0.0 if (t_m <= 2.9e-214) tmp = Float64(Float64(t_m * sqrt(x)) / l); elseif ((t_m <= 7.5e-150) || !(t_m <= 2.8e+43)) tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); else tmp = Float64(Float64(sqrt(2.0) * t_m) / sqrt(Float64(t_2 + Float64(2.0 * Float64(Float64((l ^ 2.0) + t_2) / x))))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) t_2 = 2.0 * (t_m ^ 2.0); tmp = 0.0; if (t_m <= 2.9e-214) tmp = (t_m * sqrt(x)) / l; elseif ((t_m <= 7.5e-150) || ~((t_m <= 2.8e+43))) tmp = 1.0 + (((0.5 / x) + -1.0) / x); else tmp = (sqrt(2.0) * t_m) / sqrt((t_2 + (2.0 * (((l ^ 2.0) + t_2) / x)))); end tmp_2 = t_s * tmp; end
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_, 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.9e-214], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[Or[LessEqual[t$95$m, 7.5e-150], N[Not[LessEqual[t$95$m, 2.8e+43]], $MachinePrecision]], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
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.9 \cdot 10^{-214}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t\_m \leq 7.5 \cdot 10^{-150} \lor \neg \left(t\_m \leq 2.8 \cdot 10^{+43}\right):\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t\_m}{\sqrt{t\_2 + 2 \cdot \frac{{\ell}^{2} + t\_2}{x}}}\\
\end{array}
\end{array}
\end{array}
if t < 2.89999999999999985e-214Initial program 31.5%
flip-+15.8%
sub-neg15.8%
metadata-eval15.8%
clear-num15.9%
metadata-eval15.9%
fma-neg15.9%
metadata-eval15.9%
Applied egg-rr15.9%
Taylor expanded in x around inf 53.8%
Taylor expanded in t around 0 19.8%
*-commutative19.8%
Simplified19.8%
Taylor expanded in t around 0 17.3%
associate-*l/19.9%
Simplified19.9%
if 2.89999999999999985e-214 < t < 7.5000000000000004e-150 or 2.80000000000000019e43 < t Initial program 36.0%
Simplified36.2%
Taylor expanded in t around inf 94.7%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified95.1%
Taylor expanded in x around -inf 95.1%
associate-*r/95.1%
sub-neg95.1%
associate-*r/95.1%
metadata-eval95.1%
distribute-frac-neg295.1%
neg-mul-195.1%
distribute-frac-neg95.1%
sub-neg95.1%
distribute-frac-neg295.1%
metadata-eval95.1%
associate-*r/95.1%
sub-neg95.1%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
if 7.5000000000000004e-150 < t < 2.80000000000000019e43Initial program 51.4%
flip-+27.5%
sub-neg27.5%
metadata-eval27.5%
clear-num27.7%
metadata-eval27.7%
fma-neg27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Taylor expanded in x around inf 87.3%
Final simplification52.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) t_m))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (* x (sqrt 2.0))))
(*
t_s
(if (<= t_m 8.8e-225)
(/ (* t_m (sqrt x)) l)
(if (<= t_m 1.5e-148)
(/ t_2 (+ (* 2.0 (/ t_m t_4)) (+ t_2 (/ (pow l 2.0) (* t_m t_4)))))
(if (<= t_m 7e+43)
(/ t_2 (sqrt (+ t_3 (* 2.0 (/ (+ (pow l 2.0) t_3) x)))))
(+ 1.0 (/ (+ (/ 0.5 x) -1.0) x))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = sqrt(2.0) * t_m;
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = x * sqrt(2.0);
double tmp;
if (t_m <= 8.8e-225) {
tmp = (t_m * sqrt(x)) / l;
} else if (t_m <= 1.5e-148) {
tmp = t_2 / ((2.0 * (t_m / t_4)) + (t_2 + (pow(l, 2.0) / (t_m * t_4))));
} else if (t_m <= 7e+43) {
tmp = t_2 / sqrt((t_3 + (2.0 * ((pow(l, 2.0) + t_3) / x))));
} else {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_2 = sqrt(2.0d0) * t_m
t_3 = 2.0d0 * (t_m ** 2.0d0)
t_4 = x * sqrt(2.0d0)
if (t_m <= 8.8d-225) then
tmp = (t_m * sqrt(x)) / l
else if (t_m <= 1.5d-148) then
tmp = t_2 / ((2.0d0 * (t_m / t_4)) + (t_2 + ((l ** 2.0d0) / (t_m * t_4))))
else if (t_m <= 7d+43) then
tmp = t_2 / sqrt((t_3 + (2.0d0 * (((l ** 2.0d0) + t_3) / x))))
else
tmp = 1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double t_2 = Math.sqrt(2.0) * t_m;
double t_3 = 2.0 * Math.pow(t_m, 2.0);
double t_4 = x * Math.sqrt(2.0);
double tmp;
if (t_m <= 8.8e-225) {
tmp = (t_m * Math.sqrt(x)) / l;
} else if (t_m <= 1.5e-148) {
tmp = t_2 / ((2.0 * (t_m / t_4)) + (t_2 + (Math.pow(l, 2.0) / (t_m * t_4))));
} else if (t_m <= 7e+43) {
tmp = t_2 / Math.sqrt((t_3 + (2.0 * ((Math.pow(l, 2.0) + t_3) / x))));
} else {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): t_2 = math.sqrt(2.0) * t_m t_3 = 2.0 * math.pow(t_m, 2.0) t_4 = x * math.sqrt(2.0) tmp = 0 if t_m <= 8.8e-225: tmp = (t_m * math.sqrt(x)) / l elif t_m <= 1.5e-148: tmp = t_2 / ((2.0 * (t_m / t_4)) + (t_2 + (math.pow(l, 2.0) / (t_m * t_4)))) elif t_m <= 7e+43: tmp = t_2 / math.sqrt((t_3 + (2.0 * ((math.pow(l, 2.0) + t_3) / x)))) else: tmp = 1.0 + (((0.5 / x) + -1.0) / x) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(sqrt(2.0) * t_m) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64(x * sqrt(2.0)) tmp = 0.0 if (t_m <= 8.8e-225) tmp = Float64(Float64(t_m * sqrt(x)) / l); elseif (t_m <= 1.5e-148) tmp = Float64(t_2 / Float64(Float64(2.0 * Float64(t_m / t_4)) + Float64(t_2 + Float64((l ^ 2.0) / Float64(t_m * t_4))))); elseif (t_m <= 7e+43) tmp = Float64(t_2 / sqrt(Float64(t_3 + Float64(2.0 * Float64(Float64((l ^ 2.0) + t_3) / x))))); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) t_2 = sqrt(2.0) * t_m; t_3 = 2.0 * (t_m ^ 2.0); t_4 = x * sqrt(2.0); tmp = 0.0; if (t_m <= 8.8e-225) tmp = (t_m * sqrt(x)) / l; elseif (t_m <= 1.5e-148) tmp = t_2 / ((2.0 * (t_m / t_4)) + (t_2 + ((l ^ 2.0) / (t_m * t_4)))); elseif (t_m <= 7e+43) tmp = t_2 / sqrt((t_3 + (2.0 * (((l ^ 2.0) + t_3) / x)))); else tmp = 1.0 + (((0.5 / x) + -1.0) / x); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.8e-225], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t$95$m, 1.5e-148], N[(t$95$2 / N[(N[(2.0 * N[(t$95$m / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / N[(t$95$m * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7e+43], N[(t$95$2 / N[Sqrt[N[(t$95$3 + N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot t\_m\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := x \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.8 \cdot 10^{-225}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t\_m \leq 1.5 \cdot 10^{-148}:\\
\;\;\;\;\frac{t\_2}{2 \cdot \frac{t\_m}{t\_4} + \left(t\_2 + \frac{{\ell}^{2}}{t\_m \cdot t\_4}\right)}\\
\mathbf{elif}\;t\_m \leq 7 \cdot 10^{+43}:\\
\;\;\;\;\frac{t\_2}{\sqrt{t\_3 + 2 \cdot \frac{{\ell}^{2} + t\_3}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\end{array}
\end{array}
\end{array}
if t < 8.8e-225Initial program 31.9%
flip-+16.0%
sub-neg16.0%
metadata-eval16.0%
clear-num16.1%
metadata-eval16.1%
fma-neg16.1%
metadata-eval16.1%
Applied egg-rr16.1%
Taylor expanded in x around inf 53.8%
Taylor expanded in t around 0 19.3%
*-commutative19.3%
Simplified19.3%
Taylor expanded in t around 0 16.8%
associate-*l/19.4%
Simplified19.4%
if 8.8e-225 < t < 1.49999999999999999e-148Initial program 2.5%
flip-+1.9%
sub-neg1.9%
metadata-eval1.9%
clear-num1.9%
metadata-eval1.9%
fma-neg1.9%
metadata-eval1.9%
Applied egg-rr1.9%
Taylor expanded in x around inf 81.8%
if 1.49999999999999999e-148 < t < 7.0000000000000002e43Initial program 51.4%
flip-+27.5%
sub-neg27.5%
metadata-eval27.5%
clear-num27.7%
metadata-eval27.7%
fma-neg27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Taylor expanded in x around inf 87.3%
if 7.0000000000000002e43 < t Initial program 40.0%
Simplified40.2%
Taylor expanded in t around inf 96.7%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified97.1%
Taylor expanded in x around -inf 97.1%
associate-*r/97.1%
sub-neg97.1%
associate-*r/97.1%
metadata-eval97.1%
distribute-frac-neg297.1%
neg-mul-197.1%
distribute-frac-neg97.1%
sub-neg97.1%
distribute-frac-neg297.1%
metadata-eval97.1%
associate-*r/97.1%
sub-neg97.1%
associate-*r/97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification53.0%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= t_m 2.6e-219)
(/ (* t_m (sqrt x)) l)
(if (or (<= t_m 7.5e-150) (not (<= t_m 2.1e+43)))
(+ 1.0 (/ (+ (/ 0.5 x) -1.0) x))
(/
(* (sqrt 2.0) t_m)
(sqrt (+ (* 2.0 (pow t_m 2.0)) (* 2.0 (/ (pow l 2.0) x)))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.6e-219) {
tmp = (t_m * sqrt(x)) / l;
} else if ((t_m <= 7.5e-150) || !(t_m <= 2.1e+43)) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (sqrt(2.0) * t_m) / sqrt(((2.0 * pow(t_m, 2.0)) + (2.0 * (pow(l, 2.0) / x))));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 2.6d-219) then
tmp = (t_m * sqrt(x)) / l
else if ((t_m <= 7.5d-150) .or. (.not. (t_m <= 2.1d+43))) then
tmp = 1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x)
else
tmp = (sqrt(2.0d0) * t_m) / sqrt(((2.0d0 * (t_m ** 2.0d0)) + (2.0d0 * ((l ** 2.0d0) / x))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.6e-219) {
tmp = (t_m * Math.sqrt(x)) / l;
} else if ((t_m <= 7.5e-150) || !(t_m <= 2.1e+43)) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (Math.sqrt(2.0) * t_m) / Math.sqrt(((2.0 * Math.pow(t_m, 2.0)) + (2.0 * (Math.pow(l, 2.0) / x))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if t_m <= 2.6e-219: tmp = (t_m * math.sqrt(x)) / l elif (t_m <= 7.5e-150) or not (t_m <= 2.1e+43): tmp = 1.0 + (((0.5 / x) + -1.0) / x) else: tmp = (math.sqrt(2.0) * t_m) / math.sqrt(((2.0 * math.pow(t_m, 2.0)) + (2.0 * (math.pow(l, 2.0) / x)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (t_m <= 2.6e-219) tmp = Float64(Float64(t_m * sqrt(x)) / l); elseif ((t_m <= 7.5e-150) || !(t_m <= 2.1e+43)) tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); else tmp = Float64(Float64(sqrt(2.0) * t_m) / sqrt(Float64(Float64(2.0 * (t_m ^ 2.0)) + Float64(2.0 * Float64((l ^ 2.0) / x))))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (t_m <= 2.6e-219) tmp = (t_m * sqrt(x)) / l; elseif ((t_m <= 7.5e-150) || ~((t_m <= 2.1e+43))) tmp = 1.0 + (((0.5 / x) + -1.0) / x); else tmp = (sqrt(2.0) * t_m) / sqrt(((2.0 * (t_m ^ 2.0)) + (2.0 * ((l ^ 2.0) / x)))); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.6e-219], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[Or[LessEqual[t$95$m, 7.5e-150], N[Not[LessEqual[t$95$m, 2.1e+43]], $MachinePrecision]], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
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.6 \cdot 10^{-219}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t\_m \leq 7.5 \cdot 10^{-150} \lor \neg \left(t\_m \leq 2.1 \cdot 10^{+43}\right):\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t\_m}{\sqrt{2 \cdot {t\_m}^{2} + 2 \cdot \frac{{\ell}^{2}}{x}}}\\
\end{array}
\end{array}
if t < 2.60000000000000002e-219Initial program 31.5%
flip-+15.8%
sub-neg15.8%
metadata-eval15.8%
clear-num15.9%
metadata-eval15.9%
fma-neg15.9%
metadata-eval15.9%
Applied egg-rr15.9%
Taylor expanded in x around inf 53.8%
Taylor expanded in t around 0 19.8%
*-commutative19.8%
Simplified19.8%
Taylor expanded in t around 0 17.3%
associate-*l/19.9%
Simplified19.9%
if 2.60000000000000002e-219 < t < 7.5000000000000004e-150 or 2.10000000000000002e43 < t Initial program 36.0%
Simplified36.2%
Taylor expanded in t around inf 94.7%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified95.1%
Taylor expanded in x around -inf 95.1%
associate-*r/95.1%
sub-neg95.1%
associate-*r/95.1%
metadata-eval95.1%
distribute-frac-neg295.1%
neg-mul-195.1%
distribute-frac-neg95.1%
sub-neg95.1%
distribute-frac-neg295.1%
metadata-eval95.1%
associate-*r/95.1%
sub-neg95.1%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
if 7.5000000000000004e-150 < t < 2.10000000000000002e43Initial program 51.4%
flip-+27.5%
sub-neg27.5%
metadata-eval27.5%
clear-num27.7%
metadata-eval27.7%
fma-neg27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Taylor expanded in x around inf 87.3%
Taylor expanded in t around 0 85.6%
Final simplification52.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= l 5.8e+193)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(* (sqrt 2.0) (/ t_m (* l (sqrt (/ 2.0 x))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5.8e+193) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = sqrt(2.0) * (t_m / (l * sqrt((2.0 / x))));
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 5.8d+193) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = sqrt(2.0d0) * (t_m / (l * sqrt((2.0d0 / x))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5.8e+193) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = Math.sqrt(2.0) * (t_m / (l * Math.sqrt((2.0 / x))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 5.8e+193: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = math.sqrt(2.0) * (t_m / (l * math.sqrt((2.0 / x)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 5.8e+193) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l * sqrt(Float64(2.0 / x))))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 5.8e+193) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = sqrt(2.0) * (t_m / (l * sqrt((2.0 / x)))); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 5.8e+193], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{+193}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if l < 5.80000000000000026e193Initial program 37.7%
Simplified35.6%
Taylor expanded in t around inf 43.2%
Taylor expanded in t around 0 43.4%
if 5.80000000000000026e193 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 15.4%
Taylor expanded in x around inf 81.0%
Final simplification45.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= l 5e+194)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(/ (/ t_m (pow x -0.5)) l))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5e+194) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m / pow(x, -0.5)) / l;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 5d+194) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = (t_m / (x ** (-0.5d0))) / l
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5e+194) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m / Math.pow(x, -0.5)) / l;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 5e+194: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = (t_m / math.pow(x, -0.5)) / l return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 5e+194) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(Float64(t_m / (x ^ -0.5)) / l); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 5e+194) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = (t_m / (x ^ -0.5)) / l; end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 5e+194], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(t$95$m / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_m}{{x}^{-0.5}}}{\ell}\\
\end{array}
\end{array}
if l < 4.99999999999999989e194Initial program 37.7%
Simplified35.6%
Taylor expanded in t around inf 43.2%
Taylor expanded in t around 0 43.4%
if 4.99999999999999989e194 < l Initial program 0.0%
flip-+0.0%
sub-neg0.0%
metadata-eval0.0%
clear-num0.0%
metadata-eval0.0%
fma-neg0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 21.6%
Taylor expanded in t around 0 80.8%
*-commutative80.8%
Simplified80.8%
*-un-lft-identity80.8%
times-frac80.5%
inv-pow80.5%
sqrt-pow180.5%
metadata-eval80.5%
Applied egg-rr80.5%
*-lft-identity80.5%
associate-*l/80.7%
times-frac80.9%
*-inverses80.9%
Simplified80.9%
Final simplification45.6%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (if (<= l 2.3e+195) (sqrt (/ (+ x -1.0) (+ x 1.0))) (/ (* t_m (sqrt x)) l))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 2.3e+195) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m * sqrt(x)) / l;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 2.3d+195) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = (t_m * sqrt(x)) / l
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 2.3e+195) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m * Math.sqrt(x)) / l;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 2.3e+195: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = (t_m * math.sqrt(x)) / l return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 2.3e+195) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(Float64(t_m * sqrt(x)) / l); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 2.3e+195) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = (t_m * sqrt(x)) / l; end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 2.3e+195], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.3 \cdot 10^{+195}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\end{array}
\end{array}
if l < 2.3000000000000001e195Initial program 37.7%
Simplified35.6%
Taylor expanded in t around inf 43.2%
Taylor expanded in t around 0 43.4%
if 2.3000000000000001e195 < l Initial program 0.0%
flip-+0.0%
sub-neg0.0%
metadata-eval0.0%
clear-num0.0%
metadata-eval0.0%
fma-neg0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 21.6%
Taylor expanded in t around 0 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in t around 0 56.9%
associate-*l/80.8%
Simplified80.8%
Final simplification45.5%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (if (<= l 5e+194) (+ 1.0 (/ (+ (/ 0.5 x) -1.0) x)) (/ (* t_m (sqrt x)) l))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5e+194) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (t_m * sqrt(x)) / l;
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 5d+194) then
tmp = 1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x)
else
tmp = (t_m * sqrt(x)) / l
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 5e+194) {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
} else {
tmp = (t_m * Math.sqrt(x)) / l;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 5e+194: tmp = 1.0 + (((0.5 / x) + -1.0) / x) else: tmp = (t_m * math.sqrt(x)) / l return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 5e+194) tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); else tmp = Float64(Float64(t_m * sqrt(x)) / l); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 5e+194) tmp = 1.0 + (((0.5 / x) + -1.0) / x); else tmp = (t_m * sqrt(x)) / l; end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 5e+194], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 5 \cdot 10^{+194}:\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{\ell}\\
\end{array}
\end{array}
if l < 4.99999999999999989e194Initial program 37.7%
Simplified35.6%
Taylor expanded in t around inf 43.2%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified43.4%
Taylor expanded in x around -inf 43.4%
associate-*r/43.4%
sub-neg43.4%
associate-*r/43.4%
metadata-eval43.4%
distribute-frac-neg243.4%
neg-mul-143.4%
distribute-frac-neg43.4%
sub-neg43.4%
distribute-frac-neg243.4%
metadata-eval43.4%
associate-*r/43.4%
sub-neg43.4%
associate-*r/43.4%
metadata-eval43.4%
Simplified43.4%
if 4.99999999999999989e194 < l Initial program 0.0%
flip-+0.0%
sub-neg0.0%
metadata-eval0.0%
clear-num0.0%
metadata-eval0.0%
fma-neg0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 21.6%
Taylor expanded in t around 0 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in t around 0 56.9%
associate-*l/80.8%
Simplified80.8%
Final simplification45.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= t_m 2.6e-214)
(* (sqrt x) (/ t_m l))
(+ 1.0 (/ (+ (/ 0.5 x) -1.0) x)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.6e-214) {
tmp = sqrt(x) * (t_m / l);
} else {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
}
return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 2.6d-214) then
tmp = sqrt(x) * (t_m / l)
else
tmp = 1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 2.6e-214) {
tmp = Math.sqrt(x) * (t_m / l);
} else {
tmp = 1.0 + (((0.5 / x) + -1.0) / x);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if t_m <= 2.6e-214: tmp = math.sqrt(x) * (t_m / l) else: tmp = 1.0 + (((0.5 / x) + -1.0) / x) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (t_m <= 2.6e-214) tmp = Float64(sqrt(x) * Float64(t_m / l)); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (t_m <= 2.6e-214) tmp = sqrt(x) * (t_m / l); else tmp = 1.0 + (((0.5 / x) + -1.0) / x); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.6e-214], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
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.6 \cdot 10^{-214}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{0.5}{x} + -1}{x}\\
\end{array}
\end{array}
if t < 2.6e-214Initial program 31.5%
flip-+15.8%
sub-neg15.8%
metadata-eval15.8%
clear-num15.9%
metadata-eval15.9%
fma-neg15.9%
metadata-eval15.9%
Applied egg-rr15.9%
Taylor expanded in x around inf 53.8%
Taylor expanded in t around 0 19.8%
*-commutative19.8%
Simplified19.8%
Taylor expanded in t around 0 17.3%
if 2.6e-214 < t Initial program 40.3%
Simplified38.9%
Taylor expanded in t around inf 85.7%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified86.0%
Taylor expanded in x around -inf 86.0%
associate-*r/86.0%
sub-neg86.0%
associate-*r/86.0%
metadata-eval86.0%
distribute-frac-neg286.0%
neg-mul-186.0%
distribute-frac-neg86.0%
sub-neg86.0%
distribute-frac-neg286.0%
metadata-eval86.0%
associate-*r/86.0%
sub-neg86.0%
associate-*r/86.0%
metadata-eval86.0%
Simplified86.0%
Final simplification48.2%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ (+ (/ 0.5 x) -1.0) x))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (((0.5 / x) + -1.0) / x));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + (((0.5d0 / x) + (-1.0d0)) / x))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (((0.5 / x) + -1.0) / x));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * (1.0 + (((0.5 / x) + -1.0) / x))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * Float64(1.0 + Float64(Float64(Float64(0.5 / x) + -1.0) / x))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * (1.0 + (((0.5 / x) + -1.0) / x)); end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(N[(0.5 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{\frac{0.5}{x} + -1}{x}\right)
\end{array}
Initial program 35.4%
Simplified33.5%
Taylor expanded in t around inf 41.5%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
Simplified41.6%
Taylor expanded in x around -inf 41.6%
associate-*r/41.6%
sub-neg41.6%
associate-*r/41.6%
metadata-eval41.6%
distribute-frac-neg241.6%
neg-mul-141.6%
distribute-frac-neg41.6%
sub-neg41.6%
distribute-frac-neg241.6%
metadata-eval41.6%
associate-*r/41.6%
sub-neg41.6%
associate-*r/41.6%
metadata-eval41.6%
Simplified41.6%
Final simplification41.6%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * (1.0 + (-1.0 / x))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * Float64(1.0 + Float64(-1.0 / x))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * (1.0 + (-1.0 / x)); end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 35.4%
Simplified33.5%
Taylor expanded in t around inf 41.5%
Taylor expanded in x around inf 41.5%
Final simplification41.5%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l t_m) :precision binary64 (* t_s 1.0))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * 1.0
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * 1.0) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * 1.0; end
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_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot 1
\end{array}
Initial program 35.4%
Simplified33.5%
Taylor expanded in t around inf 41.5%
Taylor expanded in x around inf 40.8%
herbie shell --seed 2024139
(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)))))