
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0)))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (+ t_3 (pow l_m 2.0)))
(t_5 (+ t_4 t_4)))
(*
t_s
(if (<= t_m 4.4e-274)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 3.3e-124)
(/ t_2 (+ t_2 (* 0.5 (/ t_5 (* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 1.45e+35)
(/
t_2
(sqrt
(+ t_3 (/ (+ t_4 (+ t_4 (/ (+ t_4 (+ t_4 (/ t_5 x))) x))) 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 t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = t_3 + pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 4.4e-274) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 1.45e+35) {
tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + ((t_4 + (t_4 + (t_5 / x))) / x))) / 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
t_3 = 2.0d0 * (t_m ** 2.0d0)
t_4 = t_3 + (l_m ** 2.0d0)
t_5 = t_4 + t_4
if (t_m <= 4.4d-274) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 3.3d-124) then
tmp = t_2 / (t_2 + (0.5d0 * (t_5 / (t_m * (sqrt(2.0d0) * x)))))
else if (t_m <= 1.45d+35) then
tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + ((t_4 + (t_4 + (t_5 / x))) / x))) / 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 t_2 = t_m * Math.sqrt(2.0);
double t_3 = 2.0 * Math.pow(t_m, 2.0);
double t_4 = t_3 + Math.pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 4.4e-274) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (Math.sqrt(2.0) * x)))));
} else if (t_m <= 1.45e+35) {
tmp = t_2 / Math.sqrt((t_3 + ((t_4 + (t_4 + ((t_4 + (t_4 + (t_5 / x))) / x))) / 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): t_2 = t_m * math.sqrt(2.0) t_3 = 2.0 * math.pow(t_m, 2.0) t_4 = t_3 + math.pow(l_m, 2.0) t_5 = t_4 + t_4 tmp = 0 if t_m <= 4.4e-274: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 3.3e-124: tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (math.sqrt(2.0) * x))))) elif t_m <= 1.45e+35: tmp = t_2 / math.sqrt((t_3 + ((t_4 + (t_4 + ((t_4 + (t_4 + (t_5 / x))) / x))) / 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) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64(t_3 + (l_m ^ 2.0)) t_5 = Float64(t_4 + t_4) tmp = 0.0 if (t_m <= 4.4e-274) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 3.3e-124) tmp = Float64(t_2 / Float64(t_2 + Float64(0.5 * Float64(t_5 / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 1.45e+35) tmp = Float64(t_2 / sqrt(Float64(t_3 + Float64(Float64(t_4 + Float64(t_4 + Float64(Float64(t_4 + Float64(t_4 + Float64(t_5 / x))) / x))) / 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) t_2 = t_m * sqrt(2.0); t_3 = 2.0 * (t_m ^ 2.0); t_4 = t_3 + (l_m ^ 2.0); t_5 = t_4 + t_4; tmp = 0.0; if (t_m <= 4.4e-274) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 3.3e-124) tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x))))); elseif (t_m <= 1.45e+35) tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + ((t_4 + (t_4 + (t_5 / x))) / x))) / 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + t$95$4), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 4.4e-274], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-124], N[(t$95$2 / N[(t$95$2 + N[(0.5 * N[(t$95$5 / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.45e+35], N[(t$95$2 / N[Sqrt[N[(t$95$3 + N[(N[(t$95$4 + N[(t$95$4 + N[(N[(t$95$4 + N[(t$95$4 + N[(t$95$5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := t\_3 + {l\_m}^{2}\\
t_5 := t\_4 + t\_4\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.4 \cdot 10^{-274}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-124}:\\
\;\;\;\;\frac{t\_2}{t\_2 + 0.5 \cdot \frac{t\_5}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 1.45 \cdot 10^{+35}:\\
\;\;\;\;\frac{t\_2}{\sqrt{t\_3 + \frac{t\_4 + \left(t\_4 + \frac{t\_4 + \left(t\_4 + \frac{t\_5}{x}\right)}{x}\right)}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 4.3999999999999999e-274Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 4.3999999999999999e-274 < t < 3.29999999999999984e-124Initial program 21.1%
Taylor expanded in x around inf 82.6%
if 3.29999999999999984e-124 < t < 1.44999999999999997e35Initial program 53.6%
Taylor expanded in x around inf 53.5%
Taylor expanded in x around -inf 84.3%
if 1.44999999999999997e35 < t Initial program 31.7%
Simplified31.8%
Taylor expanded in t around inf 93.1%
Taylor expanded in t around 0 93.3%
Final simplification50.7%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0)))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (+ t_3 (pow l_m 2.0)))
(t_5 (+ t_4 t_4)))
(*
t_s
(if (<= t_m 4.5e-273)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 3.3e-124)
(/ t_2 (+ t_2 (* 0.5 (/ t_5 (* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 7e+34)
(/
t_2
(sqrt
(+
t_3
(/
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (/ (pow l_m 2.0) x))
(+ t_5 (/ t_4 x)))
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 t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = t_3 + pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 4.5e-273) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 7e+34) {
tmp = t_2 / sqrt((t_3 + ((((2.0 * (pow(t_m, 2.0) / x)) + (pow(l_m, 2.0) / x)) + (t_5 + (t_4 / x))) / 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
t_3 = 2.0d0 * (t_m ** 2.0d0)
t_4 = t_3 + (l_m ** 2.0d0)
t_5 = t_4 + t_4
if (t_m <= 4.5d-273) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 3.3d-124) then
tmp = t_2 / (t_2 + (0.5d0 * (t_5 / (t_m * (sqrt(2.0d0) * x)))))
else if (t_m <= 7d+34) then
tmp = t_2 / sqrt((t_3 + ((((2.0d0 * ((t_m ** 2.0d0) / x)) + ((l_m ** 2.0d0) / x)) + (t_5 + (t_4 / x))) / 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 t_2 = t_m * Math.sqrt(2.0);
double t_3 = 2.0 * Math.pow(t_m, 2.0);
double t_4 = t_3 + Math.pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 4.5e-273) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (Math.sqrt(2.0) * x)))));
} else if (t_m <= 7e+34) {
tmp = t_2 / Math.sqrt((t_3 + ((((2.0 * (Math.pow(t_m, 2.0) / x)) + (Math.pow(l_m, 2.0) / x)) + (t_5 + (t_4 / x))) / 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): t_2 = t_m * math.sqrt(2.0) t_3 = 2.0 * math.pow(t_m, 2.0) t_4 = t_3 + math.pow(l_m, 2.0) t_5 = t_4 + t_4 tmp = 0 if t_m <= 4.5e-273: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 3.3e-124: tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (math.sqrt(2.0) * x))))) elif t_m <= 7e+34: tmp = t_2 / math.sqrt((t_3 + ((((2.0 * (math.pow(t_m, 2.0) / x)) + (math.pow(l_m, 2.0) / x)) + (t_5 + (t_4 / x))) / 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) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64(t_3 + (l_m ^ 2.0)) t_5 = Float64(t_4 + t_4) tmp = 0.0 if (t_m <= 4.5e-273) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 3.3e-124) tmp = Float64(t_2 / Float64(t_2 + Float64(0.5 * Float64(t_5 / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 7e+34) tmp = Float64(t_2 / sqrt(Float64(t_3 + Float64(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64((l_m ^ 2.0) / x)) + Float64(t_5 + Float64(t_4 / x))) / 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) t_2 = t_m * sqrt(2.0); t_3 = 2.0 * (t_m ^ 2.0); t_4 = t_3 + (l_m ^ 2.0); t_5 = t_4 + t_4; tmp = 0.0; if (t_m <= 4.5e-273) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 3.3e-124) tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x))))); elseif (t_m <= 7e+34) tmp = t_2 / sqrt((t_3 + ((((2.0 * ((t_m ^ 2.0) / x)) + ((l_m ^ 2.0) / x)) + (t_5 + (t_4 / x))) / 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + t$95$4), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 4.5e-273], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-124], N[(t$95$2 / N[(t$95$2 + N[(0.5 * N[(t$95$5 / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7e+34], N[(t$95$2 / N[Sqrt[N[(t$95$3 + N[(N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := t\_3 + {l\_m}^{2}\\
t_5 := t\_4 + t\_4\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.5 \cdot 10^{-273}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-124}:\\
\;\;\;\;\frac{t\_2}{t\_2 + 0.5 \cdot \frac{t\_5}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 7 \cdot 10^{+34}:\\
\;\;\;\;\frac{t\_2}{\sqrt{t\_3 + \frac{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \frac{{l\_m}^{2}}{x}\right) + \left(t\_5 + \frac{t\_4}{x}\right)}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 4.4999999999999996e-273Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 4.4999999999999996e-273 < t < 3.29999999999999984e-124Initial program 21.1%
Taylor expanded in x around inf 82.6%
if 3.29999999999999984e-124 < t < 6.99999999999999996e34Initial program 53.6%
Taylor expanded in x around -inf 83.7%
if 6.99999999999999996e34 < t Initial program 31.7%
Simplified31.8%
Taylor expanded in t around inf 93.1%
Taylor expanded in t around 0 93.3%
Final simplification50.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0)))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (+ t_3 (pow l_m 2.0)))
(t_5 (+ t_4 t_4)))
(*
t_s
(if (<= t_m 1.6e-273)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 3.3e-124)
(/ t_2 (+ t_2 (* 0.5 (/ t_5 (* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 6e+33)
(/ t_2 (sqrt (+ t_3 (/ (+ t_4 (+ t_4 (/ t_5 x))) 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 t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = t_3 + pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 1.6e-273) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 6e+33) {
tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + (t_5 / x))) / 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
t_3 = 2.0d0 * (t_m ** 2.0d0)
t_4 = t_3 + (l_m ** 2.0d0)
t_5 = t_4 + t_4
if (t_m <= 1.6d-273) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 3.3d-124) then
tmp = t_2 / (t_2 + (0.5d0 * (t_5 / (t_m * (sqrt(2.0d0) * x)))))
else if (t_m <= 6d+33) then
tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + (t_5 / x))) / 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 t_2 = t_m * Math.sqrt(2.0);
double t_3 = 2.0 * Math.pow(t_m, 2.0);
double t_4 = t_3 + Math.pow(l_m, 2.0);
double t_5 = t_4 + t_4;
double tmp;
if (t_m <= 1.6e-273) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (Math.sqrt(2.0) * x)))));
} else if (t_m <= 6e+33) {
tmp = t_2 / Math.sqrt((t_3 + ((t_4 + (t_4 + (t_5 / x))) / 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): t_2 = t_m * math.sqrt(2.0) t_3 = 2.0 * math.pow(t_m, 2.0) t_4 = t_3 + math.pow(l_m, 2.0) t_5 = t_4 + t_4 tmp = 0 if t_m <= 1.6e-273: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 3.3e-124: tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (math.sqrt(2.0) * x))))) elif t_m <= 6e+33: tmp = t_2 / math.sqrt((t_3 + ((t_4 + (t_4 + (t_5 / x))) / 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) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64(t_3 + (l_m ^ 2.0)) t_5 = Float64(t_4 + t_4) tmp = 0.0 if (t_m <= 1.6e-273) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 3.3e-124) tmp = Float64(t_2 / Float64(t_2 + Float64(0.5 * Float64(t_5 / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 6e+33) tmp = Float64(t_2 / sqrt(Float64(t_3 + Float64(Float64(t_4 + Float64(t_4 + Float64(t_5 / x))) / 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) t_2 = t_m * sqrt(2.0); t_3 = 2.0 * (t_m ^ 2.0); t_4 = t_3 + (l_m ^ 2.0); t_5 = t_4 + t_4; tmp = 0.0; if (t_m <= 1.6e-273) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 3.3e-124) tmp = t_2 / (t_2 + (0.5 * (t_5 / (t_m * (sqrt(2.0) * x))))); elseif (t_m <= 6e+33) tmp = t_2 / sqrt((t_3 + ((t_4 + (t_4 + (t_5 / x))) / 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + t$95$4), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.6e-273], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-124], N[(t$95$2 / N[(t$95$2 + N[(0.5 * N[(t$95$5 / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6e+33], N[(t$95$2 / N[Sqrt[N[(t$95$3 + N[(N[(t$95$4 + N[(t$95$4 + N[(t$95$5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := t\_3 + {l\_m}^{2}\\
t_5 := t\_4 + t\_4\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.6 \cdot 10^{-273}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-124}:\\
\;\;\;\;\frac{t\_2}{t\_2 + 0.5 \cdot \frac{t\_5}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 6 \cdot 10^{+33}:\\
\;\;\;\;\frac{t\_2}{\sqrt{t\_3 + \frac{t\_4 + \left(t\_4 + \frac{t\_5}{x}\right)}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 1.59999999999999995e-273Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 1.59999999999999995e-273 < t < 3.29999999999999984e-124Initial program 21.1%
Taylor expanded in x around inf 82.6%
if 3.29999999999999984e-124 < t < 5.99999999999999967e33Initial program 53.6%
Taylor expanded in x around inf 53.5%
Taylor expanded in x around -inf 83.7%
if 5.99999999999999967e33 < t Initial program 31.7%
Simplified31.8%
Taylor expanded in t around inf 93.1%
Taylor expanded in t around 0 93.3%
Final simplification50.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0)))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (+ t_3 (pow l_m 2.0))))
(*
t_s
(if (<= t_m 1.15e-273)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 3.3e-124)
(/ t_2 (+ t_2 (* 0.5 (/ (+ t_4 t_4) (* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 3e+35)
(/
(sqrt t_3)
(sqrt
(+
(/ t_4 x)
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_3 (/ (pow l_m 2.0) 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 t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = t_3 + pow(l_m, 2.0);
double tmp;
if (t_m <= 1.15e-273) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * ((t_4 + t_4) / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 3e+35) {
tmp = sqrt(t_3) / sqrt(((t_4 / x) + ((2.0 * (pow(t_m, 2.0) / x)) + (t_3 + (pow(l_m, 2.0) / 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
t_3 = 2.0d0 * (t_m ** 2.0d0)
t_4 = t_3 + (l_m ** 2.0d0)
if (t_m <= 1.15d-273) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 3.3d-124) then
tmp = t_2 / (t_2 + (0.5d0 * ((t_4 + t_4) / (t_m * (sqrt(2.0d0) * x)))))
else if (t_m <= 3d+35) then
tmp = sqrt(t_3) / sqrt(((t_4 / x) + ((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_3 + ((l_m ** 2.0d0) / 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 t_2 = t_m * Math.sqrt(2.0);
double t_3 = 2.0 * Math.pow(t_m, 2.0);
double t_4 = t_3 + Math.pow(l_m, 2.0);
double tmp;
if (t_m <= 1.15e-273) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 3.3e-124) {
tmp = t_2 / (t_2 + (0.5 * ((t_4 + t_4) / (t_m * (Math.sqrt(2.0) * x)))));
} else if (t_m <= 3e+35) {
tmp = Math.sqrt(t_3) / Math.sqrt(((t_4 / x) + ((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_3 + (Math.pow(l_m, 2.0) / 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): t_2 = t_m * math.sqrt(2.0) t_3 = 2.0 * math.pow(t_m, 2.0) t_4 = t_3 + math.pow(l_m, 2.0) tmp = 0 if t_m <= 1.15e-273: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 3.3e-124: tmp = t_2 / (t_2 + (0.5 * ((t_4 + t_4) / (t_m * (math.sqrt(2.0) * x))))) elif t_m <= 3e+35: tmp = math.sqrt(t_3) / math.sqrt(((t_4 / x) + ((2.0 * (math.pow(t_m, 2.0) / x)) + (t_3 + (math.pow(l_m, 2.0) / 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) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64(t_3 + (l_m ^ 2.0)) tmp = 0.0 if (t_m <= 1.15e-273) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 3.3e-124) tmp = Float64(t_2 / Float64(t_2 + Float64(0.5 * Float64(Float64(t_4 + t_4) / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 3e+35) tmp = Float64(sqrt(t_3) / sqrt(Float64(Float64(t_4 / x) + Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_3 + Float64((l_m ^ 2.0) / 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) t_2 = t_m * sqrt(2.0); t_3 = 2.0 * (t_m ^ 2.0); t_4 = t_3 + (l_m ^ 2.0); tmp = 0.0; if (t_m <= 1.15e-273) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 3.3e-124) tmp = t_2 / (t_2 + (0.5 * ((t_4 + t_4) / (t_m * (sqrt(2.0) * x))))); elseif (t_m <= 3e+35) tmp = sqrt(t_3) / sqrt(((t_4 / x) + ((2.0 * ((t_m ^ 2.0) / x)) + (t_3 + ((l_m ^ 2.0) / 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.15e-273], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.3e-124], N[(t$95$2 / N[(t$95$2 + N[(0.5 * N[(N[(t$95$4 + t$95$4), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3e+35], N[(N[Sqrt[t$95$3], $MachinePrecision] / N[Sqrt[N[(N[(t$95$4 / x), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := t\_3 + {l\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.15 \cdot 10^{-273}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 3.3 \cdot 10^{-124}:\\
\;\;\;\;\frac{t\_2}{t\_2 + 0.5 \cdot \frac{t\_4 + t\_4}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 3 \cdot 10^{+35}:\\
\;\;\;\;\frac{\sqrt{t\_3}}{\sqrt{\frac{t\_4}{x} + \left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_3 + \frac{{l\_m}^{2}}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 1.1499999999999999e-273Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 1.1499999999999999e-273 < t < 3.29999999999999984e-124Initial program 21.1%
Taylor expanded in x around inf 82.6%
if 3.29999999999999984e-124 < t < 2.99999999999999991e35Initial program 53.6%
Taylor expanded in x around inf 82.6%
add-sqr-sqrt82.4%
sqrt-prod82.6%
sqrt-prod83.0%
pow1/283.0%
pow283.0%
Applied egg-rr83.0%
unpow1/283.0%
Simplified83.0%
if 2.99999999999999991e35 < t Initial program 31.7%
Simplified31.8%
Taylor expanded in t around inf 93.1%
Taylor expanded in t around 0 93.3%
Final simplification50.5%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0))))
(*
t_s
(if (<= t_m 5e-274)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 2.55e-129)
(/ t_2 (+ t_2 (/ (pow l_m 2.0) (* t_m (* (sqrt 2.0) x)))))
(if (<= t_m 3.1e+34)
(/
t_2
(sqrt
(+
(/ (+ (* 2.0 (pow t_m 2.0)) (pow l_m 2.0)) x)
(+
(/ (pow l_m 2.0) x)
(* (pow t_m 2.0) (+ 2.0 (* 2.0 (/ 1.0 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 t_2 = t_m * sqrt(2.0);
double tmp;
if (t_m <= 5e-274) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 2.55e-129) {
tmp = t_2 / (t_2 + (pow(l_m, 2.0) / (t_m * (sqrt(2.0) * x))));
} else if (t_m <= 3.1e+34) {
tmp = t_2 / sqrt(((((2.0 * pow(t_m, 2.0)) + pow(l_m, 2.0)) / x) + ((pow(l_m, 2.0) / x) + (pow(t_m, 2.0) * (2.0 + (2.0 * (1.0 / 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) :: t_2
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
if (t_m <= 5d-274) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 2.55d-129) then
tmp = t_2 / (t_2 + ((l_m ** 2.0d0) / (t_m * (sqrt(2.0d0) * x))))
else if (t_m <= 3.1d+34) then
tmp = t_2 / sqrt(((((2.0d0 * (t_m ** 2.0d0)) + (l_m ** 2.0d0)) / x) + (((l_m ** 2.0d0) / x) + ((t_m ** 2.0d0) * (2.0d0 + (2.0d0 * (1.0d0 / 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 t_2 = t_m * Math.sqrt(2.0);
double tmp;
if (t_m <= 5e-274) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 2.55e-129) {
tmp = t_2 / (t_2 + (Math.pow(l_m, 2.0) / (t_m * (Math.sqrt(2.0) * x))));
} else if (t_m <= 3.1e+34) {
tmp = t_2 / Math.sqrt(((((2.0 * Math.pow(t_m, 2.0)) + Math.pow(l_m, 2.0)) / x) + ((Math.pow(l_m, 2.0) / x) + (Math.pow(t_m, 2.0) * (2.0 + (2.0 * (1.0 / 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): t_2 = t_m * math.sqrt(2.0) tmp = 0 if t_m <= 5e-274: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 2.55e-129: tmp = t_2 / (t_2 + (math.pow(l_m, 2.0) / (t_m * (math.sqrt(2.0) * x)))) elif t_m <= 3.1e+34: tmp = t_2 / math.sqrt(((((2.0 * math.pow(t_m, 2.0)) + math.pow(l_m, 2.0)) / x) + ((math.pow(l_m, 2.0) / x) + (math.pow(t_m, 2.0) * (2.0 + (2.0 * (1.0 / 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) t_2 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (t_m <= 5e-274) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 2.55e-129) tmp = Float64(t_2 / Float64(t_2 + Float64((l_m ^ 2.0) / Float64(t_m * Float64(sqrt(2.0) * x))))); elseif (t_m <= 3.1e+34) tmp = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(2.0 * (t_m ^ 2.0)) + (l_m ^ 2.0)) / x) + Float64(Float64((l_m ^ 2.0) / x) + Float64((t_m ^ 2.0) * Float64(2.0 + Float64(2.0 * Float64(1.0 / 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) t_2 = t_m * sqrt(2.0); tmp = 0.0; if (t_m <= 5e-274) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 2.55e-129) tmp = t_2 / (t_2 + ((l_m ^ 2.0) / (t_m * (sqrt(2.0) * x)))); elseif (t_m <= 3.1e+34) tmp = t_2 / sqrt(((((2.0 * (t_m ^ 2.0)) + (l_m ^ 2.0)) / x) + (((l_m ^ 2.0) / x) + ((t_m ^ 2.0) * (2.0 + (2.0 * (1.0 / 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 5e-274], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.55e-129], N[(t$95$2 / N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.1e+34], N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-274}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 2.55 \cdot 10^{-129}:\\
\;\;\;\;\frac{t\_2}{t\_2 + \frac{{l\_m}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 3.1 \cdot 10^{+34}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\frac{2 \cdot {t\_m}^{2} + {l\_m}^{2}}{x} + \left(\frac{{l\_m}^{2}}{x} + {t\_m}^{2} \cdot \left(2 + 2 \cdot \frac{1}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 5e-274Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 5e-274 < t < 2.5499999999999999e-129Initial program 17.2%
Taylor expanded in x around inf 81.7%
Taylor expanded in l around inf 81.7%
if 2.5499999999999999e-129 < t < 3.09999999999999977e34Initial program 54.7%
Taylor expanded in x around inf 83.0%
Taylor expanded in t around 0 83.1%
if 3.09999999999999977e34 < t Initial program 31.7%
Simplified31.8%
Taylor expanded in t around inf 93.1%
Taylor expanded in t around 0 93.3%
Final simplification50.5%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0))))
(*
t_s
(if (<= t_m 6.5e-274)
(* (* t_m (/ (sqrt 2.0) l_m)) (sqrt (- (* 0.5 x) 0.5)))
(if (<= t_m 6.1e-44)
(/ t_2 (+ t_2 (/ (pow l_m 2.0) (* t_m (* (sqrt 2.0) 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 t_2 = t_m * sqrt(2.0);
double tmp;
if (t_m <= 6.5e-274) {
tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 6.1e-44) {
tmp = t_2 / (t_2 + (pow(l_m, 2.0) / (t_m * (sqrt(2.0) * 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) :: t_2
real(8) :: tmp
t_2 = t_m * sqrt(2.0d0)
if (t_m <= 6.5d-274) then
tmp = (t_m * (sqrt(2.0d0) / l_m)) * sqrt(((0.5d0 * x) - 0.5d0))
else if (t_m <= 6.1d-44) then
tmp = t_2 / (t_2 + ((l_m ** 2.0d0) / (t_m * (sqrt(2.0d0) * 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 t_2 = t_m * Math.sqrt(2.0);
double tmp;
if (t_m <= 6.5e-274) {
tmp = (t_m * (Math.sqrt(2.0) / l_m)) * Math.sqrt(((0.5 * x) - 0.5));
} else if (t_m <= 6.1e-44) {
tmp = t_2 / (t_2 + (Math.pow(l_m, 2.0) / (t_m * (Math.sqrt(2.0) * 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): t_2 = t_m * math.sqrt(2.0) tmp = 0 if t_m <= 6.5e-274: tmp = (t_m * (math.sqrt(2.0) / l_m)) * math.sqrt(((0.5 * x) - 0.5)) elif t_m <= 6.1e-44: tmp = t_2 / (t_2 + (math.pow(l_m, 2.0) / (t_m * (math.sqrt(2.0) * 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) t_2 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (t_m <= 6.5e-274) tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / l_m)) * sqrt(Float64(Float64(0.5 * x) - 0.5))); elseif (t_m <= 6.1e-44) tmp = Float64(t_2 / Float64(t_2 + Float64((l_m ^ 2.0) / Float64(t_m * Float64(sqrt(2.0) * 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) t_2 = t_m * sqrt(2.0); tmp = 0.0; if (t_m <= 6.5e-274) tmp = (t_m * (sqrt(2.0) / l_m)) * sqrt(((0.5 * x) - 0.5)); elseif (t_m <= 6.1e-44) tmp = t_2 / (t_2 + ((l_m ^ 2.0) / (t_m * (sqrt(2.0) * 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_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 6.5e-274], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.1e-44], N[(t$95$2 / N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $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)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-274}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right) \cdot \sqrt{0.5 \cdot x - 0.5}\\
\mathbf{elif}\;t\_m \leq 6.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{t\_2}{t\_2 + \frac{{l\_m}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 6.49999999999999959e-274Initial program 30.5%
Simplified29.1%
Taylor expanded in l around inf 3.4%
associate-/l*3.4%
associate--l+12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
sub-neg12.4%
metadata-eval12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 20.0%
if 6.49999999999999959e-274 < t < 6.0999999999999996e-44Initial program 29.4%
Taylor expanded in x around inf 66.0%
Taylor expanded in l around inf 65.6%
if 6.0999999999999996e-44 < t Initial program 41.1%
Simplified38.6%
Taylor expanded in t around inf 88.5%
Taylor expanded in t around 0 88.7%
Final simplification47.3%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1.06e+127)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(/ (* t_m (sqrt 2.0)) (* (* (sqrt 2.0) l_m) (sqrt (/ 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.06e+127) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m * sqrt(2.0)) / ((sqrt(2.0) * l_m) * sqrt((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.06d+127) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = (t_m * sqrt(2.0d0)) / ((sqrt(2.0d0) * l_m) * sqrt((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.06e+127) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = (t_m * Math.sqrt(2.0)) / ((Math.sqrt(2.0) * l_m) * Math.sqrt((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.06e+127: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = (t_m * math.sqrt(2.0)) / ((math.sqrt(2.0) * l_m) * math.sqrt((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.06e+127) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(Float64(t_m * sqrt(2.0)) / Float64(Float64(sqrt(2.0) * l_m) * sqrt(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.06e+127) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = (t_m * sqrt(2.0)) / ((sqrt(2.0) * l_m) * sqrt((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.06e+127], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $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 \leq 1.06 \cdot 10^{+127}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{2}}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\end{array}
if l < 1.06000000000000006e127Initial program 37.7%
Simplified33.5%
Taylor expanded in t around inf 38.2%
Taylor expanded in t around 0 38.3%
if 1.06000000000000006e127 < l Initial program 0.4%
Taylor expanded in x around inf 30.3%
Taylor expanded in l around inf 54.4%
Final simplification40.1%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1.22e+126)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(* t_m (* (/ (sqrt 2.0) l_m) (sqrt (* 0.5 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.22e+126) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((0.5 * 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.22d+126) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = t_m * ((sqrt(2.0d0) / l_m) * sqrt((0.5d0 * 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.22e+126) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m * ((Math.sqrt(2.0) / l_m) * Math.sqrt((0.5 * 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.22e+126: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = t_m * ((math.sqrt(2.0) / l_m) * math.sqrt((0.5 * 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.22e+126) 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(0.5 * 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.22e+126) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = t_m * ((sqrt(2.0) / l_m) * sqrt((0.5 * 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.22e+126], 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[(0.5 * x), $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 \leq 1.22 \cdot 10^{+126}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(\frac{\sqrt{2}}{l\_m} \cdot \sqrt{0.5 \cdot x}\right)\\
\end{array}
\end{array}
if l < 1.21999999999999995e126Initial program 37.7%
Simplified33.5%
Taylor expanded in t around inf 38.2%
Taylor expanded in t around 0 38.3%
if 1.21999999999999995e126 < l Initial program 0.4%
Simplified0.4%
Taylor expanded in l around inf 5.4%
associate-/l*5.4%
associate--l+29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
sub-neg29.4%
metadata-eval29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in x around inf 51.6%
*-commutative51.6%
Simplified51.6%
pow151.6%
Applied egg-rr51.6%
unpow151.6%
associate-*l*54.3%
Simplified54.3%
Final simplification40.1%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) 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%
Simplified29.8%
Taylor expanded in t around inf 36.5%
Taylor expanded in t around 0 36.6%
Final simplification36.6%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) 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 + (0.5 / x)) / 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) + (0.5d0 / x)) / 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 + (0.5 / x)) / 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 + (0.5 / x)) / 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(Float64(-1.0 + Float64(0.5 / x)) / 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 + (0.5 / x)) / 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[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / 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 + \frac{0.5}{x}}{x}\right)
\end{array}
Initial program 33.4%
Simplified29.8%
Taylor expanded in t around inf 36.5%
Taylor expanded in t around 0 36.6%
div-inv36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Applied egg-rr36.5%
Taylor expanded in x around inf 36.6%
associate--l+36.6%
metadata-eval36.6%
metadata-eval36.6%
metadata-eval36.6%
rem-square-sqrt0.0%
unpow20.0%
unpow20.0%
associate-/l/0.0%
associate-*r/0.0%
div-sub0.0%
Simplified36.6%
Final simplification36.6%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) 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%
Simplified29.8%
Taylor expanded in t around inf 36.5%
Taylor expanded in x around inf 36.6%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) 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%
Simplified29.8%
Taylor expanded in t around inf 36.5%
Taylor expanded in x around inf 36.5%
herbie shell --seed 2024185
(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)))))