
(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 11 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 (sqrt (/ (+ -1.0 x) (+ x 1.0))))
(t_2 (* 2.0 (pow t 2.0)))
(t_3 (+ t_2 (pow l 2.0))))
(if (<= t -5.5e+19)
(- t_1)
(if (<= t -2.85e-213)
(/
t
(/
(sqrt
(+
(+
(/ (+ t_3 t_3) (pow x 2.0))
(+
(* 2.0 (/ (pow t 2.0) x))
(+
(* 2.0 (/ (pow t 2.0) (pow x 3.0)))
(+ t_2 (+ (/ (pow l 2.0) x) (/ (pow l 2.0) (pow x 3.0)))))))
(+ (/ t_3 x) (/ t_3 (pow x 3.0)))))
(sqrt 2.0)))
(if (<= t 8.6e-206)
(/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
t_1)))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double t_2 = 2.0 * pow(t, 2.0);
double t_3 = t_2 + pow(l, 2.0);
double tmp;
if (t <= -5.5e+19) {
tmp = -t_1;
} else if (t <= -2.85e-213) {
tmp = t / (sqrt(((((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + ((2.0 * (pow(t, 2.0) / pow(x, 3.0))) + (t_2 + ((pow(l, 2.0) / x) + (pow(l, 2.0) / pow(x, 3.0))))))) + ((t_3 / x) + (t_3 / pow(x, 3.0))))) / sqrt(2.0));
} else if (t <= 8.6e-206) {
tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) t_2 = Float64(2.0 * (t ^ 2.0)) t_3 = Float64(t_2 + (l ^ 2.0)) tmp = 0.0 if (t <= -5.5e+19) tmp = Float64(-t_1); elseif (t <= -2.85e-213) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / (x ^ 3.0))) + Float64(t_2 + Float64(Float64((l ^ 2.0) / x) + Float64((l ^ 2.0) / (x ^ 3.0))))))) + Float64(Float64(t_3 / x) + Float64(t_3 / (x ^ 3.0))))) / sqrt(2.0))); elseif (t <= 8.6e-206) tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $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]}, If[LessEqual[t, -5.5e+19], (-t$95$1), If[LessEqual[t, -2.85e-213], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 / x), $MachinePrecision] + N[(t$95$3 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+19}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_2 + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(\frac{t_3}{x} + \frac{t_3}{{x}^{3}}\right)}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{-206}:\\
\;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.5e19Initial program 45.9%
Simplified45.9%
Applied egg-rr80.3%
Taylor expanded in t around -inf 97.4%
mul-1-neg97.4%
sub-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
if -5.5e19 < t < -2.84999999999999997e-213Initial program 42.6%
Simplified42.6%
Taylor expanded in x around -inf 79.6%
if -2.84999999999999997e-213 < t < 8.6000000000000005e-206Initial program 3.1%
Simplified3.1%
Taylor expanded in l around inf 7.3%
*-commutative7.3%
associate--l+35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
associate-/l*35.4%
Simplified35.4%
Taylor expanded in x around 0 49.7%
associate-*r/49.6%
*-commutative49.6%
fma-neg49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if 8.6000000000000005e-206 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification83.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0))))
(t_2 (* 2.0 (pow t 2.0)))
(t_3 (+ t_2 (pow l 2.0))))
(if (<= t -6.8e+18)
(- t_1)
(if (<= t -2.85e-213)
(/
t
(/
(sqrt
(+
(/ t_3 x)
(+
(/ (+ t_3 t_3) (pow x 2.0))
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x))))))
(sqrt 2.0)))
(if (<= t 8e-206)
(/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
t_1)))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double t_2 = 2.0 * pow(t, 2.0);
double t_3 = t_2 + pow(l, 2.0);
double tmp;
if (t <= -6.8e+18) {
tmp = -t_1;
} else if (t <= -2.85e-213) {
tmp = t / (sqrt(((t_3 / x) + (((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x)))))) / sqrt(2.0));
} else if (t <= 8e-206) {
tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) t_2 = Float64(2.0 * (t ^ 2.0)) t_3 = Float64(t_2 + (l ^ 2.0)) tmp = 0.0 if (t <= -6.8e+18) tmp = Float64(-t_1); elseif (t <= -2.85e-213) tmp = Float64(t / Float64(sqrt(Float64(Float64(t_3 / x) + Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x)))))) / sqrt(2.0))); elseif (t <= 8e-206) tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $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]}, If[LessEqual[t, -6.8e+18], (-t$95$1), If[LessEqual[t, -2.85e-213], N[(t / N[(N[Sqrt[N[(N[(t$95$3 / x), $MachinePrecision] + N[(N[(N[(t$95$3 + t$95$3), $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$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+18}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\frac{t_3}{x} + \left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right)\right)}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-206}:\\
\;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.8e18Initial program 45.9%
Simplified45.9%
Applied egg-rr80.3%
Taylor expanded in t around -inf 97.4%
mul-1-neg97.4%
sub-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
if -6.8e18 < t < -2.84999999999999997e-213Initial program 42.6%
Simplified42.6%
Taylor expanded in x around -inf 79.4%
if -2.84999999999999997e-213 < t < 8.00000000000000023e-206Initial program 3.1%
Simplified3.1%
Taylor expanded in l around inf 7.3%
*-commutative7.3%
associate--l+35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
associate-/l*35.4%
Simplified35.4%
Taylor expanded in x around 0 49.7%
associate-*r/49.6%
*-commutative49.6%
fma-neg49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if 8.00000000000000023e-206 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification83.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -8.8e+18)
(- t_1)
(if (<= t -2.75e-213)
(/
t
(/
(sqrt
(+
(+ (/ (pow l 2.0) x) (* 2.0 (* t (+ t (/ t x)))))
(/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
(sqrt 2.0)))
(if (<= t 2.1e-206)
(/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
t_1)))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -8.8e+18) {
tmp = -t_1;
} else if (t <= -2.75e-213) {
tmp = t / (sqrt((((pow(l, 2.0) / x) + (2.0 * (t * (t + (t / x))))) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
} else if (t <= 2.1e-206) {
tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -8.8e+18) tmp = Float64(-t_1); elseif (t <= -2.75e-213) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64((l ^ 2.0) / x) + Float64(2.0 * Float64(t * Float64(t + Float64(t / x))))) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0))); elseif (t <= 2.1e-206) tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -8.8e+18], (-t$95$1), If[LessEqual[t, -2.75e-213], N[(t / N[(N[Sqrt[N[(N[(N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -2.75 \cdot 10^{-213}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{{\ell}^{2}}{x} + 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-206}:\\
\;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.8e18Initial program 45.9%
Simplified45.9%
Applied egg-rr80.3%
Taylor expanded in t around -inf 97.4%
mul-1-neg97.4%
sub-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
if -8.8e18 < t < -2.75000000000000004e-213Initial program 42.6%
Simplified42.6%
Taylor expanded in x around inf 79.1%
expm1-log1p-u77.9%
expm1-udef30.4%
Applied egg-rr30.4%
expm1-def77.9%
expm1-log1p79.1%
fma-udef79.1%
fma-udef79.1%
associate-+r+79.1%
distribute-lft-out79.1%
unpow279.1%
associate-*r/79.1%
unpow279.1%
distribute-lft-out79.1%
Simplified79.1%
if -2.75000000000000004e-213 < t < 2.1000000000000001e-206Initial program 3.1%
Simplified3.1%
Taylor expanded in l around inf 7.3%
*-commutative7.3%
associate--l+35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
sub-neg35.4%
metadata-eval35.4%
+-commutative35.4%
associate-/l*35.4%
Simplified35.4%
Taylor expanded in x around 0 49.7%
associate-*r/49.6%
*-commutative49.6%
fma-neg49.6%
metadata-eval49.6%
Applied egg-rr49.6%
if 2.1000000000000001e-206 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification83.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -7e-211)
(- t_1)
(if (<= t 1.3e-205)
(/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -7e-211) {
tmp = -t_1;
} else if (t <= 1.3e-205) {
tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -7e-211) tmp = Float64(-t_1); elseif (t <= 1.3e-205) tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7e-211], (-t$95$1), If[LessEqual[t, 1.3e-205], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-205}:\\
\;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7e-211Initial program 45.1%
Simplified45.0%
Applied egg-rr66.5%
Taylor expanded in t around -inf 83.2%
mul-1-neg83.2%
sub-neg83.2%
metadata-eval83.2%
+-commutative83.2%
Simplified83.2%
if -7e-211 < t < 1.2999999999999999e-205Initial program 3.0%
Simplified3.0%
Taylor expanded in l around inf 6.9%
*-commutative6.9%
associate--l+35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
associate-/l*35.9%
Simplified35.9%
Taylor expanded in x around 0 49.3%
associate-*r/49.8%
*-commutative49.8%
fma-neg49.8%
metadata-eval49.8%
Applied egg-rr49.8%
if 1.2999999999999999e-205 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification80.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -6.1e-211)
(- t_1)
(if (<= t 2.05e-206)
(* (sqrt (- (* x 0.5) 0.5)) (* t (/ 1.0 (/ l (sqrt 2.0)))))
t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -6.1e-211) {
tmp = -t_1;
} else if (t <= 2.05e-206) {
tmp = sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / sqrt(2.0))));
} 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((((-1.0d0) + x) / (x + 1.0d0)))
if (t <= (-6.1d-211)) then
tmp = -t_1
else if (t <= 2.05d-206) then
tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (t * (1.0d0 / (l / sqrt(2.0d0))))
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(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -6.1e-211) {
tmp = -t_1;
} else if (t <= 2.05e-206) {
tmp = Math.sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / Math.sqrt(2.0))));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((-1.0 + x) / (x + 1.0))) tmp = 0 if t <= -6.1e-211: tmp = -t_1 elif t <= 2.05e-206: tmp = math.sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / math.sqrt(2.0)))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -6.1e-211) tmp = Float64(-t_1); elseif (t <= 2.05e-206) tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(t * Float64(1.0 / Float64(l / sqrt(2.0))))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((-1.0 + x) / (x + 1.0))); tmp = 0.0; if (t <= -6.1e-211) tmp = -t_1; elseif (t <= 2.05e-206) tmp = sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / sqrt(2.0)))); 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6.1e-211], (-t$95$1), If[LessEqual[t, 2.05e-206], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(t * N[(1.0 / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(t \cdot \frac{1}{\frac{\ell}{\sqrt{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.1e-211Initial program 45.1%
Simplified45.0%
Applied egg-rr66.5%
Taylor expanded in t around -inf 83.2%
mul-1-neg83.2%
sub-neg83.2%
metadata-eval83.2%
+-commutative83.2%
Simplified83.2%
if -6.1e-211 < t < 2.05000000000000008e-206Initial program 3.0%
Simplified3.0%
Taylor expanded in l around inf 6.9%
*-commutative6.9%
associate--l+35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
associate-/l*35.9%
Simplified35.9%
Taylor expanded in x around 0 49.3%
div-inv49.3%
Applied egg-rr49.3%
if 2.05000000000000008e-206 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification80.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -5.8e-211)
(- t_1)
(if (<= t 3.4e-206)
(* (sqrt (- (* x 0.5) 0.5)) (* (sqrt 2.0) (/ t l)))
t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -5.8e-211) {
tmp = -t_1;
} else if (t <= 3.4e-206) {
tmp = sqrt(((x * 0.5) - 0.5)) * (sqrt(2.0) * (t / l));
} 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((((-1.0d0) + x) / (x + 1.0d0)))
if (t <= (-5.8d-211)) then
tmp = -t_1
else if (t <= 3.4d-206) then
tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (sqrt(2.0d0) * (t / l))
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(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -5.8e-211) {
tmp = -t_1;
} else if (t <= 3.4e-206) {
tmp = Math.sqrt(((x * 0.5) - 0.5)) * (Math.sqrt(2.0) * (t / l));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((-1.0 + x) / (x + 1.0))) tmp = 0 if t <= -5.8e-211: tmp = -t_1 elif t <= 3.4e-206: tmp = math.sqrt(((x * 0.5) - 0.5)) * (math.sqrt(2.0) * (t / l)) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -5.8e-211) tmp = Float64(-t_1); elseif (t <= 3.4e-206) tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(sqrt(2.0) * Float64(t / l))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((-1.0 + x) / (x + 1.0))); tmp = 0.0; if (t <= -5.8e-211) tmp = -t_1; elseif (t <= 3.4e-206) tmp = sqrt(((x * 0.5) - 0.5)) * (sqrt(2.0) * (t / l)); 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -5.8e-211], (-t$95$1), If[LessEqual[t, 3.4e-206], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(\sqrt{2} \cdot \frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.80000000000000029e-211Initial program 45.1%
Simplified45.0%
Applied egg-rr66.5%
Taylor expanded in t around -inf 83.2%
mul-1-neg83.2%
sub-neg83.2%
metadata-eval83.2%
+-commutative83.2%
Simplified83.2%
if -5.80000000000000029e-211 < t < 3.39999999999999985e-206Initial program 3.0%
Simplified3.0%
Taylor expanded in l around inf 6.9%
*-commutative6.9%
associate--l+35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
associate-/l*35.9%
Simplified35.9%
Taylor expanded in x around 0 49.3%
associate-/r/49.3%
Applied egg-rr49.3%
if 3.39999999999999985e-206 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification80.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -3.7e-211)
(- t_1)
(if (<= t 1.25e-205) (* (sqrt (* x 0.5)) (/ t (/ l (sqrt 2.0)))) t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -3.7e-211) {
tmp = -t_1;
} else if (t <= 1.25e-205) {
tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0)));
} 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((((-1.0d0) + x) / (x + 1.0d0)))
if (t <= (-3.7d-211)) then
tmp = -t_1
else if (t <= 1.25d-205) then
tmp = sqrt((x * 0.5d0)) * (t / (l / sqrt(2.0d0)))
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(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -3.7e-211) {
tmp = -t_1;
} else if (t <= 1.25e-205) {
tmp = Math.sqrt((x * 0.5)) * (t / (l / Math.sqrt(2.0)));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((-1.0 + x) / (x + 1.0))) tmp = 0 if t <= -3.7e-211: tmp = -t_1 elif t <= 1.25e-205: tmp = math.sqrt((x * 0.5)) * (t / (l / math.sqrt(2.0))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.7e-211) tmp = Float64(-t_1); elseif (t <= 1.25e-205) tmp = Float64(sqrt(Float64(x * 0.5)) * Float64(t / Float64(l / sqrt(2.0)))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((-1.0 + x) / (x + 1.0))); tmp = 0.0; if (t <= -3.7e-211) tmp = -t_1; elseif (t <= 1.25e-205) tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0))); 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.7e-211], (-t$95$1), If[LessEqual[t, 1.25e-205], N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-205}:\\
\;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.6999999999999998e-211Initial program 45.1%
Simplified45.0%
Applied egg-rr66.5%
Taylor expanded in t around -inf 83.2%
mul-1-neg83.2%
sub-neg83.2%
metadata-eval83.2%
+-commutative83.2%
Simplified83.2%
if -3.6999999999999998e-211 < t < 1.25e-205Initial program 3.0%
Simplified3.0%
Taylor expanded in l around inf 6.9%
*-commutative6.9%
associate--l+35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
associate-/l*35.9%
Simplified35.9%
Taylor expanded in x around inf 45.2%
*-commutative45.2%
Simplified45.2%
if 1.25e-205 < t Initial program 28.7%
Simplified28.6%
Applied egg-rr73.0%
Taylor expanded in l around 0 87.0%
Final simplification80.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0))))) (if (<= t -2e-311) (- t_1) t_1)))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -2e-311) {
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((((-1.0d0) + x) / (x + 1.0d0)))
if (t <= (-2d-311)) 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(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -2e-311) {
tmp = -t_1;
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((-1.0 + x) / (x + 1.0))) tmp = 0 if t <= -2e-311: tmp = -t_1 else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -2e-311) 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(((-1.0 + x) / (x + 1.0))); tmp = 0.0; if (t <= -2e-311) 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2e-311], (-t$95$1), t$95$1]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-311}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.9999999999999e-311Initial program 40.2%
Simplified40.1%
Applied egg-rr63.4%
Taylor expanded in t around -inf 75.6%
mul-1-neg75.6%
sub-neg75.6%
metadata-eval75.6%
+-commutative75.6%
Simplified75.6%
if -1.9999999999999e-311 < t Initial program 25.4%
Simplified25.3%
Applied egg-rr67.7%
Taylor expanded in l around 0 81.0%
Final simplification78.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -8.5e-304) (/ t (- t)) (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -8.5e-304) {
tmp = t / -t;
} else {
tmp = sqrt(((-1.0 + x) / (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 <= (-8.5d-304)) then
tmp = t / -t
else
tmp = sqrt((((-1.0d0) + x) / (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 <= -8.5e-304) {
tmp = t / -t;
} else {
tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -8.5e-304: tmp = t / -t else: tmp = math.sqrt(((-1.0 + x) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -8.5e-304) tmp = Float64(t / Float64(-t)); else tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -8.5e-304) tmp = t / -t; else tmp = sqrt(((-1.0 + x) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -8.5e-304], N[(t / (-t)), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
if t < -8.5e-304Initial program 40.6%
Simplified40.6%
Taylor expanded in x around inf 49.8%
Taylor expanded in t around -inf 75.1%
neg-mul-175.1%
Simplified75.1%
if -8.5e-304 < t Initial program 25.3%
Simplified25.2%
Applied egg-rr68.0%
Taylor expanded in l around 0 80.4%
Final simplification78.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -8.5e-304) (/ t (- t)) (/ t t)))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -8.5e-304) {
tmp = t / -t;
} else {
tmp = t / t;
}
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 <= (-8.5d-304)) then
tmp = t / -t
else
tmp = t / t
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -8.5e-304) {
tmp = t / -t;
} else {
tmp = t / t;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -8.5e-304: tmp = t / -t else: tmp = t / t return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -8.5e-304) tmp = Float64(t / Float64(-t)); else tmp = Float64(t / t); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -8.5e-304) tmp = t / -t; else tmp = t / t; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -8.5e-304], N[(t / (-t)), $MachinePrecision], N[(t / t), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t}\\
\end{array}
\end{array}
if t < -8.5e-304Initial program 40.6%
Simplified40.6%
Taylor expanded in x around inf 49.8%
Taylor expanded in t around -inf 75.1%
neg-mul-175.1%
Simplified75.1%
if -8.5e-304 < t Initial program 25.3%
Simplified25.3%
Taylor expanded in x around inf 79.3%
Final simplification77.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (/ t t))
l = abs(l);
double code(double x, double l, double t) {
return t / t;
}
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 = t / t
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return t / t;
}
l = abs(l) def code(x, l, t): return t / t
l = abs(l) function code(x, l, t) return Float64(t / t) end
l = abs(l) function tmp = code(x, l, t) tmp = t / t; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := N[(t / t), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{t}{t}
\end{array}
Initial program 32.3%
Simplified32.3%
Taylor expanded in x around inf 43.5%
Final simplification43.5%
herbie shell --seed 2023320
(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)))))