
(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 25 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}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* 2.0 (pow t 2.0)))
(t_2 (+ t_1 (pow l 2.0)))
(t_3 (/ (pow l 2.0) x))
(t_4 (/ (+ x 1.0) (+ x -1.0)))
(t_5 (/ t_2 x))
(t_6 (* (sqrt 2.0) t))
(t_7 (/ t_6 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_4) (* l l)))))
(t_8 (* 2.0 (/ (pow t 2.0) x))))
(if (<= t_7 -5e-226)
(/
t
(/
(sqrt
(+
(+
(/ (+ t_2 t_2) (pow x 2.0))
(+
t_8
(+
(* 2.0 (/ (pow t 2.0) (pow x 3.0)))
(+ t_1 (+ t_3 (/ (pow l 2.0) (pow x 3.0)))))))
(+ t_5 (/ t_2 (pow x 3.0)))))
(sqrt 2.0)))
(if (<= t_7 0.99999)
(log1p (expm1 (/ t_6 (hypot (* (hypot l t_6) (sqrt t_4)) l))))
(if (<= t_7 INFINITY)
(/ t (/ (sqrt (+ t_5 (+ t_8 (+ t_1 t_3)))) (sqrt 2.0)))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 * pow(t, 2.0);
double t_2 = t_1 + pow(l, 2.0);
double t_3 = pow(l, 2.0) / x;
double t_4 = (x + 1.0) / (x + -1.0);
double t_5 = t_2 / x;
double t_6 = sqrt(2.0) * t;
double t_7 = t_6 / sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l)));
double t_8 = 2.0 * (pow(t, 2.0) / x);
double tmp;
if (t_7 <= -5e-226) {
tmp = t / (sqrt(((((t_2 + t_2) / pow(x, 2.0)) + (t_8 + ((2.0 * (pow(t, 2.0) / pow(x, 3.0))) + (t_1 + (t_3 + (pow(l, 2.0) / pow(x, 3.0))))))) + (t_5 + (t_2 / pow(x, 3.0))))) / sqrt(2.0));
} else if (t_7 <= 0.99999) {
tmp = log1p(expm1((t_6 / hypot((hypot(l, t_6) * sqrt(t_4)), l))));
} else if (t_7 <= ((double) INFINITY)) {
tmp = t / (sqrt((t_5 + (t_8 + (t_1 + t_3)))) / sqrt(2.0));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 2.0 * Math.pow(t, 2.0);
double t_2 = t_1 + Math.pow(l, 2.0);
double t_3 = Math.pow(l, 2.0) / x;
double t_4 = (x + 1.0) / (x + -1.0);
double t_5 = t_2 / x;
double t_6 = Math.sqrt(2.0) * t;
double t_7 = t_6 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l)));
double t_8 = 2.0 * (Math.pow(t, 2.0) / x);
double tmp;
if (t_7 <= -5e-226) {
tmp = t / (Math.sqrt(((((t_2 + t_2) / Math.pow(x, 2.0)) + (t_8 + ((2.0 * (Math.pow(t, 2.0) / Math.pow(x, 3.0))) + (t_1 + (t_3 + (Math.pow(l, 2.0) / Math.pow(x, 3.0))))))) + (t_5 + (t_2 / Math.pow(x, 3.0))))) / Math.sqrt(2.0));
} else if (t_7 <= 0.99999) {
tmp = Math.log1p(Math.expm1((t_6 / Math.hypot((Math.hypot(l, t_6) * Math.sqrt(t_4)), l))));
} else if (t_7 <= Double.POSITIVE_INFINITY) {
tmp = t / (Math.sqrt((t_5 + (t_8 + (t_1 + t_3)))) / Math.sqrt(2.0));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 2.0 * math.pow(t, 2.0) t_2 = t_1 + math.pow(l, 2.0) t_3 = math.pow(l, 2.0) / x t_4 = (x + 1.0) / (x + -1.0) t_5 = t_2 / x t_6 = math.sqrt(2.0) * t t_7 = t_6 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l))) t_8 = 2.0 * (math.pow(t, 2.0) / x) tmp = 0 if t_7 <= -5e-226: tmp = t / (math.sqrt(((((t_2 + t_2) / math.pow(x, 2.0)) + (t_8 + ((2.0 * (math.pow(t, 2.0) / math.pow(x, 3.0))) + (t_1 + (t_3 + (math.pow(l, 2.0) / math.pow(x, 3.0))))))) + (t_5 + (t_2 / math.pow(x, 3.0))))) / math.sqrt(2.0)) elif t_7 <= 0.99999: tmp = math.log1p(math.expm1((t_6 / math.hypot((math.hypot(l, t_6) * math.sqrt(t_4)), l)))) elif t_7 <= math.inf: tmp = t / (math.sqrt((t_5 + (t_8 + (t_1 + t_3)))) / math.sqrt(2.0)) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0))))))))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 * (t ^ 2.0)) t_2 = Float64(t_1 + (l ^ 2.0)) t_3 = Float64((l ^ 2.0) / x) t_4 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_5 = Float64(t_2 / x) t_6 = Float64(sqrt(2.0) * t) t_7 = Float64(t_6 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_4) - Float64(l * l)))) t_8 = Float64(2.0 * Float64((t ^ 2.0) / x)) tmp = 0.0 if (t_7 <= -5e-226) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_2 + t_2) / (x ^ 2.0)) + Float64(t_8 + Float64(Float64(2.0 * Float64((t ^ 2.0) / (x ^ 3.0))) + Float64(t_1 + Float64(t_3 + Float64((l ^ 2.0) / (x ^ 3.0))))))) + Float64(t_5 + Float64(t_2 / (x ^ 3.0))))) / sqrt(2.0))); elseif (t_7 <= 0.99999) tmp = log1p(expm1(Float64(t_6 / hypot(Float64(hypot(l, t_6) * sqrt(t_4)), l)))); elseif (t_7 <= Inf) tmp = Float64(t / Float64(sqrt(Float64(t_5 + Float64(t_8 + Float64(t_1 + t_3)))) / sqrt(2.0))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / x), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, -5e-226], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$2 + t$95$2), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$8 + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$3 + N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + N[(t$95$2 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 0.99999], N[Log[1 + N[(Exp[N[(t$95$6 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$6 ^ 2], $MachinePrecision] * N[Sqrt[t$95$4], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$7, Infinity], N[(t / N[(N[Sqrt[N[(t$95$5 + N[(t$95$8 + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
t_2 := t_1 + {\ell}^{2}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \frac{x + 1}{x + -1}\\
t_5 := \frac{t_2}{x}\\
t_6 := \sqrt{2} \cdot t\\
t_7 := \frac{t_6}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_4 - \ell \cdot \ell}}\\
t_8 := 2 \cdot \frac{{t}^{2}}{x}\\
\mathbf{if}\;t_7 \leq -5 \cdot 10^{-226}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_2 + t_2}{{x}^{2}} + \left(t_8 + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_1 + \left(t_3 + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(t_5 + \frac{t_2}{{x}^{3}}\right)}}{\sqrt{2}}}\\
\mathbf{elif}\;t_7 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_6}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_6\right) \cdot \sqrt{t_4}, \ell\right)}\right)\right)\\
\mathbf{elif}\;t_7 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_5 + \left(t_8 + \left(t_1 + t_3\right)\right)}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -4.9999999999999998e-226Initial program 54.5%
Simplified54.5%
Taylor expanded in x around -inf 81.2%
if -4.9999999999999998e-226 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 8.4%
Simplified8.4%
Applied egg-rr98.6%
if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 60.9%
Simplified60.9%
Taylor expanded in x around inf 88.5%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification82.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* 2.0 (pow t 2.0)))
(t_3 (+ t_2 (pow l 2.0)))
(t_4 (/ t_3 x))
(t_5 (* (sqrt 2.0) t))
(t_6 (/ t_5 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_7 (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x)))))
(if (<= t_6 -5e-226)
(/ t (/ (sqrt (+ t_4 (+ (/ (+ t_3 t_3) (pow x 2.0)) t_7))) (sqrt 2.0)))
(if (<= t_6 0.99999)
(log1p (expm1 (/ t_5 (hypot (* (hypot l t_5) (sqrt t_1)) l))))
(if (<= t_6 INFINITY)
(/ t (/ (sqrt (+ t_4 t_7)) (sqrt 2.0)))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = 2.0 * pow(t, 2.0);
double t_3 = t_2 + pow(l, 2.0);
double t_4 = t_3 / x;
double t_5 = sqrt(2.0) * t;
double t_6 = t_5 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_7 = (2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x));
double tmp;
if (t_6 <= -5e-226) {
tmp = t / (sqrt((t_4 + (((t_3 + t_3) / pow(x, 2.0)) + t_7))) / sqrt(2.0));
} else if (t_6 <= 0.99999) {
tmp = log1p(expm1((t_5 / hypot((hypot(l, t_5) * sqrt(t_1)), l))));
} else if (t_6 <= ((double) INFINITY)) {
tmp = t / (sqrt((t_4 + t_7)) / sqrt(2.0));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = 2.0 * Math.pow(t, 2.0);
double t_3 = t_2 + Math.pow(l, 2.0);
double t_4 = t_3 / x;
double t_5 = Math.sqrt(2.0) * t;
double t_6 = t_5 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_7 = (2.0 * (Math.pow(t, 2.0) / x)) + (t_2 + (Math.pow(l, 2.0) / x));
double tmp;
if (t_6 <= -5e-226) {
tmp = t / (Math.sqrt((t_4 + (((t_3 + t_3) / Math.pow(x, 2.0)) + t_7))) / Math.sqrt(2.0));
} else if (t_6 <= 0.99999) {
tmp = Math.log1p(Math.expm1((t_5 / Math.hypot((Math.hypot(l, t_5) * Math.sqrt(t_1)), l))));
} else if (t_6 <= Double.POSITIVE_INFINITY) {
tmp = t / (Math.sqrt((t_4 + t_7)) / Math.sqrt(2.0));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = 2.0 * math.pow(t, 2.0) t_3 = t_2 + math.pow(l, 2.0) t_4 = t_3 / x t_5 = math.sqrt(2.0) * t t_6 = t_5 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_7 = (2.0 * (math.pow(t, 2.0) / x)) + (t_2 + (math.pow(l, 2.0) / x)) tmp = 0 if t_6 <= -5e-226: tmp = t / (math.sqrt((t_4 + (((t_3 + t_3) / math.pow(x, 2.0)) + t_7))) / math.sqrt(2.0)) elif t_6 <= 0.99999: tmp = math.log1p(math.expm1((t_5 / math.hypot((math.hypot(l, t_5) * math.sqrt(t_1)), l)))) elif t_6 <= math.inf: tmp = t / (math.sqrt((t_4 + t_7)) / math.sqrt(2.0)) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0))))))))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(2.0 * (t ^ 2.0)) t_3 = Float64(t_2 + (l ^ 2.0)) t_4 = Float64(t_3 / x) t_5 = Float64(sqrt(2.0) * t) t_6 = Float64(t_5 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_7 = Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x))) tmp = 0.0 if (t_6 <= -5e-226) tmp = Float64(t / Float64(sqrt(Float64(t_4 + Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + t_7))) / sqrt(2.0))); elseif (t_6 <= 0.99999) tmp = log1p(expm1(Float64(t_5 / hypot(Float64(hypot(l, t_5) * sqrt(t_1)), l)))); elseif (t_6 <= Inf) tmp = Float64(t / Float64(sqrt(Float64(t_4 + t_7)) / sqrt(2.0))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / x), $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -5e-226], N[(t / N[(N[Sqrt[N[(t$95$4 + N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 0.99999], N[Log[1 + N[(Exp[N[(t$95$5 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$5 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$6, Infinity], N[(t / N[(N[Sqrt[N[(t$95$4 + t$95$7), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
t_4 := \frac{t_3}{x}\\
t_5 := \sqrt{2} \cdot t\\
t_6 := \frac{t_5}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_7 := 2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\\
\mathbf{if}\;t_6 \leq -5 \cdot 10^{-226}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_4 + \left(\frac{t_3 + t_3}{{x}^{2}} + t_7\right)}}{\sqrt{2}}}\\
\mathbf{elif}\;t_6 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_5}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_5\right) \cdot \sqrt{t_1}, \ell\right)}\right)\right)\\
\mathbf{elif}\;t_6 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_4 + t_7}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -4.9999999999999998e-226Initial program 54.5%
Simplified54.5%
Taylor expanded in x around -inf 80.4%
if -4.9999999999999998e-226 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 8.4%
Simplified8.4%
Applied egg-rr98.6%
if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 60.9%
Simplified60.9%
Taylor expanded in x around inf 88.5%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification82.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* 2.0 (pow t 2.0)))
(t_2 (/ (+ x 1.0) (+ x -1.0)))
(t_3 (* (sqrt 2.0) t))
(t_4 (/ t_3 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_2) (* l l)))))
(t_5
(/
t
(/
(sqrt
(+
(/ (+ t_1 (pow l 2.0)) x)
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 (/ (pow l 2.0) x)))))
(sqrt 2.0)))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 0.99999)
(log1p (expm1 (/ t_3 (hypot (* (hypot l t_3) (sqrt t_2)) l))))
(if (<= t_4 INFINITY)
t_5
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 * pow(t, 2.0);
double t_2 = (x + 1.0) / (x + -1.0);
double t_3 = sqrt(2.0) * t;
double t_4 = t_3 / sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)));
double t_5 = t / (sqrt((((t_1 + pow(l, 2.0)) / x) + ((2.0 * (pow(t, 2.0) / x)) + (t_1 + (pow(l, 2.0) / x))))) / sqrt(2.0));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= 0.99999) {
tmp = log1p(expm1((t_3 / hypot((hypot(l, t_3) * sqrt(t_2)), l))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 2.0 * Math.pow(t, 2.0);
double t_2 = (x + 1.0) / (x + -1.0);
double t_3 = Math.sqrt(2.0) * t;
double t_4 = t_3 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)));
double t_5 = t / (Math.sqrt((((t_1 + Math.pow(l, 2.0)) / x) + ((2.0 * (Math.pow(t, 2.0) / x)) + (t_1 + (Math.pow(l, 2.0) / x))))) / Math.sqrt(2.0));
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_5;
} else if (t_4 <= 0.99999) {
tmp = Math.log1p(Math.expm1((t_3 / Math.hypot((Math.hypot(l, t_3) * Math.sqrt(t_2)), l))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 2.0 * math.pow(t, 2.0) t_2 = (x + 1.0) / (x + -1.0) t_3 = math.sqrt(2.0) * t t_4 = t_3 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l))) t_5 = t / (math.sqrt((((t_1 + math.pow(l, 2.0)) / x) + ((2.0 * (math.pow(t, 2.0) / x)) + (t_1 + (math.pow(l, 2.0) / x))))) / math.sqrt(2.0)) tmp = 0 if t_4 <= -math.inf: tmp = t_5 elif t_4 <= 0.99999: tmp = math.log1p(math.expm1((t_3 / math.hypot((math.hypot(l, t_3) * math.sqrt(t_2)), l)))) elif t_4 <= math.inf: tmp = t_5 else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0))))))))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 * (t ^ 2.0)) t_2 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_3 = Float64(sqrt(2.0) * t) t_4 = Float64(t_3 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_2) - Float64(l * l)))) t_5 = Float64(t / Float64(sqrt(Float64(Float64(Float64(t_1 + (l ^ 2.0)) / x) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + Float64((l ^ 2.0) / x))))) / sqrt(2.0))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= 0.99999) tmp = log1p(expm1(Float64(t_3 / hypot(Float64(hypot(l, t_3) * sqrt(t_2)), l)))); elseif (t_4 <= Inf) tmp = t_5; else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t / N[(N[Sqrt[N[(N[(N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, 0.99999], N[Log[1 + N[(Exp[N[(t$95$3 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
t_2 := \frac{x + 1}{x + -1}\\
t_3 := \sqrt{2} \cdot t\\
t_4 := \frac{t_3}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_2 - \ell \cdot \ell}}\\
t_5 := \frac{t}{\frac{\sqrt{\frac{t_1 + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t_4 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot \sqrt{t_2}, \ell\right)}\right)\right)\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -inf.0 or 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 44.1%
Simplified44.1%
Taylor expanded in x around inf 81.0%
if -inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 36.3%
Simplified36.2%
Applied egg-rr97.0%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification82.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (fma 2.0 (pow t 2.0) (pow l 2.0)))
(t_2 (/ (+ x 1.0) (+ x -1.0)))
(t_3 (* (sqrt 2.0) t))
(t_4 (/ t_3 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_2) (* l l)))))
(t_5 (sqrt t_2)))
(if (<= t_4 -0.5)
(/ t (* (- t) t_5))
(if (<= t_4 0.99999)
(* (/ 1.0 (hypot (* (hypot l t_3) t_5) l)) (/ t (pow 2.0 -0.5)))
(if (<= t_4 INFINITY)
(/ t (+ t (* 0.5 (/ (+ t_1 t_1) (* t (* 2.0 x))))))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = fma(2.0, pow(t, 2.0), pow(l, 2.0));
double t_2 = (x + 1.0) / (x + -1.0);
double t_3 = sqrt(2.0) * t;
double t_4 = t_3 / sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)));
double t_5 = sqrt(t_2);
double tmp;
if (t_4 <= -0.5) {
tmp = t / (-t * t_5);
} else if (t_4 <= 0.99999) {
tmp = (1.0 / hypot((hypot(l, t_3) * t_5), l)) * (t / pow(2.0, -0.5));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t / (t + (0.5 * ((t_1 + t_1) / (t * (2.0 * x)))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = fma(2.0, (t ^ 2.0), (l ^ 2.0)) t_2 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_3 = Float64(sqrt(2.0) * t) t_4 = Float64(t_3 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_2) - Float64(l * l)))) t_5 = sqrt(t_2) tmp = 0.0 if (t_4 <= -0.5) tmp = Float64(t / Float64(Float64(-t) * t_5)); elseif (t_4 <= 0.99999) tmp = Float64(Float64(1.0 / hypot(Float64(hypot(l, t_3) * t_5), l)) * Float64(t / (2.0 ^ -0.5))); elseif (t_4 <= Inf) tmp = Float64(t / Float64(t + Float64(0.5 * Float64(Float64(t_1 + t_1) / Float64(t * Float64(2.0 * x)))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[t$95$2], $MachinePrecision]}, If[LessEqual[t$95$4, -0.5], N[(t / N[((-t) * t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.99999], N[(N[(1.0 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * t$95$5), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t / N[(t + N[(0.5 * N[(N[(t$95$1 + t$95$1), $MachinePrecision] / N[(t * N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)\\
t_2 := \frac{x + 1}{x + -1}\\
t_3 := \sqrt{2} \cdot t\\
t_4 := \frac{t_3}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_2 - \ell \cdot \ell}}\\
t_5 := \sqrt{t_2}\\
\mathbf{if}\;t_4 \leq -0.5:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_5}\\
\mathbf{elif}\;t_4 \leq 0.99999:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot t_5, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{t}{t + 0.5 \cdot \frac{t_1 + t_1}{t \cdot \left(2 \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 53.5%
Simplified53.5%
Taylor expanded in t around -inf 80.1%
associate-*r*80.1%
neg-mul-180.1%
+-commutative80.1%
sub-neg80.1%
metadata-eval80.1%
+-commutative80.1%
Simplified80.1%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 10.4%
Simplified10.3%
Applied egg-rr95.0%
if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 60.9%
Simplified60.9%
Taylor expanded in x around inf 84.3%
sub-neg84.3%
fma-def84.3%
mul-1-neg84.3%
remove-double-neg84.3%
fma-def84.3%
*-commutative84.3%
unpow284.3%
rem-square-sqrt84.3%
Simplified84.3%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification80.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (sqrt t_1))
(t_5 (fma 2.0 (pow t 2.0) (pow l 2.0))))
(if (<= t_3 -1.0)
(/ t (* (- t) t_4))
(if (<= t_3 0.99999)
(log1p (expm1 (/ t_2 (hypot (* (hypot l t_2) t_4) l))))
(if (<= t_3 INFINITY)
(/ t (+ t (* 0.5 (/ (+ t_5 t_5) (* t (* 2.0 x))))))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = sqrt(t_1);
double t_5 = fma(2.0, pow(t, 2.0), pow(l, 2.0));
double tmp;
if (t_3 <= -1.0) {
tmp = t / (-t * t_4);
} else if (t_3 <= 0.99999) {
tmp = log1p(expm1((t_2 / hypot((hypot(l, t_2) * t_4), l))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t / (t + (0.5 * ((t_5 + t_5) / (t * (2.0 * x)))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = sqrt(t_1) t_5 = fma(2.0, (t ^ 2.0), (l ^ 2.0)) tmp = 0.0 if (t_3 <= -1.0) tmp = Float64(t / Float64(Float64(-t) * t_4)); elseif (t_3 <= 0.99999) tmp = log1p(expm1(Float64(t_2 / hypot(Float64(hypot(l, t_2) * t_4), l)))); elseif (t_3 <= Inf) tmp = Float64(t / Float64(t + Float64(0.5 * Float64(Float64(t_5 + t_5) / Float64(t * Float64(2.0 * x)))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1.0], N[(t / N[((-t) * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.99999], N[Log[1 + N[(Exp[N[(t$95$2 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * t$95$4), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t / N[(t + N[(0.5 * N[(N[(t$95$5 + t$95$5), $MachinePrecision] / N[(t * N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \sqrt{t_1}\\
t_5 := \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)\\
\mathbf{if}\;t_3 \leq -1:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\
\mathbf{elif}\;t_3 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)}\right)\right)\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{t}{t + 0.5 \cdot \frac{t_5 + t_5}{t \cdot \left(2 \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1Initial program 52.8%
Simplified52.7%
Taylor expanded in t around -inf 79.7%
associate-*r*79.7%
neg-mul-179.7%
+-commutative79.7%
sub-neg79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
if -1 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 11.5%
Simplified11.5%
Applied egg-rr96.5%
if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 60.9%
Simplified60.9%
Taylor expanded in x around inf 84.3%
sub-neg84.3%
fma-def84.3%
mul-1-neg84.3%
remove-double-neg84.3%
fma-def84.3%
*-commutative84.3%
unpow284.3%
rem-square-sqrt84.3%
Simplified84.3%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification80.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (sqrt t_1))
(t_3 (/ (pow l 2.0) x))
(t_4 (* (sqrt 2.0) t))
(t_5 (/ t_4 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_6 (+ 2.0 (* (/ 1.0 x) 4.0))))
(if (<= t_5 -0.5)
(/ t (* (- t) t_2))
(if (<= t_5 0.99999)
(* (/ 1.0 (hypot (* (hypot l t_4) t_2) l)) (/ t (pow 2.0 -0.5)))
(if (<= t_5 INFINITY)
(/
t
(/
(+
(* 0.5 (* (/ (+ t_3 t_3) t) (sqrt (/ 1.0 t_6))))
(* t (sqrt t_6)))
(sqrt 2.0)))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(t_1);
double t_3 = pow(l, 2.0) / x;
double t_4 = sqrt(2.0) * t;
double t_5 = t_4 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_6 = 2.0 + ((1.0 / x) * 4.0);
double tmp;
if (t_5 <= -0.5) {
tmp = t / (-t * t_2);
} else if (t_5 <= 0.99999) {
tmp = (1.0 / hypot((hypot(l, t_4) * t_2), l)) * (t / pow(2.0, -0.5));
} else if (t_5 <= ((double) INFINITY)) {
tmp = t / (((0.5 * (((t_3 + t_3) / t) * sqrt((1.0 / t_6)))) + (t * sqrt(t_6))) / sqrt(2.0));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(t_1);
double t_3 = Math.pow(l, 2.0) / x;
double t_4 = Math.sqrt(2.0) * t;
double t_5 = t_4 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_6 = 2.0 + ((1.0 / x) * 4.0);
double tmp;
if (t_5 <= -0.5) {
tmp = t / (-t * t_2);
} else if (t_5 <= 0.99999) {
tmp = (1.0 / Math.hypot((Math.hypot(l, t_4) * t_2), l)) * (t / Math.pow(2.0, -0.5));
} else if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t / (((0.5 * (((t_3 + t_3) / t) * Math.sqrt((1.0 / t_6)))) + (t * Math.sqrt(t_6))) / Math.sqrt(2.0));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(t_1) t_3 = math.pow(l, 2.0) / x t_4 = math.sqrt(2.0) * t t_5 = t_4 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_6 = 2.0 + ((1.0 / x) * 4.0) tmp = 0 if t_5 <= -0.5: tmp = t / (-t * t_2) elif t_5 <= 0.99999: tmp = (1.0 / math.hypot((math.hypot(l, t_4) * t_2), l)) * (t / math.pow(2.0, -0.5)) elif t_5 <= math.inf: tmp = t / (((0.5 * (((t_3 + t_3) / t) * math.sqrt((1.0 / t_6)))) + (t * math.sqrt(t_6))) / math.sqrt(2.0)) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0))))))))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = sqrt(t_1) t_3 = Float64((l ^ 2.0) / x) t_4 = Float64(sqrt(2.0) * t) t_5 = Float64(t_4 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_6 = Float64(2.0 + Float64(Float64(1.0 / x) * 4.0)) tmp = 0.0 if (t_5 <= -0.5) tmp = Float64(t / Float64(Float64(-t) * t_2)); elseif (t_5 <= 0.99999) tmp = Float64(Float64(1.0 / hypot(Float64(hypot(l, t_4) * t_2), l)) * Float64(t / (2.0 ^ -0.5))); elseif (t_5 <= Inf) tmp = Float64(t / Float64(Float64(Float64(0.5 * Float64(Float64(Float64(t_3 + t_3) / t) * sqrt(Float64(1.0 / t_6)))) + Float64(t * sqrt(t_6))) / sqrt(2.0))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(t_1); t_3 = (l ^ 2.0) / x; t_4 = sqrt(2.0) * t; t_5 = t_4 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_6 = 2.0 + ((1.0 / x) * 4.0); tmp = 0.0; if (t_5 <= -0.5) tmp = t / (-t * t_2); elseif (t_5 <= 0.99999) tmp = (1.0 / hypot((hypot(l, t_4) * t_2), l)) * (t / (2.0 ^ -0.5)); elseif (t_5 <= Inf) tmp = t / (((0.5 * (((t_3 + t_3) / t) * sqrt((1.0 / t_6)))) + (t * sqrt(t_6))) / sqrt(2.0)); else tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / (x ^ 3.0)) + (1.0 / (x ^ 4.0))))))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(2.0 + N[(N[(1.0 / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -0.5], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.99999], N[(N[(1.0 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$4 ^ 2], $MachinePrecision] * t$95$2), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t / N[(N[(N[(0.5 * N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[t$95$6], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{t_1}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \sqrt{2} \cdot t\\
t_5 := \frac{t_4}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_6 := 2 + \frac{1}{x} \cdot 4\\
\mathbf{if}\;t_5 \leq -0.5:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\
\mathbf{elif}\;t_5 \leq 0.99999:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_4\right) \cdot t_2, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{0.5 \cdot \left(\frac{t_3 + t_3}{t} \cdot \sqrt{\frac{1}{t_6}}\right) + t \cdot \sqrt{t_6}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 53.5%
Simplified53.5%
Taylor expanded in t around -inf 80.1%
associate-*r*80.1%
neg-mul-180.1%
+-commutative80.1%
sub-neg80.1%
metadata-eval80.1%
+-commutative80.1%
Simplified80.1%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046Initial program 10.4%
Simplified10.3%
Applied egg-rr95.0%
if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 60.9%
Simplified60.9%
Taylor expanded in x around inf 88.5%
Taylor expanded in t around inf 84.2%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification80.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (sqrt t_1)))
(if (<= t_3 -0.5)
(/ t (* (- t) t_4))
(if (<= t_3 5e-271)
(* (/ 1.0 (hypot (* (hypot l t_2) t_4) l)) (/ t (pow 2.0 -0.5)))
(if (<= t_3 INFINITY)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+
(/ 1.0 x)
(+
(* (/ 1.0 x) (/ 1.0 x))
(+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = sqrt(t_1);
double tmp;
if (t_3 <= -0.5) {
tmp = t / (-t * t_4);
} else if (t_3 <= 5e-271) {
tmp = (1.0 / hypot((hypot(l, t_2) * t_4), l)) * (t / pow(2.0, -0.5));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(2.0) * t;
double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = Math.sqrt(t_1);
double tmp;
if (t_3 <= -0.5) {
tmp = t / (-t * t_4);
} else if (t_3 <= 5e-271) {
tmp = (1.0 / Math.hypot((Math.hypot(l, t_2) * t_4), l)) * (t / Math.pow(2.0, -0.5));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(2.0) * t t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_4 = math.sqrt(t_1) tmp = 0 if t_3 <= -0.5: tmp = t / (-t * t_4) elif t_3 <= 5e-271: tmp = (1.0 / math.hypot((math.hypot(l, t_2) * t_4), l)) * (t / math.pow(2.0, -0.5)) elif t_3 <= math.inf: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0))))))))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = sqrt(t_1) tmp = 0.0 if (t_3 <= -0.5) tmp = Float64(t / Float64(Float64(-t) * t_4)); elseif (t_3 <= 5e-271) tmp = Float64(Float64(1.0 / hypot(Float64(hypot(l, t_2) * t_4), l)) * Float64(t / (2.0 ^ -0.5))); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0)))))))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(2.0) * t; t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_4 = sqrt(t_1); tmp = 0.0; if (t_3 <= -0.5) tmp = t / (-t * t_4); elseif (t_3 <= 5e-271) tmp = (1.0 / hypot((hypot(l, t_2) * t_4), l)) * (t / (2.0 ^ -0.5)); elseif (t_3 <= Inf) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / (x ^ 3.0)) + (1.0 / (x ^ 4.0))))))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], N[(t / N[((-t) * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e-271], N[(N[(1.0 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * t$95$4), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \sqrt{t_1}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-271}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 53.5%
Simplified53.5%
Taylor expanded in t around -inf 80.1%
associate-*r*80.1%
neg-mul-180.1%
+-commutative80.1%
sub-neg80.1%
metadata-eval80.1%
+-commutative80.1%
Simplified80.1%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 5.0000000000000002e-271Initial program 7.6%
Simplified7.6%
Applied egg-rr94.9%
if 5.0000000000000002e-271 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 61.7%
Simplified61.7%
Applied egg-rr67.6%
Taylor expanded in l around 0 84.6%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 9.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 49.0%
inv-pow49.0%
unpow249.0%
pow-prod-down49.0%
inv-pow49.0%
inv-pow49.0%
Applied egg-rr49.0%
Final simplification80.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -4e-133)
(log1p (expm1 (- t_1)))
(if (<= t -1.7e-169)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t -1e-219)
(+ -1.0 (/ 1.0 x))
(if (<= t 2.35e-203)
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+ (/ 1.0 x) (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 2.0)))))))))
t_1))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4e-133) {
tmp = log1p(expm1(-t_1));
} else if (t <= -1.7e-169) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= -1e-219) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.35e-203) {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 2.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4e-133) {
tmp = Math.log1p(Math.expm1(-t_1));
} else if (t <= -1.7e-169) {
tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
} else if (t <= -1e-219) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.35e-203) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 2.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -4e-133: tmp = math.log1p(math.expm1(-t_1)) elif t <= -1.7e-169: tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0)) elif t <= -1e-219: tmp = -1.0 + (1.0 / x) elif t <= 2.35e-203: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 2.0)))))))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4e-133) tmp = log1p(expm1(Float64(-t_1))); elseif (t <= -1.7e-169) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= -1e-219) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 2.35e-203) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 2.0))))))))); else tmp = t_1; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4e-133], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -1.7e-169], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1e-219], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-203], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-169}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-219}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-203}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{2}}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.0000000000000003e-133Initial program 38.8%
Simplified38.7%
Applied egg-rr76.5%
Taylor expanded in t around -inf 83.6%
expm1-def83.6%
mul-1-neg83.6%
sub-neg83.6%
metadata-eval83.6%
Simplified83.6%
if -4.0000000000000003e-133 < t < -1.7e-169Initial program 1.5%
Simplified1.5%
Taylor expanded in x around inf 73.9%
Taylor expanded in l around inf 31.7%
*-commutative31.7%
Simplified31.7%
if -1.7e-169 < t < -1e-219Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -1e-219 < t < 2.35000000000000003e-203Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.6%
if 2.35000000000000003e-203 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -4.4e-136)
(log1p (expm1 (- t_1)))
(if (<= t -3.1e-169)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t -3.4e-220)
(+ -1.0 (/ 1.0 x))
(if (<= t 7.1e-193)
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 2.0))))))))
t_1))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4.4e-136) {
tmp = log1p(expm1(-t_1));
} else if (t <= -3.1e-169) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= -3.4e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.1e-193) {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / pow(x, 2.0)))))));
} else {
tmp = t_1;
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4.4e-136) {
tmp = Math.log1p(Math.expm1(-t_1));
} else if (t <= -3.1e-169) {
tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
} else if (t <= -3.4e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.1e-193) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 2.0)))))));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -4.4e-136: tmp = math.log1p(math.expm1(-t_1)) elif t <= -3.1e-169: tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0)) elif t <= -3.4e-220: tmp = -1.0 + (1.0 / x) elif t <= 7.1e-193: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / math.pow(x, 2.0))))))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4.4e-136) tmp = log1p(expm1(Float64(-t_1))); elseif (t <= -3.1e-169) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= -3.4e-220) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 7.1e-193) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0)))))))); else tmp = t_1; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.4e-136], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -3.1e-169], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.4e-220], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.1e-193], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-136}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-169}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-220}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 7.1 \cdot 10^{-193}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.4000000000000002e-136Initial program 38.8%
Simplified38.7%
Applied egg-rr76.5%
Taylor expanded in t around -inf 83.6%
expm1-def83.6%
mul-1-neg83.6%
sub-neg83.6%
metadata-eval83.6%
Simplified83.6%
if -4.4000000000000002e-136 < t < -3.1000000000000002e-169Initial program 1.5%
Simplified1.5%
Taylor expanded in x around inf 73.9%
Taylor expanded in l around inf 31.7%
*-commutative31.7%
Simplified31.7%
if -3.1000000000000002e-169 < t < -3.39999999999999993e-220Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -3.39999999999999993e-220 < t < 7.1000000000000004e-193Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.5%
if 7.1000000000000004e-193 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.8e-144)
(log1p (expm1 (- t_1)))
(if (<= t -2.2e-170)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t -1.05e-219)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.3e-194)
(*
(sqrt 2.0)
(* t (/ 1.0 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x)))))))
t_1))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.8e-144) {
tmp = log1p(expm1(-t_1));
} else if (t <= -2.2e-170) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= -1.05e-219) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.3e-194) {
tmp = sqrt(2.0) * (t * (1.0 / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))));
} else {
tmp = t_1;
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.8e-144) {
tmp = Math.log1p(Math.expm1(-t_1));
} else if (t <= -2.2e-170) {
tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
} else if (t <= -1.05e-219) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.3e-194) {
tmp = Math.sqrt(2.0) * (t * (1.0 / (l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -3.8e-144: tmp = math.log1p(math.expm1(-t_1)) elif t <= -2.2e-170: tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0)) elif t <= -1.05e-219: tmp = -1.0 + (1.0 / x) elif t <= 1.3e-194: tmp = math.sqrt(2.0) * (t * (1.0 / (l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.8e-144) tmp = log1p(expm1(Float64(-t_1))); elseif (t <= -2.2e-170) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= -1.05e-219) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.3e-194) tmp = Float64(sqrt(2.0) * Float64(t * Float64(1.0 / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x))))))); else tmp = t_1; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.8e-144], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -2.2e-170], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.05e-219], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-194], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(1.0 / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-170}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-219}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-194}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.79999999999999993e-144Initial program 38.8%
Simplified38.7%
Applied egg-rr76.5%
Taylor expanded in t around -inf 83.6%
expm1-def83.6%
mul-1-neg83.6%
sub-neg83.6%
metadata-eval83.6%
Simplified83.6%
if -3.79999999999999993e-144 < t < -2.20000000000000015e-170Initial program 1.5%
Simplified1.5%
Taylor expanded in x around inf 73.9%
Taylor expanded in l around inf 31.7%
*-commutative31.7%
Simplified31.7%
if -2.20000000000000015e-170 < t < -1.05e-219Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -1.05e-219 < t < 1.30000000000000001e-194Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.2%
div-inv65.2%
+-commutative65.2%
Applied egg-rr65.2%
if 1.30000000000000001e-194 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x)))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.3e-136)
(log1p (expm1 (- t_2)))
(if (<= t -3.1e-168)
(* (sqrt 2.0) (/ t t_1))
(if (<= t -8.2e-221)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.4e-191) (* (sqrt 2.0) (* t (/ 1.0 t_1))) t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.3e-136) {
tmp = log1p(expm1(-t_2));
} else if (t <= -3.1e-168) {
tmp = sqrt(2.0) * (t / t_1);
} else if (t <= -8.2e-221) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.4e-191) {
tmp = sqrt(2.0) * (t * (1.0 / t_1));
} else {
tmp = t_2;
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.3e-136) {
tmp = Math.log1p(Math.expm1(-t_2));
} else if (t <= -3.1e-168) {
tmp = Math.sqrt(2.0) * (t / t_1);
} else if (t <= -8.2e-221) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.4e-191) {
tmp = Math.sqrt(2.0) * (t * (1.0 / t_1));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -3.3e-136: tmp = math.log1p(math.expm1(-t_2)) elif t <= -3.1e-168: tmp = math.sqrt(2.0) * (t / t_1) elif t <= -8.2e-221: tmp = -1.0 + (1.0 / x) elif t <= 1.4e-191: tmp = math.sqrt(2.0) * (t * (1.0 / t_1)) else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.3e-136) tmp = log1p(expm1(Float64(-t_2))); elseif (t <= -3.1e-168) tmp = Float64(sqrt(2.0) * Float64(t / t_1)); elseif (t <= -8.2e-221) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.4e-191) tmp = Float64(sqrt(2.0) * Float64(t * Float64(1.0 / t_1))); else tmp = t_2; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.3e-136], N[Log[1 + N[(Exp[(-t$95$2)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -3.1e-168], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.2e-221], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-191], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-136}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_2\right)\right)\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-168}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-221}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-191}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.30000000000000018e-136Initial program 38.8%
Simplified38.7%
Applied egg-rr76.5%
Taylor expanded in t around -inf 83.6%
expm1-def83.6%
mul-1-neg83.6%
sub-neg83.6%
metadata-eval83.6%
Simplified83.6%
if -3.30000000000000018e-136 < t < -3.1e-168Initial program 1.5%
Simplified1.5%
Taylor expanded in l around inf 1.8%
associate--l+20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around inf 31.4%
if -3.1e-168 < t < -8.19999999999999962e-221Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -8.19999999999999962e-221 < t < 1.40000000000000006e-191Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.2%
div-inv65.2%
+-commutative65.2%
Applied egg-rr65.2%
if 1.40000000000000006e-191 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))))))
(if (<= t -8e-139)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -3.4e-169)
(* (sqrt 2.0) (/ t t_1))
(if (<= t -9.5e-220)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.24e-200)
(* (sqrt 2.0) (* t (/ 1.0 t_1)))
(sqrt (/ (+ x -1.0) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double tmp;
if (t <= -8e-139) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -3.4e-169) {
tmp = sqrt(2.0) * (t / t_1);
} else if (t <= -9.5e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.24e-200) {
tmp = sqrt(2.0) * (t * (1.0 / t_1));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = l * sqrt(((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x)))
if (t <= (-8d-139)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= (-3.4d-169)) then
tmp = sqrt(2.0d0) * (t / t_1)
else if (t <= (-9.5d-220)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 1.24d-200) then
tmp = sqrt(2.0d0) * (t * (1.0d0 / t_1))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double tmp;
if (t <= -8e-139) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -3.4e-169) {
tmp = Math.sqrt(2.0) * (t / t_1);
} else if (t <= -9.5e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.24e-200) {
tmp = Math.sqrt(2.0) * (t * (1.0 / t_1));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))) tmp = 0 if t <= -8e-139: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= -3.4e-169: tmp = math.sqrt(2.0) * (t / t_1) elif t <= -9.5e-220: tmp = -1.0 + (1.0 / x) elif t <= 1.24e-200: tmp = math.sqrt(2.0) * (t * (1.0 / t_1)) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))) tmp = 0.0 if (t <= -8e-139) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= -3.4e-169) tmp = Float64(sqrt(2.0) * Float64(t / t_1)); elseif (t <= -9.5e-220) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.24e-200) tmp = Float64(sqrt(2.0) * Float64(t * Float64(1.0 / t_1))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))); tmp = 0.0; if (t <= -8e-139) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= -3.4e-169) tmp = sqrt(2.0) * (t / t_1); elseif (t <= -9.5e-220) tmp = -1.0 + (1.0 / x); elseif (t <= 1.24e-200) tmp = sqrt(2.0) * (t * (1.0 / t_1)); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-139], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.4e-169], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9.5e-220], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.24e-200], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}\\
\mathbf{if}\;t \leq -8 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-220}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.24 \cdot 10^{-200}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -8.00000000000000024e-139Initial program 38.8%
Simplified38.7%
Taylor expanded in t around -inf 83.6%
associate-*r*83.6%
neg-mul-183.6%
+-commutative83.6%
sub-neg83.6%
metadata-eval83.6%
+-commutative83.6%
Simplified83.6%
if -8.00000000000000024e-139 < t < -3.4e-169Initial program 1.5%
Simplified1.5%
Taylor expanded in l around inf 1.8%
associate--l+20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around inf 31.4%
if -3.4e-169 < t < -9.50000000000000062e-220Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -9.50000000000000062e-220 < t < 1.24e-200Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.2%
div-inv65.2%
+-commutative65.2%
Applied egg-rr65.2%
if 1.24e-200 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))))))))
(if (<= t -3.5e-144)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -1.4e-168)
t_1
(if (<= t -9.2e-220)
(+ -1.0 (/ 1.0 x))
(if (<= t 2.25e-191) t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
double tmp;
if (t <= -3.5e-144) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.4e-168) {
tmp = t_1;
} else if (t <= -9.2e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.25e-191) {
tmp = t_1;
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(2.0d0) * (t / (l * sqrt(((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x)))))
if (t <= (-3.5d-144)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= (-1.4d-168)) then
tmp = t_1
else if (t <= (-9.2d-220)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 2.25d-191) then
tmp = t_1
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
double tmp;
if (t <= -3.5e-144) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.4e-168) {
tmp = t_1;
} else if (t <= -9.2e-220) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.25e-191) {
tmp = t_1;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))) tmp = 0 if t <= -3.5e-144: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= -1.4e-168: tmp = t_1 elif t <= -9.2e-220: tmp = -1.0 + (1.0 / x) elif t <= 2.25e-191: tmp = t_1 else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))))) tmp = 0.0 if (t <= -3.5e-144) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= -1.4e-168) tmp = t_1; elseif (t <= -9.2e-220) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 2.25e-191) tmp = t_1; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))); tmp = 0.0; if (t <= -3.5e-144) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= -1.4e-168) tmp = t_1; elseif (t <= -9.2e-220) tmp = -1.0 + (1.0 / x); elseif (t <= 2.25e-191) tmp = t_1; else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-144], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.4e-168], t$95$1, If[LessEqual[t, -9.2e-220], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e-191], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-144}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-168}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-220}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.4999999999999998e-144Initial program 38.8%
Simplified38.7%
Taylor expanded in t around -inf 83.6%
associate-*r*83.6%
neg-mul-183.6%
+-commutative83.6%
sub-neg83.6%
metadata-eval83.6%
+-commutative83.6%
Simplified83.6%
if -3.4999999999999998e-144 < t < -1.4000000000000001e-168 or -9.19999999999999922e-220 < t < 2.25000000000000004e-191Initial program 8.0%
Simplified8.0%
Taylor expanded in l around inf 9.3%
associate--l+37.1%
sub-neg37.1%
metadata-eval37.1%
+-commutative37.1%
sub-neg37.1%
metadata-eval37.1%
+-commutative37.1%
Simplified37.1%
Taylor expanded in x around inf 56.5%
if -1.4000000000000001e-168 < t < -9.19999999999999922e-220Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if 2.25000000000000004e-191 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))))))
(if (<= t -4.9e-142)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -8e-169)
(* (sqrt 2.0) (/ t t_1))
(if (<= t -4.4e-228)
(+ -1.0 (/ 1.0 x))
(if (<= t 7.2e-204)
(/ (* (sqrt 2.0) t) t_1)
(sqrt (/ (+ x -1.0) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double tmp;
if (t <= -4.9e-142) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -8e-169) {
tmp = sqrt(2.0) * (t / t_1);
} else if (t <= -4.4e-228) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.2e-204) {
tmp = (sqrt(2.0) * t) / t_1;
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = l * sqrt(((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x)))
if (t <= (-4.9d-142)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= (-8d-169)) then
tmp = sqrt(2.0d0) * (t / t_1)
else if (t <= (-4.4d-228)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 7.2d-204) then
tmp = (sqrt(2.0d0) * t) / t_1
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
double tmp;
if (t <= -4.9e-142) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -8e-169) {
tmp = Math.sqrt(2.0) * (t / t_1);
} else if (t <= -4.4e-228) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 7.2e-204) {
tmp = (Math.sqrt(2.0) * t) / t_1;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))) tmp = 0 if t <= -4.9e-142: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= -8e-169: tmp = math.sqrt(2.0) * (t / t_1) elif t <= -4.4e-228: tmp = -1.0 + (1.0 / x) elif t <= 7.2e-204: tmp = (math.sqrt(2.0) * t) / t_1 else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))) tmp = 0.0 if (t <= -4.9e-142) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= -8e-169) tmp = Float64(sqrt(2.0) * Float64(t / t_1)); elseif (t <= -4.4e-228) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 7.2e-204) tmp = Float64(Float64(sqrt(2.0) * t) / t_1); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))); tmp = 0.0; if (t <= -4.9e-142) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= -8e-169) tmp = sqrt(2.0) * (t / t_1); elseif (t <= -4.4e-228) tmp = -1.0 + (1.0 / x); elseif (t <= 7.2e-204) tmp = (sqrt(2.0) * t) / t_1; else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.9e-142], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8e-169], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.4e-228], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-204], N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / t$95$1), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{-142}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-228}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-204}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -4.9000000000000003e-142Initial program 38.8%
Simplified38.7%
Taylor expanded in t around -inf 83.6%
associate-*r*83.6%
neg-mul-183.6%
+-commutative83.6%
sub-neg83.6%
metadata-eval83.6%
+-commutative83.6%
Simplified83.6%
if -4.9000000000000003e-142 < t < -8.00000000000000016e-169Initial program 1.5%
Simplified1.5%
Taylor expanded in l around inf 1.8%
associate--l+20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around inf 31.4%
if -8.00000000000000016e-169 < t < -4.4000000000000001e-228Initial program 11.9%
Simplified11.9%
Applied egg-rr41.9%
Taylor expanded in l around 0 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt76.4%
Simplified76.4%
if -4.4000000000000001e-228 < t < 7.1999999999999993e-204Initial program 10.2%
Simplified10.3%
Taylor expanded in l around inf 12.0%
associate--l+43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
sub-neg43.0%
metadata-eval43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 65.2%
associate-*r/65.2%
*-commutative65.2%
+-commutative65.2%
Applied egg-rr65.2%
if 7.1999999999999993e-204 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -4.9e-240)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t 1.16e-200)
(* (/ (* (sqrt 2.0) t) l) (sqrt (- (* x 0.5) 0.25)))
(sqrt (/ (+ x -1.0) (+ x 1.0))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4.9e-240) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 1.16e-200) {
tmp = ((sqrt(2.0) * t) / l) * sqrt(((x * 0.5) - 0.25));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.9d-240)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= 1.16d-200) then
tmp = ((sqrt(2.0d0) * t) / l) * sqrt(((x * 0.5d0) - 0.25d0))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -4.9e-240) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 1.16e-200) {
tmp = ((Math.sqrt(2.0) * t) / l) * Math.sqrt(((x * 0.5) - 0.25));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4.9e-240: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= 1.16e-200: tmp = ((math.sqrt(2.0) * t) / l) * math.sqrt(((x * 0.5) - 0.25)) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4.9e-240) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= 1.16e-200) tmp = Float64(Float64(Float64(sqrt(2.0) * t) / l) * sqrt(Float64(Float64(x * 0.5) - 0.25))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4.9e-240) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= 1.16e-200) tmp = ((sqrt(2.0) * t) / l) * sqrt(((x * 0.5) - 0.25)); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -4.9e-240], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e-200], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{-240}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-200}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x \cdot 0.5 - 0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -4.90000000000000012e-240Initial program 33.5%
Simplified33.5%
Taylor expanded in t around -inf 78.1%
associate-*r*78.1%
neg-mul-178.1%
+-commutative78.1%
sub-neg78.1%
metadata-eval78.1%
+-commutative78.1%
Simplified78.1%
if -4.90000000000000012e-240 < t < 1.1600000000000001e-200Initial program 11.1%
Simplified11.1%
Taylor expanded in l around inf 13.1%
associate--l+47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
Simplified47.0%
Taylor expanded in x around inf 71.8%
Taylor expanded in t around 0 67.1%
Taylor expanded in x around inf 67.1%
if 1.1600000000000001e-200 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -3.55e-240)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t 7.8e-199)
(* (/ (* (sqrt 2.0) t) l) (sqrt (* x 0.5)))
(sqrt (/ (+ x -1.0) (+ x 1.0))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -3.55e-240) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 7.8e-199) {
tmp = ((sqrt(2.0) * t) / l) * sqrt((x * 0.5));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.55d-240)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= 7.8d-199) then
tmp = ((sqrt(2.0d0) * t) / l) * sqrt((x * 0.5d0))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -3.55e-240) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 7.8e-199) {
tmp = ((Math.sqrt(2.0) * t) / l) * Math.sqrt((x * 0.5));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -3.55e-240: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= 7.8e-199: tmp = ((math.sqrt(2.0) * t) / l) * math.sqrt((x * 0.5)) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -3.55e-240) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= 7.8e-199) tmp = Float64(Float64(Float64(sqrt(2.0) * t) / l) * sqrt(Float64(x * 0.5))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -3.55e-240) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= 7.8e-199) tmp = ((sqrt(2.0) * t) / l) * sqrt((x * 0.5)); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -3.55e-240], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-199], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.55 \cdot 10^{-240}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-199}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.54999999999999976e-240Initial program 33.5%
Simplified33.5%
Taylor expanded in t around -inf 78.1%
associate-*r*78.1%
neg-mul-178.1%
+-commutative78.1%
sub-neg78.1%
metadata-eval78.1%
+-commutative78.1%
Simplified78.1%
if -3.54999999999999976e-240 < t < 7.8000000000000002e-199Initial program 11.1%
Simplified11.1%
Taylor expanded in l around inf 13.1%
associate--l+47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
Simplified47.0%
Taylor expanded in x around inf 71.8%
Taylor expanded in t around 0 67.1%
Taylor expanded in x around inf 67.0%
*-commutative67.0%
Simplified67.0%
if 7.8000000000000002e-199 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification80.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -3.35e-242)
(/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t 1.55e-205)
(* (/ (* (sqrt 2.0) t) l) (sqrt x))
(sqrt (/ (+ x -1.0) (+ x 1.0))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -3.35e-242) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 1.55e-205) {
tmp = ((sqrt(2.0) * t) / l) * sqrt(x);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.35d-242)) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= 1.55d-205) then
tmp = ((sqrt(2.0d0) * t) / l) * sqrt(x)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -3.35e-242) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 1.55e-205) {
tmp = ((Math.sqrt(2.0) * t) / l) * Math.sqrt(x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -3.35e-242: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= 1.55e-205: tmp = ((math.sqrt(2.0) * t) / l) * math.sqrt(x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -3.35e-242) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); elseif (t <= 1.55e-205) tmp = Float64(Float64(Float64(sqrt(2.0) * t) / l) * sqrt(x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -3.35e-242) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= 1.55e-205) tmp = ((sqrt(2.0) * t) / l) * sqrt(x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -3.35e-242], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-205], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.35 \cdot 10^{-242}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-205}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.35000000000000015e-242Initial program 33.5%
Simplified33.5%
Taylor expanded in t around -inf 78.1%
associate-*r*78.1%
neg-mul-178.1%
+-commutative78.1%
sub-neg78.1%
metadata-eval78.1%
+-commutative78.1%
Simplified78.1%
if -3.35000000000000015e-242 < t < 1.54999999999999991e-205Initial program 11.1%
Simplified11.1%
Taylor expanded in l around inf 13.1%
associate--l+47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
sub-neg47.0%
metadata-eval47.0%
+-commutative47.0%
Simplified47.0%
Taylor expanded in x around inf 71.8%
Taylor expanded in t around 0 67.1%
Taylor expanded in x around 0 45.7%
if 1.54999999999999991e-205 < t Initial program 35.1%
Simplified35.1%
Applied egg-rr70.8%
Taylor expanded in l around 0 84.1%
Final simplification78.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 9.5e-304) (/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0))))) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 9.5e-304) {
tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 9.5d-304) then
tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= 9.5e-304) {
tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 9.5e-304: tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0)))) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 9.5e-304) tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 9.5e-304) tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0)))); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, 9.5e-304], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < 9.50000000000000023e-304Initial program 31.0%
Simplified31.0%
Taylor expanded in t around -inf 74.0%
associate-*r*74.0%
neg-mul-174.0%
+-commutative74.0%
sub-neg74.0%
metadata-eval74.0%
+-commutative74.0%
Simplified74.0%
if 9.50000000000000023e-304 < t Initial program 34.2%
Simplified34.2%
Applied egg-rr68.6%
Taylor expanded in l around 0 79.0%
Final simplification76.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))) (if (<= t 9.5e-304) (- t_1) t_1)))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= 9.5e-304) {
tmp = -t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= 9.5d-304) then
tmp = -t_1
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= 9.5e-304) {
tmp = -t_1;
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= 9.5e-304: tmp = -t_1 else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= 9.5e-304) tmp = Float64(-t_1); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= 9.5e-304) tmp = -t_1; else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 9.5e-304], (-t$95$1), t$95$1]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq 9.5 \cdot 10^{-304}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < 9.50000000000000023e-304Initial program 31.0%
Simplified31.0%
Applied egg-rr66.4%
Taylor expanded in t around -inf 73.9%
mul-1-neg73.9%
sub-neg73.9%
metadata-eval73.9%
+-commutative73.9%
Simplified73.9%
if 9.50000000000000023e-304 < t Initial program 34.2%
Simplified34.2%
Applied egg-rr68.6%
Taylor expanded in l around 0 79.0%
Final simplification76.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.3%
Simplified31.3%
Applied egg-rr66.1%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt72.6%
Simplified72.6%
if -4.999999999999985e-310 < t Initial program 34.0%
Simplified34.0%
Applied egg-rr68.9%
Taylor expanded in l around 0 78.5%
Final simplification75.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (/ t (+ t (/ t x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = t / (t + (t / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = t / (t + (t / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = t / (t + (t / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = t / (t + (t / x)) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(t / Float64(t + Float64(t / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = t / (t + (t / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(t / N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t + \frac{t}{x}}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.3%
Simplified31.3%
Applied egg-rr66.1%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt72.6%
Simplified72.6%
if -4.999999999999985e-310 < t Initial program 34.0%
Simplified34.0%
Taylor expanded in t around inf 78.5%
+-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in x around inf 77.6%
Final simplification75.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.3%
Simplified31.3%
Applied egg-rr66.1%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt72.6%
Simplified72.6%
if -4.999999999999985e-310 < t Initial program 34.0%
Simplified34.0%
Taylor expanded in t around inf 78.5%
+-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in x around inf 77.0%
Final simplification75.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.3%
Simplified31.3%
Applied egg-rr66.1%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt72.6%
Simplified72.6%
if -4.999999999999985e-310 < t Initial program 34.0%
Simplified34.0%
Taylor expanded in t around inf 78.5%
+-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in x around inf 77.6%
Final simplification75.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 31.3%
Simplified31.3%
Applied egg-rr66.1%
Taylor expanded in l around 0 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt71.4%
Simplified71.4%
if -4.999999999999985e-310 < t Initial program 34.0%
Simplified34.0%
Taylor expanded in t around inf 78.5%
+-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in x around inf 77.0%
Final simplification74.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 -1.0)
l = abs(l);
double code(double x, double l, double t) {
return -1.0;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = -1.0d0
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return -1.0;
}
l = abs(l) def code(x, l, t): return -1.0
l = abs(l) function code(x, l, t) return -1.0 end
l = abs(l) function tmp = code(x, l, t) tmp = -1.0; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := -1.0
\begin{array}{l}
l = |l|\\
\\
-1
\end{array}
Initial program 32.8%
Simplified32.8%
Applied egg-rr67.7%
Taylor expanded in l around 0 44.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt32.5%
Simplified32.5%
Final simplification32.5%
herbie shell --seed 2023300
(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)))))