
(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 13 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 (/ (pow l 2.0) x))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_3 (* 2.0 (pow t 2.0)))
(t_4 (+ (pow l 2.0) t_3)))
(if (<= t -5.2e+43)
(- t_2)
(if (<= t -8.2e-159)
(/ t (sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0)))
(if (<= t -1.45e-170)
-1.0
(if (<= t 9.5e-304)
(/ t (* l (sqrt (/ 1.0 x))))
(if (<= t 4.2e-160)
(/
t
(fma
0.5
(/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
t))
(if (<= t 8.8e+98)
(/
t
(/
(sqrt
(+
(+
(/ (+ t_4 t_4) (pow x 2.0))
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 t_3)))
(/ t_4 x)))
(sqrt 2.0)))
t_2))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = pow(l, 2.0) / x;
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double t_3 = 2.0 * pow(t, 2.0);
double t_4 = pow(l, 2.0) + t_3;
double tmp;
if (t <= -5.2e+43) {
tmp = -t_2;
} else if (t <= -8.2e-159) {
tmp = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
} else if (t <= -1.45e-170) {
tmp = -1.0;
} else if (t <= 9.5e-304) {
tmp = t / (l * sqrt((1.0 / x)));
} else if (t <= 4.2e-160) {
tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
} else if (t <= 8.8e+98) {
tmp = t / (sqrt(((((t_4 + t_4) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_1 + t_3))) + (t_4 / x))) / sqrt(2.0));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64((l ^ 2.0) / x) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_3 = Float64(2.0 * (t ^ 2.0)) t_4 = Float64((l ^ 2.0) + t_3) tmp = 0.0 if (t <= -5.2e+43) tmp = Float64(-t_2); elseif (t <= -8.2e-159) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0))); elseif (t <= -1.45e-170) tmp = -1.0; elseif (t <= 9.5e-304) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); elseif (t <= 4.2e-160) tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t)); elseif (t <= 8.8e+98) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_4 + t_4) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + t_3))) + Float64(t_4 / x))) / sqrt(2.0))); 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[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[l, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision]}, If[LessEqual[t, -5.2e+43], (-t$95$2), If[LessEqual[t, -8.2e-159], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.45e-170], -1.0, If[LessEqual[t, 9.5e-304], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-160], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+98], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$4 + t$95$4), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
t_3 := 2 \cdot {t}^{2}\\
t_4 := {\ell}^{2} + t_3\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+43}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-159}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-170}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-160}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.20000000000000042e43Initial program 24.2%
Simplified24.1%
Applied egg-rr76.6%
Taylor expanded in t around -inf 94.5%
mul-1-neg94.5%
sub-neg94.5%
metadata-eval94.5%
Simplified94.5%
if -5.20000000000000042e43 < t < -8.20000000000000029e-159Initial program 59.1%
Simplified59.1%
Taylor expanded in x around inf 88.3%
Taylor expanded in t around 0 88.2%
expm1-log1p-u86.9%
expm1-udef35.5%
Applied egg-rr35.5%
expm1-def87.3%
expm1-log1p88.8%
Simplified88.8%
if -8.20000000000000029e-159 < t < -1.45e-170Initial program 22.6%
Simplified22.6%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt100.0%
Simplified100.0%
if -1.45e-170 < t < 9.50000000000000023e-304Initial program 1.7%
Simplified1.7%
Taylor expanded in x around inf 60.3%
Taylor expanded in t around 0 60.3%
Taylor expanded in l around inf 59.6%
if 9.50000000000000023e-304 < t < 4.2000000000000001e-160Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 37.7%
Taylor expanded in t around 0 37.7%
Taylor expanded in x around inf 93.2%
+-commutative93.2%
fma-def93.2%
associate--l+93.2%
fma-def93.2%
unpow293.2%
fma-neg93.2%
mul-1-neg93.2%
remove-double-neg93.2%
*-commutative93.2%
*-commutative93.2%
unpow293.2%
rem-square-sqrt93.2%
associate-*l*93.2%
Simplified93.2%
if 4.2000000000000001e-160 < t < 8.80000000000000034e98Initial program 51.8%
Simplified51.8%
Taylor expanded in x around -inf 83.2%
if 8.80000000000000034e98 < t Initial program 12.2%
Simplified12.1%
Applied egg-rr84.6%
Taylor expanded in t around inf 96.2%
Final simplification89.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (pow l 2.0) x))
(t_2
(/
t
(sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0))))
(t_3 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1e+43)
(- t_3)
(if (<= t -8e-159)
t_2
(if (<= t -5.2e-168)
-1.0
(if (<= t 7.6e-302)
(/ t (* l (sqrt (/ 1.0 x))))
(if (<= t 4.2e-161)
(/
t
(fma
0.5
(/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
t))
(if (<= t 1.6e+100) t_2 t_3))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = pow(l, 2.0) / x;
double t_2 = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
double t_3 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1e+43) {
tmp = -t_3;
} else if (t <= -8e-159) {
tmp = t_2;
} else if (t <= -5.2e-168) {
tmp = -1.0;
} else if (t <= 7.6e-302) {
tmp = t / (l * sqrt((1.0 / x)));
} else if (t <= 4.2e-161) {
tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
} else if (t <= 1.6e+100) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64((l ^ 2.0) / x) t_2 = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0))) t_3 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1e+43) tmp = Float64(-t_3); elseif (t <= -8e-159) tmp = t_2; elseif (t <= -5.2e-168) tmp = -1.0; elseif (t <= 7.6e-302) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); elseif (t <= 4.2e-161) tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t)); elseif (t <= 1.6e+100) tmp = t_2; else tmp = t_3; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1e+43], (-t$95$3), If[LessEqual[t, -8e-159], t$95$2, If[LessEqual[t, -5.2e-168], -1.0, If[LessEqual[t, 7.6e-302], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-161], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+100], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\
t_3 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+43}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-159}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-168}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-302}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-161}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+100}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -1.00000000000000001e43Initial program 24.2%
Simplified24.1%
Applied egg-rr76.6%
Taylor expanded in t around -inf 94.5%
mul-1-neg94.5%
sub-neg94.5%
metadata-eval94.5%
Simplified94.5%
if -1.00000000000000001e43 < t < -7.99999999999999991e-159 or 4.2000000000000001e-161 < t < 1.5999999999999999e100Initial program 55.3%
Simplified55.3%
Taylor expanded in x around inf 85.3%
Taylor expanded in t around 0 85.0%
expm1-log1p-u83.1%
expm1-udef38.6%
Applied egg-rr38.6%
expm1-def83.5%
expm1-log1p85.7%
Simplified85.7%
if -7.99999999999999991e-159 < t < -5.2000000000000002e-168Initial program 22.6%
Simplified22.6%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt100.0%
Simplified100.0%
if -5.2000000000000002e-168 < t < 7.5999999999999999e-302Initial program 1.7%
Simplified1.7%
Taylor expanded in x around inf 60.3%
Taylor expanded in t around 0 60.3%
Taylor expanded in l around inf 59.6%
if 7.5999999999999999e-302 < t < 4.2000000000000001e-161Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 37.7%
Taylor expanded in t around 0 37.7%
Taylor expanded in x around inf 93.2%
+-commutative93.2%
fma-def93.2%
associate--l+93.2%
fma-def93.2%
unpow293.2%
fma-neg93.2%
mul-1-neg93.2%
remove-double-neg93.2%
*-commutative93.2%
*-commutative93.2%
unpow293.2%
rem-square-sqrt93.2%
associate-*l*93.2%
Simplified93.2%
if 1.5999999999999999e100 < t Initial program 12.2%
Simplified12.1%
Applied egg-rr84.6%
Taylor expanded in t around inf 96.2%
Final simplification88.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (pow l 2.0) x))
(t_2
(/
t
(sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0))))
(t_3 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.96e+43)
(- t_3)
(if (<= t -8.3e-159)
t_2
(if (<= t -5.1e-169)
-1.0
(if (<= t 2.7e-205)
(/ t (* l (sqrt (/ 1.0 x))))
(if (<= t 1.75e-162) 1.0 (if (<= t 7.2e+99) t_2 t_3))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = pow(l, 2.0) / x;
double t_2 = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
double t_3 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.96e+43) {
tmp = -t_3;
} else if (t <= -8.3e-159) {
tmp = t_2;
} else if (t <= -5.1e-169) {
tmp = -1.0;
} else if (t <= 2.7e-205) {
tmp = t / (l * sqrt((1.0 / x)));
} else if (t <= 1.75e-162) {
tmp = 1.0;
} else if (t <= 7.2e+99) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (l ** 2.0d0) / x
t_2 = t / sqrt(((t_1 + (t_1 + ((t ** 2.0d0) * (2.0d0 + (2.0d0 / x))))) / 2.0d0))
t_3 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.96d+43)) then
tmp = -t_3
else if (t <= (-8.3d-159)) then
tmp = t_2
else if (t <= (-5.1d-169)) then
tmp = -1.0d0
else if (t <= 2.7d-205) then
tmp = t / (l * sqrt((1.0d0 / x)))
else if (t <= 1.75d-162) then
tmp = 1.0d0
else if (t <= 7.2d+99) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.pow(l, 2.0) / x;
double t_2 = t / Math.sqrt(((t_1 + (t_1 + (Math.pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
double t_3 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.96e+43) {
tmp = -t_3;
} else if (t <= -8.3e-159) {
tmp = t_2;
} else if (t <= -5.1e-169) {
tmp = -1.0;
} else if (t <= 2.7e-205) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else if (t <= 1.75e-162) {
tmp = 1.0;
} else if (t <= 7.2e+99) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.pow(l, 2.0) / x t_2 = t / math.sqrt(((t_1 + (t_1 + (math.pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0)) t_3 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.96e+43: tmp = -t_3 elif t <= -8.3e-159: tmp = t_2 elif t <= -5.1e-169: tmp = -1.0 elif t <= 2.7e-205: tmp = t / (l * math.sqrt((1.0 / x))) elif t <= 1.75e-162: tmp = 1.0 elif t <= 7.2e+99: tmp = t_2 else: tmp = t_3 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64((l ^ 2.0) / x) t_2 = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0))) t_3 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.96e+43) tmp = Float64(-t_3); elseif (t <= -8.3e-159) tmp = t_2; elseif (t <= -5.1e-169) tmp = -1.0; elseif (t <= 2.7e-205) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); elseif (t <= 1.75e-162) tmp = 1.0; elseif (t <= 7.2e+99) tmp = t_2; else tmp = t_3; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l ^ 2.0) / x; t_2 = t / sqrt(((t_1 + (t_1 + ((t ^ 2.0) * (2.0 + (2.0 / x))))) / 2.0)); t_3 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.96e+43) tmp = -t_3; elseif (t <= -8.3e-159) tmp = t_2; elseif (t <= -5.1e-169) tmp = -1.0; elseif (t <= 2.7e-205) tmp = t / (l * sqrt((1.0 / x))); elseif (t <= 1.75e-162) tmp = 1.0; elseif (t <= 7.2e+99) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.96e+43], (-t$95$3), If[LessEqual[t, -8.3e-159], t$95$2, If[LessEqual[t, -5.1e-169], -1.0, If[LessEqual[t, 2.7e-205], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-162], 1.0, If[LessEqual[t, 7.2e+99], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\
t_3 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.96 \cdot 10^{+43}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq -8.3 \cdot 10^{-159}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.1 \cdot 10^{-169}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-205}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-162}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+99}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -1.9600000000000001e43Initial program 24.2%
Simplified24.1%
Applied egg-rr76.6%
Taylor expanded in t around -inf 94.5%
mul-1-neg94.5%
sub-neg94.5%
metadata-eval94.5%
Simplified94.5%
if -1.9600000000000001e43 < t < -8.30000000000000047e-159 or 1.74999999999999995e-162 < t < 7.2000000000000003e99Initial program 55.3%
Simplified55.3%
Taylor expanded in x around inf 85.3%
Taylor expanded in t around 0 85.0%
expm1-log1p-u83.1%
expm1-udef38.6%
Applied egg-rr38.6%
expm1-def83.5%
expm1-log1p85.7%
Simplified85.7%
if -8.30000000000000047e-159 < t < -5.09999999999999997e-169Initial program 22.6%
Simplified22.6%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt100.0%
Simplified100.0%
if -5.09999999999999997e-169 < t < 2.7000000000000001e-205Initial program 1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
Taylor expanded in t around 0 63.8%
Taylor expanded in l around inf 63.2%
if 2.7000000000000001e-205 < t < 1.74999999999999995e-162Initial program 3.1%
Simplified3.1%
Applied egg-rr61.8%
Taylor expanded in t around inf 97.3%
Taylor expanded in x around inf 97.3%
if 7.2000000000000003e99 < t Initial program 12.2%
Simplified12.1%
Applied egg-rr84.6%
Taylor expanded in t around inf 96.2%
Final simplification88.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -5e-168)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.5e-209)
(/ t (* l (sqrt (/ 1.0 x))))
(if (<= t 7e-88)
(+ 1.0 (/ -1.0 x))
(if (<= t 1.05e-48)
(* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 1.0 x) (/ 1.0 (+ x -1.0)))))))
(/ 1.0 (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-168) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.5e-209) {
tmp = t / (l * sqrt((1.0 / x)));
} else if (t <= 7e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 1.05e-48) {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / x) + (1.0 / (x + -1.0))))));
} else {
tmp = 1.0 / 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-168)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.5d-209) then
tmp = t / (l * sqrt((1.0d0 / x)))
else if (t <= 7d-88) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 1.05d-48) then
tmp = sqrt(2.0d0) * (t / (l * sqrt(((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))))))
else
tmp = 1.0d0 / 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-168) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.5e-209) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else if (t <= 7e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 1.05e-48) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / x) + (1.0 / (x + -1.0))))));
} else {
tmp = 1.0 / Math.sqrt(((x + 1.0) / (x + -1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-168: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.5e-209: tmp = t / (l * math.sqrt((1.0 / x))) elif t <= 7e-88: tmp = 1.0 + (-1.0 / x) elif t <= 1.05e-48: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / x) + (1.0 / (x + -1.0)))))) else: tmp = 1.0 / math.sqrt(((x + 1.0) / (x + -1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-168) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.5e-209) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); elseif (t <= 7e-88) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 1.05e-48) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))))))); else tmp = Float64(1.0 / 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-168) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.5e-209) tmp = t / (l * sqrt((1.0 / x))); elseif (t <= 7e-88) tmp = 1.0 + (-1.0 / x); elseif (t <= 1.05e-48) tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / x) + (1.0 / (x + -1.0)))))); else tmp = 1.0 / 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-168], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.5e-209], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-48], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-168}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-209}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-48}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -5.00000000000000001e-168Initial program 38.2%
Simplified38.1%
Applied egg-rr69.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
sub-neg87.2%
metadata-eval87.2%
Simplified87.2%
if -5.00000000000000001e-168 < t < 1.4999999999999999e-209Initial program 1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
Taylor expanded in t around 0 63.8%
Taylor expanded in l around inf 63.2%
if 1.4999999999999999e-209 < t < 7.0000000000000002e-88Initial program 35.0%
Simplified34.8%
Applied egg-rr52.4%
Taylor expanded in t around inf 74.7%
Taylor expanded in x around inf 74.7%
if 7.0000000000000002e-88 < t < 1.04999999999999994e-48Initial program 15.2%
Simplified15.2%
Taylor expanded in l around inf 2.3%
associate--l+12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in x around inf 58.1%
if 1.04999999999999994e-48 < t Initial program 31.3%
Simplified31.2%
Applied egg-rr75.5%
Taylor expanded in t around inf 89.5%
clear-num89.5%
sqrt-div89.5%
metadata-eval89.5%
+-commutative89.5%
sub-neg89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Final simplification83.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -1.4e-170)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 7e-212)
(/ t (* l (sqrt (/ 1.0 x))))
(if (<= t 7.2e-88)
(+ 1.0 (/ -1.0 x))
(if (<= t 4.8e-50)
(/ t (* (/ l (sqrt 2.0)) (sqrt (/ 2.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 <= -1.4e-170) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 7e-212) {
tmp = t / (l * sqrt((1.0 / x)));
} else if (t <= 7.2e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t / ((l / sqrt(2.0)) * sqrt((2.0 / x)));
} else {
tmp = 1.0 / 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 <= (-1.4d-170)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 7d-212) then
tmp = t / (l * sqrt((1.0d0 / x)))
else if (t <= 7.2d-88) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 4.8d-50) then
tmp = t / ((l / sqrt(2.0d0)) * sqrt((2.0d0 / x)))
else
tmp = 1.0d0 / 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 <= -1.4e-170) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 7e-212) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else if (t <= 7.2e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t / ((l / Math.sqrt(2.0)) * Math.sqrt((2.0 / x)));
} else {
tmp = 1.0 / Math.sqrt(((x + 1.0) / (x + -1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.4e-170: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 7e-212: tmp = t / (l * math.sqrt((1.0 / x))) elif t <= 7.2e-88: tmp = 1.0 + (-1.0 / x) elif t <= 4.8e-50: tmp = t / ((l / math.sqrt(2.0)) * math.sqrt((2.0 / x))) else: tmp = 1.0 / math.sqrt(((x + 1.0) / (x + -1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.4e-170) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 7e-212) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); elseif (t <= 7.2e-88) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 4.8e-50) tmp = Float64(t / Float64(Float64(l / sqrt(2.0)) * sqrt(Float64(2.0 / x)))); else tmp = Float64(1.0 / 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 <= -1.4e-170) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 7e-212) tmp = t / (l * sqrt((1.0 / x))); elseif (t <= 7.2e-88) tmp = 1.0 + (-1.0 / x); elseif (t <= 4.8e-50) tmp = t / ((l / sqrt(2.0)) * sqrt((2.0 / x))); else tmp = 1.0 / 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, -1.4e-170], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 7e-212], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-50], N[(t / N[(N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-170}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-212}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}} \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -1.39999999999999998e-170Initial program 38.2%
Simplified38.1%
Applied egg-rr69.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
sub-neg87.2%
metadata-eval87.2%
Simplified87.2%
if -1.39999999999999998e-170 < t < 6.9999999999999995e-212Initial program 1.6%
Simplified1.6%
Taylor expanded in x around inf 63.8%
Taylor expanded in t around 0 63.8%
Taylor expanded in l around inf 63.2%
if 6.9999999999999995e-212 < t < 7.1999999999999999e-88Initial program 35.0%
Simplified34.8%
Applied egg-rr52.4%
Taylor expanded in t around inf 74.7%
Taylor expanded in x around inf 74.7%
if 7.1999999999999999e-88 < t < 4.80000000000000004e-50Initial program 15.2%
Simplified15.2%
Taylor expanded in l around inf 2.3%
Taylor expanded in x around inf 58.4%
if 4.80000000000000004e-50 < t Initial program 31.3%
Simplified31.2%
Applied egg-rr75.5%
Taylor expanded in t around inf 89.5%
clear-num89.5%
sqrt-div89.5%
metadata-eval89.5%
+-commutative89.5%
sub-neg89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Final simplification83.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ t (* l (sqrt (/ 1.0 x))))))
(if (<= t -2.1e-167)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 3.8e-206)
t_1
(if (<= t 7.5e-88)
(+ 1.0 (/ -1.0 x))
(if (<= t 4.8e-50) t_1 (/ 1.0 (sqrt (/ (+ x 1.0) (+ x -1.0))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t / (l * sqrt((1.0 / x)));
double tmp;
if (t <= -2.1e-167) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 3.8e-206) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t_1;
} else {
tmp = 1.0 / 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 = t / (l * sqrt((1.0d0 / x)))
if (t <= (-2.1d-167)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 3.8d-206) then
tmp = t_1
else if (t <= 7.5d-88) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 4.8d-50) then
tmp = t_1
else
tmp = 1.0d0 / 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 = t / (l * Math.sqrt((1.0 / x)));
double tmp;
if (t <= -2.1e-167) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 3.8e-206) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t_1;
} else {
tmp = 1.0 / Math.sqrt(((x + 1.0) / (x + -1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t / (l * math.sqrt((1.0 / x))) tmp = 0 if t <= -2.1e-167: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 3.8e-206: tmp = t_1 elif t <= 7.5e-88: tmp = 1.0 + (-1.0 / x) elif t <= 4.8e-50: tmp = t_1 else: tmp = 1.0 / math.sqrt(((x + 1.0) / (x + -1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))) tmp = 0.0 if (t <= -2.1e-167) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 3.8e-206) tmp = t_1; elseif (t <= 7.5e-88) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 4.8e-50) tmp = t_1; else tmp = Float64(1.0 / 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 = t / (l * sqrt((1.0 / x))); tmp = 0.0; if (t <= -2.1e-167) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 3.8e-206) tmp = t_1; elseif (t <= 7.5e-88) tmp = 1.0 + (-1.0 / x); elseif (t <= 4.8e-50) tmp = t_1; else tmp = 1.0 / 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[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e-167], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 3.8e-206], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-50], t$95$1, N[(1.0 / N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-167}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -2.10000000000000017e-167Initial program 38.2%
Simplified38.1%
Applied egg-rr69.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
sub-neg87.2%
metadata-eval87.2%
Simplified87.2%
if -2.10000000000000017e-167 < t < 3.80000000000000003e-206 or 7.50000000000000041e-88 < t < 4.80000000000000004e-50Initial program 4.7%
Simplified4.7%
Taylor expanded in x around inf 62.6%
Taylor expanded in t around 0 62.6%
Taylor expanded in l around inf 62.1%
if 3.80000000000000003e-206 < t < 7.50000000000000041e-88Initial program 35.0%
Simplified34.8%
Applied egg-rr52.4%
Taylor expanded in t around inf 74.7%
Taylor expanded in x around inf 74.7%
if 4.80000000000000004e-50 < t Initial program 31.3%
Simplified31.2%
Applied egg-rr75.5%
Taylor expanded in t around inf 89.5%
clear-num89.5%
sqrt-div89.5%
metadata-eval89.5%
+-commutative89.5%
sub-neg89.5%
metadata-eval89.5%
Applied egg-rr89.5%
Final simplification83.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ t (* l (sqrt (/ 1.0 x))))))
(if (<= t -2.4e-169)
(+ -1.0 (/ 1.0 x))
(if (<= t 2.7e-207)
t_1
(if (<= t 7.5e-88)
(+ 1.0 (/ -1.0 x))
(if (<= t 2.3e-49) t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t / (l * sqrt((1.0 / x)));
double tmp;
if (t <= -2.4e-169) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.7e-207) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 2.3e-49) {
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 = t / (l * sqrt((1.0d0 / x)))
if (t <= (-2.4d-169)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 2.7d-207) then
tmp = t_1
else if (t <= 7.5d-88) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 2.3d-49) 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 = t / (l * Math.sqrt((1.0 / x)));
double tmp;
if (t <= -2.4e-169) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 2.7e-207) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 2.3e-49) {
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 = t / (l * math.sqrt((1.0 / x))) tmp = 0 if t <= -2.4e-169: tmp = -1.0 + (1.0 / x) elif t <= 2.7e-207: tmp = t_1 elif t <= 7.5e-88: tmp = 1.0 + (-1.0 / x) elif t <= 2.3e-49: 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(t / Float64(l * sqrt(Float64(1.0 / x)))) tmp = 0.0 if (t <= -2.4e-169) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 2.7e-207) tmp = t_1; elseif (t <= 7.5e-88) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 2.3e-49) 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 = t / (l * sqrt((1.0 / x))); tmp = 0.0; if (t <= -2.4e-169) tmp = -1.0 + (1.0 / x); elseif (t <= 2.7e-207) tmp = t_1; elseif (t <= 7.5e-88) tmp = 1.0 + (-1.0 / x); elseif (t <= 2.3e-49) 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[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e-169], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-207], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-49], 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 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-169}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -2.40000000000000011e-169Initial program 38.2%
Simplified38.1%
Applied egg-rr69.5%
Taylor expanded in t around inf 1.6%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt85.7%
Simplified85.7%
if -2.40000000000000011e-169 < t < 2.7e-207 or 7.50000000000000041e-88 < t < 2.2999999999999999e-49Initial program 4.7%
Simplified4.7%
Taylor expanded in x around inf 62.6%
Taylor expanded in t around 0 62.6%
Taylor expanded in l around inf 62.1%
if 2.7e-207 < t < 7.50000000000000041e-88Initial program 35.0%
Simplified34.8%
Applied egg-rr52.4%
Taylor expanded in t around inf 74.7%
Taylor expanded in x around inf 74.7%
if 2.2999999999999999e-49 < t Initial program 31.3%
Simplified31.2%
Applied egg-rr75.5%
Taylor expanded in t around inf 89.5%
Final simplification83.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ t (* l (sqrt (/ 1.0 x)))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -6.5e-171)
(- t_2)
(if (<= t 2.6e-207)
t_1
(if (<= t 7.5e-88) (+ 1.0 (/ -1.0 x)) (if (<= t 4.8e-50) t_1 t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t / (l * sqrt((1.0 / x)));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -6.5e-171) {
tmp = -t_2;
} else if (t <= 2.6e-207) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = t / (l * sqrt((1.0d0 / x)))
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-6.5d-171)) then
tmp = -t_2
else if (t <= 2.6d-207) then
tmp = t_1
else if (t <= 7.5d-88) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t <= 4.8d-50) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t / (l * Math.sqrt((1.0 / x)));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -6.5e-171) {
tmp = -t_2;
} else if (t <= 2.6e-207) {
tmp = t_1;
} else if (t <= 7.5e-88) {
tmp = 1.0 + (-1.0 / x);
} else if (t <= 4.8e-50) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t / (l * math.sqrt((1.0 / x))) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -6.5e-171: tmp = -t_2 elif t <= 2.6e-207: tmp = t_1 elif t <= 7.5e-88: tmp = 1.0 + (-1.0 / x) elif t <= 4.8e-50: tmp = t_1 else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -6.5e-171) tmp = Float64(-t_2); elseif (t <= 2.6e-207) tmp = t_1; elseif (t <= 7.5e-88) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t <= 4.8e-50) tmp = t_1; else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t / (l * sqrt((1.0 / x))); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -6.5e-171) tmp = -t_2; elseif (t <= 2.6e-207) tmp = t_1; elseif (t <= 7.5e-88) tmp = 1.0 + (-1.0 / x); elseif (t <= 4.8e-50) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t / N[(l * N[Sqrt[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, -6.5e-171], (-t$95$2), If[LessEqual[t, 2.6e-207], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-50], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-171}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.5000000000000004e-171Initial program 38.2%
Simplified38.1%
Applied egg-rr69.5%
Taylor expanded in t around -inf 87.2%
mul-1-neg87.2%
sub-neg87.2%
metadata-eval87.2%
Simplified87.2%
if -6.5000000000000004e-171 < t < 2.5999999999999999e-207 or 7.50000000000000041e-88 < t < 4.80000000000000004e-50Initial program 4.7%
Simplified4.7%
Taylor expanded in x around inf 62.6%
Taylor expanded in t around 0 62.6%
Taylor expanded in l around inf 62.1%
if 2.5999999999999999e-207 < t < 7.50000000000000041e-88Initial program 35.0%
Simplified34.8%
Applied egg-rr52.4%
Taylor expanded in t around inf 74.7%
Taylor expanded in x around inf 74.7%
if 4.80000000000000004e-50 < t Initial program 31.3%
Simplified31.2%
Applied egg-rr75.5%
Taylor expanded in t around inf 89.5%
Final simplification83.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) (+ -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-311) {
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-311)) 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-311) {
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-311: 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-311) 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-311) 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-311], 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^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 33.7%
Simplified33.6%
Applied egg-rr65.9%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt77.9%
Simplified77.9%
if -5.00000000000023e-311 < t Initial program 29.3%
Simplified29.2%
Applied egg-rr68.0%
Taylor expanded in t around inf 78.9%
Final simplification78.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
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-311)) 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-311) {
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-311: 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-311) 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-311) 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-311], 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^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 33.7%
Simplified33.6%
Applied egg-rr65.9%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt77.9%
Simplified77.9%
if -5.00000000000023e-311 < t Initial program 29.3%
Simplified29.2%
Applied egg-rr68.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in x around inf 77.9%
Final simplification77.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) (+ -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-311) {
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-311)) 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-311) {
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-311: 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-311) 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-311) 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-311], 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^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 33.7%
Simplified33.6%
Applied egg-rr65.9%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
unpow20.0%
rem-square-sqrt77.9%
Simplified77.9%
if -5.00000000000023e-311 < t Initial program 29.3%
Simplified29.2%
Applied egg-rr68.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in x around inf 78.5%
Final simplification78.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
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-311)) 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-311) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-311: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-311) 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-311) 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-311], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 33.7%
Simplified33.6%
Applied egg-rr65.9%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt77.1%
Simplified77.1%
if -5.00000000000023e-311 < t Initial program 29.3%
Simplified29.2%
Applied egg-rr68.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in x around inf 77.9%
Final simplification77.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 31.7%
Simplified31.6%
Applied egg-rr66.8%
Taylor expanded in t around inf 37.0%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt42.6%
Simplified42.6%
Final simplification42.6%
herbie shell --seed 2023313
(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)))))