
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
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))))
(t_2 (* 2.0 (pow t 2.0)))
(t_3 (+ (pow l 2.0) t_2)))
(if (<= t -5.5e-123)
(- t_1)
(if (<= t 2.6e-293)
(/
(* t (sqrt 2.0))
(* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
(if (<= t 3.3e-236)
(/
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.3e-139)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t 5.8e+46)
(/
t
(/
(sqrt
(+
(+
(/ (+ t_3 t_3) (pow x 2.0))
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x))))
(/ t_3 x)))
(sqrt 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 t_2 = 2.0 * pow(t, 2.0);
double t_3 = pow(l, 2.0) + t_2;
double tmp;
if (t <= -5.5e-123) {
tmp = -t_1;
} else if (t <= 2.6e-293) {
tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
} else if (t <= 3.3e-236) {
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.3e-139) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= 5.8e+46) {
tmp = t / (sqrt(((((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x)))) + (t_3 / x))) / sqrt(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))) t_2 = Float64(2.0 * (t ^ 2.0)) t_3 = Float64((l ^ 2.0) + t_2) tmp = 0.0 if (t <= -5.5e-123) tmp = Float64(-t_1); elseif (t <= 2.6e-293) tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0)))))); elseif (t <= 3.3e-236) 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.3e-139) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= 5.8e+46) 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(t_2 + Float64((l ^ 2.0) / x)))) + Float64(t_3 / x))) / 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[(x + -1.0), $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[(N[Power[l, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t, -5.5e-123], (-t$95$1), If[LessEqual[t, 2.6e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-236], 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.3e-139], 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, 5.8e+46], 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[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := {\ell}^{2} + t_2\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-236}:\\
\;\;\;\;\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.3 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\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) + \frac{t_3}{x}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.5e-123Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -5.5e-123 < t < 2.5999999999999998e-293Initial program 7.4%
Simplified7.4%
Taylor expanded in l around inf 2.1%
associate--l+15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
Simplified15.7%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
*-commutative29.0%
+-commutative29.0%
pow-flip29.0%
metadata-eval29.0%
Applied egg-rr29.0%
if 2.5999999999999998e-293 < t < 3.3000000000000001e-236Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 43.2%
Taylor expanded in t around 0 43.2%
Taylor expanded in x around inf 76.8%
+-commutative76.8%
fma-def76.8%
associate--l+76.8%
fma-def76.8%
unpow276.8%
fma-neg76.8%
mul-1-neg76.8%
remove-double-neg76.8%
*-commutative76.8%
*-commutative76.8%
unpow276.8%
rem-square-sqrt76.8%
associate-*l*76.8%
Simplified76.8%
if 3.3000000000000001e-236 < t < 1.2999999999999999e-139Initial program 3.0%
Simplified3.0%
Taylor expanded in x around inf 44.5%
Taylor expanded in l around inf 51.3%
if 1.2999999999999999e-139 < t < 5.8000000000000004e46Initial program 49.5%
Simplified49.4%
Taylor expanded in x around -inf 79.7%
if 5.8000000000000004e46 < t Initial program 28.0%
Simplified28.0%
Applied egg-rr86.2%
Taylor expanded in t around inf 93.8%
Final simplification79.7%
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)))) (t_2 (* 2.0 (pow t 2.0))))
(if (<= t -8.2e-123)
(- t_1)
(if (<= t 3.9e-293)
(/
(* t (sqrt 2.0))
(* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
(if (<= t 1.25e-235)
(/
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.2e-139)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t 9e+44)
(/
t
(/
(sqrt
(+
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x)))
(/ (+ (pow l 2.0) t_2) x)))
(sqrt 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 t_2 = 2.0 * pow(t, 2.0);
double tmp;
if (t <= -8.2e-123) {
tmp = -t_1;
} else if (t <= 3.9e-293) {
tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
} else if (t <= 1.25e-235) {
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.2e-139) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= 9e+44) {
tmp = t / (sqrt((((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x))) + ((pow(l, 2.0) + t_2) / x))) / sqrt(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))) t_2 = Float64(2.0 * (t ^ 2.0)) tmp = 0.0 if (t <= -8.2e-123) tmp = Float64(-t_1); elseif (t <= 3.9e-293) tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0)))))); elseif (t <= 1.25e-235) 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.2e-139) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= 9e+44) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x))) + Float64(Float64((l ^ 2.0) + t_2) / x))) / 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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e-123], (-t$95$1), If[LessEqual[t, 3.9e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e-235], 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.2e-139], 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, 9e+44], N[(t / N[(N[Sqrt[N[(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] + N[(N[(N[Power[l, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-235}:\\
\;\;\;\;\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.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{{\ell}^{2} + t_2}{x}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.2000000000000001e-123Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -8.2000000000000001e-123 < t < 3.9e-293Initial program 7.4%
Simplified7.4%
Taylor expanded in l around inf 2.1%
associate--l+15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
Simplified15.7%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
*-commutative29.0%
+-commutative29.0%
pow-flip29.0%
metadata-eval29.0%
Applied egg-rr29.0%
if 3.9e-293 < t < 1.2499999999999999e-235Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 43.2%
Taylor expanded in t around 0 43.2%
Taylor expanded in x around inf 76.8%
+-commutative76.8%
fma-def76.8%
associate--l+76.8%
fma-def76.8%
unpow276.8%
fma-neg76.8%
mul-1-neg76.8%
remove-double-neg76.8%
*-commutative76.8%
*-commutative76.8%
unpow276.8%
rem-square-sqrt76.8%
associate-*l*76.8%
Simplified76.8%
if 1.2499999999999999e-235 < t < 1.20000000000000007e-139Initial program 3.0%
Simplified3.0%
Taylor expanded in x around inf 44.5%
Taylor expanded in l around inf 51.3%
if 1.20000000000000007e-139 < t < 9e44Initial program 49.5%
Simplified49.4%
Taylor expanded in x around inf 79.4%
if 9e44 < t Initial program 28.0%
Simplified28.0%
Applied egg-rr86.2%
Taylor expanded in t around inf 93.8%
Final simplification79.6%
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)))) (t_2 (/ (pow l 2.0) x)))
(if (<= t -3.6e-122)
(- t_1)
(if (<= t 3.6e-293)
(/
(* t (sqrt 2.0))
(* l (sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (pow x -2.0))))))
(if (<= t 1.4e-237)
(/
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.2e-139)
(/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
(if (<= t 6.8e+44)
(/
t
(/
(sqrt
(+
t_2
(+ (* 2.0 (/ (pow t 2.0) x)) (+ (* 2.0 (pow t 2.0)) t_2))))
(sqrt 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 t_2 = pow(l, 2.0) / x;
double tmp;
if (t <= -3.6e-122) {
tmp = -t_1;
} else if (t <= 3.6e-293) {
tmp = (t * sqrt(2.0)) / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + pow(x, -2.0)))));
} else if (t <= 1.4e-237) {
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.2e-139) {
tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
} else if (t <= 6.8e+44) {
tmp = t / (sqrt((t_2 + ((2.0 * (pow(t, 2.0) / x)) + ((2.0 * pow(t, 2.0)) + t_2)))) / sqrt(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))) t_2 = Float64((l ^ 2.0) / x) tmp = 0.0 if (t <= -3.6e-122) tmp = Float64(-t_1); elseif (t <= 3.6e-293) tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + (x ^ -2.0)))))); elseif (t <= 1.4e-237) 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.2e-139) tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0))); elseif (t <= 6.8e+44) tmp = Float64(t / Float64(sqrt(Float64(t_2 + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(Float64(2.0 * (t ^ 2.0)) + t_2)))) / 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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -3.6e-122], (-t$95$1), If[LessEqual[t, 3.6e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-237], 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.2e-139], 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, 6.8e+44], N[(t / N[(N[Sqrt[N[(t$95$2 + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \frac{{\ell}^{2}}{x}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + {x}^{-2}\right)}}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-237}:\\
\;\;\;\;\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.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_2 + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + t_2\right)\right)}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.59999999999999994e-122Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -3.59999999999999994e-122 < t < 3.59999999999999985e-293Initial program 7.4%
Simplified7.4%
Taylor expanded in l around inf 2.1%
associate--l+15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
Simplified15.7%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
*-commutative29.0%
+-commutative29.0%
pow-flip29.0%
metadata-eval29.0%
Applied egg-rr29.0%
if 3.59999999999999985e-293 < t < 1.39999999999999999e-237Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 43.2%
Taylor expanded in t around 0 43.2%
Taylor expanded in x around inf 76.8%
+-commutative76.8%
fma-def76.8%
associate--l+76.8%
fma-def76.8%
unpow276.8%
fma-neg76.8%
mul-1-neg76.8%
remove-double-neg76.8%
*-commutative76.8%
*-commutative76.8%
unpow276.8%
rem-square-sqrt76.8%
associate-*l*76.8%
Simplified76.8%
if 1.39999999999999999e-237 < t < 1.20000000000000007e-139Initial program 3.0%
Simplified3.0%
Taylor expanded in x around inf 44.5%
Taylor expanded in l around inf 51.3%
if 1.20000000000000007e-139 < t < 6.8e44Initial program 49.5%
Simplified49.4%
Taylor expanded in x around inf 79.4%
Taylor expanded in t around 0 79.4%
if 6.8e44 < t Initial program 28.0%
Simplified28.0%
Applied egg-rr86.2%
Taylor expanded in t around inf 93.8%
Final simplification79.6%
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)))) (t_2 (/ 1.0 (+ x -1.0))))
(if (<= t -5.4e-123)
(- t_1)
(if (<= t 1.5e-293)
(/ (* t (sqrt 2.0)) (* l (sqrt (+ t_2 (+ (/ 1.0 x) (pow x -2.0))))))
(if (<= t 7.5e-237)
(/
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 4.5e-28)
(*
(sqrt 2.0)
(/ t (* l (sqrt (+ t_2 (+ (/ 1.0 x) (* (/ 1.0 x) (/ 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 t_2 = 1.0 / (x + -1.0);
double tmp;
if (t <= -5.4e-123) {
tmp = -t_1;
} else if (t <= 1.5e-293) {
tmp = (t * sqrt(2.0)) / (l * sqrt((t_2 + ((1.0 / x) + pow(x, -2.0)))));
} else if (t <= 7.5e-237) {
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 <= 4.5e-28) {
tmp = sqrt(2.0) * (t / (l * sqrt((t_2 + ((1.0 / x) + ((1.0 / x) * (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))) t_2 = Float64(1.0 / Float64(x + -1.0)) tmp = 0.0 if (t <= -5.4e-123) tmp = Float64(-t_1); elseif (t <= 1.5e-293) tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(t_2 + Float64(Float64(1.0 / x) + (x ^ -2.0)))))); elseif (t <= 7.5e-237) 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 <= 4.5e-28) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(t_2 + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / x) * 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]}, Block[{t$95$2 = N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e-123], (-t$95$1), If[LessEqual[t, 1.5e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(t$95$2 + N[(N[(1.0 / x), $MachinePrecision] + N[Power[x, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-237], 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, 4.5e-28], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(t$95$2 + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $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}}\\
t_2 := \frac{1}{x + -1}\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{-123}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + {x}^{-2}\right)}}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-237}:\\
\;\;\;\;\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 4.5 \cdot 10^{-28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{t_2 + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.4000000000000002e-123Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -5.4000000000000002e-123 < t < 1.5000000000000001e-293Initial program 7.4%
Simplified7.4%
Taylor expanded in l around inf 2.1%
associate--l+15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
sub-neg15.7%
metadata-eval15.7%
+-commutative15.7%
Simplified15.7%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
*-commutative29.0%
+-commutative29.0%
pow-flip29.0%
metadata-eval29.0%
Applied egg-rr29.0%
if 1.5000000000000001e-293 < t < 7.50000000000000034e-237Initial program 2.3%
Simplified2.3%
Taylor expanded in x around inf 43.2%
Taylor expanded in t around 0 43.2%
Taylor expanded in x around inf 76.8%
+-commutative76.8%
fma-def76.8%
associate--l+76.8%
fma-def76.8%
unpow276.8%
fma-neg76.8%
mul-1-neg76.8%
remove-double-neg76.8%
*-commutative76.8%
*-commutative76.8%
unpow276.8%
rem-square-sqrt76.8%
associate-*l*76.8%
Simplified76.8%
if 7.50000000000000034e-237 < t < 4.4999999999999998e-28Initial program 18.9%
Simplified18.9%
Taylor expanded in l around inf 1.8%
associate--l+13.4%
sub-neg13.4%
metadata-eval13.4%
+-commutative13.4%
sub-neg13.4%
metadata-eval13.4%
+-commutative13.4%
Simplified13.4%
Taylor expanded in x around inf 41.6%
inv-pow41.6%
unpow241.6%
pow-prod-down41.6%
inv-pow41.6%
inv-pow41.6%
Applied egg-rr41.6%
if 4.4999999999999998e-28 < t Initial program 35.4%
Simplified35.4%
Applied egg-rr83.6%
Taylor expanded in t around inf 92.3%
Final simplification76.2%
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.6e-122)
(- t_1)
(if (<= t 9e-28)
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt
(+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (* (/ 1.0 x) (/ 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.6e-122) {
tmp = -t_1;
} else if (t <= 9e-28) {
tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x)))))));
} 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 <= (-3.6d-122)) then
tmp = -t_1
else if (t <= 9d-28) then
tmp = sqrt(2.0d0) * (t / (l * sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + ((1.0d0 / x) * (1.0d0 / x)))))))
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 <= -3.6e-122) {
tmp = -t_1;
} else if (t <= 9e-28) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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.6e-122: tmp = -t_1 elif t <= 9e-28: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (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.6e-122) tmp = Float64(-t_1); elseif (t <= 9e-28) 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) * Float64(1.0 / x)))))))); 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 <= -3.6e-122) tmp = -t_1; elseif (t <= 9e-28) tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / x) * (1.0 / x))))))); 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, -3.6e-122], (-t$95$1), If[LessEqual[t, 9e-28], 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 / x), $MachinePrecision] * N[(1.0 / x), $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 -3.6 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{x} \cdot \frac{1}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.59999999999999994e-122Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -3.59999999999999994e-122 < t < 8.9999999999999996e-28Initial program 12.5%
Simplified12.5%
Taylor expanded in l around inf 1.9%
associate--l+15.4%
sub-neg15.4%
metadata-eval15.4%
+-commutative15.4%
sub-neg15.4%
metadata-eval15.4%
+-commutative15.4%
Simplified15.4%
Taylor expanded in x around inf 36.2%
inv-pow36.2%
unpow236.2%
pow-prod-down36.2%
inv-pow36.2%
inv-pow36.2%
Applied egg-rr36.2%
if 8.9999999999999996e-28 < t Initial program 35.4%
Simplified35.4%
Applied egg-rr83.6%
Taylor expanded in t around inf 92.3%
Final simplification74.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -1.35e-122)
(/ t (- (- t) (/ t x)))
(if (<= t 4.5e-28)
(/ t (* l (sqrt (/ 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 <= -1.35e-122) {
tmp = t / (-t - (t / x));
} else if (t <= 4.5e-28) {
tmp = t / (l * sqrt((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 <= (-1.35d-122)) then
tmp = t / (-t - (t / x))
else if (t <= 4.5d-28) then
tmp = t / (l * sqrt((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 <= -1.35e-122) {
tmp = t / (-t - (t / x));
} else if (t <= 4.5e-28) {
tmp = t / (l * Math.sqrt((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 <= -1.35e-122: tmp = t / (-t - (t / x)) elif t <= 4.5e-28: tmp = t / (l * math.sqrt((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 <= -1.35e-122) tmp = Float64(t / Float64(Float64(-t) - Float64(t / x))); elseif (t <= 4.5e-28) tmp = Float64(t / Float64(l * sqrt(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 <= -1.35e-122) tmp = t / (-t - (t / x)); elseif (t <= 4.5e-28) tmp = t / (l * sqrt((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, -1.35e-122], N[(t / N[((-t) - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-28], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $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 -1.35 \cdot 10^{-122}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -1.35000000000000005e-122Initial program 37.9%
Simplified37.9%
Taylor expanded in t around inf 1.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt91.6%
mul-1-neg91.6%
Simplified91.6%
if -1.35000000000000005e-122 < t < 4.4999999999999998e-28Initial program 12.5%
Simplified12.5%
Taylor expanded in x around inf 49.7%
Taylor expanded in t around 0 49.7%
Taylor expanded in l around inf 36.3%
if 4.4999999999999998e-28 < t Initial program 35.4%
Simplified35.4%
Applied egg-rr83.6%
Taylor expanded in t around inf 92.3%
Final simplification73.9%
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 -1.35e-122)
(- t_1)
(if (<= t 4.5e-28) (/ t (* l (sqrt (/ 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 <= -1.35e-122) {
tmp = -t_1;
} else if (t <= 4.5e-28) {
tmp = t / (l * sqrt((1.0 / x)));
} 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 <= (-1.35d-122)) then
tmp = -t_1
else if (t <= 4.5d-28) then
tmp = t / (l * sqrt((1.0d0 / x)))
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 <= -1.35e-122) {
tmp = -t_1;
} else if (t <= 4.5e-28) {
tmp = t / (l * Math.sqrt((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 <= -1.35e-122: tmp = -t_1 elif t <= 4.5e-28: tmp = t / (l * math.sqrt((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 <= -1.35e-122) tmp = Float64(-t_1); elseif (t <= 4.5e-28) tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x)))); 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 <= -1.35e-122) tmp = -t_1; elseif (t <= 4.5e-28) tmp = t / (l * sqrt((1.0 / x))); 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, -1.35e-122], (-t$95$1), If[LessEqual[t, 4.5e-28], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $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 -1.35 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.35000000000000005e-122Initial program 37.9%
Simplified37.8%
Applied egg-rr80.0%
Taylor expanded in t around -inf 92.5%
mul-1-neg92.5%
sub-neg92.5%
metadata-eval92.5%
Simplified92.5%
if -1.35000000000000005e-122 < t < 4.4999999999999998e-28Initial program 12.5%
Simplified12.5%
Taylor expanded in x around inf 49.7%
Taylor expanded in t around 0 49.7%
Taylor expanded in l around inf 36.3%
if 4.4999999999999998e-28 < t Initial program 35.4%
Simplified35.4%
Applied egg-rr83.6%
Taylor expanded in t around inf 92.3%
Final simplification74.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-310) (/ t (- (- t) (/ t x))) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-310) {
tmp = t / (-t - (t / 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 <= (-4d-310)) then
tmp = t / (-t - (t / 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 <= -4e-310) {
tmp = t / (-t - (t / 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 <= -4e-310: tmp = t / (-t - (t / 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 <= -4e-310) tmp = Float64(t / Float64(Float64(-t) - Float64(t / 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 <= -4e-310) tmp = t / (-t - (t / 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, -4e-310], N[(t / N[((-t) - N[(t / x), $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 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.999999999999988e-310Initial program 32.0%
Simplified32.0%
Taylor expanded in t around inf 1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt80.7%
mul-1-neg80.7%
Simplified80.7%
if -3.999999999999988e-310 < t Initial program 26.1%
Simplified26.1%
Applied egg-rr63.5%
Taylor expanded in t around inf 71.2%
Final simplification75.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-310) (/ t (- (- t) (/ t x))) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-310) {
tmp = t / (-t - (t / 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 <= (-4d-310)) then
tmp = t / (-t - (t / 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 <= -4e-310) {
tmp = t / (-t - (t / x));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-310: tmp = t / (-t - (t / x)) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4e-310) tmp = Float64(t / Float64(Float64(-t) - Float64(t / 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 <= -4e-310) tmp = t / (-t - (t / 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, -4e-310], N[(t / N[((-t) - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.999999999999988e-310Initial program 32.0%
Simplified32.0%
Taylor expanded in t around inf 1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt80.7%
mul-1-neg80.7%
Simplified80.7%
if -3.999999999999988e-310 < t Initial program 26.1%
Simplified26.1%
Taylor expanded in t around inf 71.2%
+-commutative71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in x around inf 70.1%
Final simplification75.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-310) (/ t (- t)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-310) {
tmp = t / -t;
} 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 <= (-4d-310)) then
tmp = t / -t
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 <= -4e-310) {
tmp = t / -t;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-310: tmp = t / -t else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4e-310) tmp = Float64(t / Float64(-t)); 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 <= -4e-310) tmp = t / -t; 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, -4e-310], N[(t / (-t)), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.999999999999988e-310Initial program 32.0%
Simplified32.0%
Taylor expanded in t around inf 1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt79.6%
mul-1-neg79.6%
Simplified79.6%
if -3.999999999999988e-310 < t Initial program 26.1%
Simplified26.1%
Taylor expanded in t around inf 71.2%
+-commutative71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in x around inf 70.1%
Final simplification74.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-310) (/ t (- t)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-310) {
tmp = t / -t;
} 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 <= (-4d-310)) then
tmp = t / -t
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 <= -4e-310) {
tmp = t / -t;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-310: tmp = t / -t else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4e-310) tmp = Float64(t / Float64(-t)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4e-310) tmp = t / -t; 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, -4e-310], N[(t / (-t)), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -3.999999999999988e-310Initial program 32.0%
Simplified32.0%
Taylor expanded in t around inf 1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt79.6%
mul-1-neg79.6%
Simplified79.6%
if -3.999999999999988e-310 < t Initial program 26.1%
Simplified26.1%
Taylor expanded in t around inf 71.2%
+-commutative71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in x around inf 69.8%
Final simplification74.6%
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 29.0%
Simplified28.9%
Taylor expanded in t around inf 37.3%
+-commutative37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in x around inf 36.5%
Final simplification36.5%
herbie shell --seed 2023311
(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)))))