
(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 (* 2.0 (pow t 2.0))))
(if (<= t -6.4e+66)
(/ t (* t (- (sqrt (/ (+ x 1.0) (+ x -1.0))))))
(if (<= t -1.12e-148)
(/
t
(/
(sqrt
(+
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 (/ (pow l 2.0) x)))
(/ (+ t_1 (pow l 2.0)) x)))
(sqrt 2.0)))
(if (<= t 2.9e-140) (/ t (* l (sqrt (/ 1.0 x)))) (+ 1.0 (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 * pow(t, 2.0);
double tmp;
if (t <= -6.4e+66) {
tmp = t / (t * -sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.12e-148) {
tmp = t / (sqrt((((2.0 * (pow(t, 2.0) / x)) + (t_1 + (pow(l, 2.0) / x))) + ((t_1 + pow(l, 2.0)) / x))) / sqrt(2.0));
} else if (t <= 2.9e-140) {
tmp = t / (l * sqrt((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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (t ** 2.0d0)
if (t <= (-6.4d+66)) then
tmp = t / (t * -sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= (-1.12d-148)) then
tmp = t / (sqrt((((2.0d0 * ((t ** 2.0d0) / x)) + (t_1 + ((l ** 2.0d0) / x))) + ((t_1 + (l ** 2.0d0)) / x))) / sqrt(2.0d0))
else if (t <= 2.9d-140) then
tmp = t / (l * sqrt((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 t_1 = 2.0 * Math.pow(t, 2.0);
double tmp;
if (t <= -6.4e+66) {
tmp = t / (t * -Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -1.12e-148) {
tmp = t / (Math.sqrt((((2.0 * (Math.pow(t, 2.0) / x)) + (t_1 + (Math.pow(l, 2.0) / x))) + ((t_1 + Math.pow(l, 2.0)) / x))) / Math.sqrt(2.0));
} else if (t <= 2.9e-140) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 2.0 * math.pow(t, 2.0) tmp = 0 if t <= -6.4e+66: tmp = t / (t * -math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= -1.12e-148: tmp = t / (math.sqrt((((2.0 * (math.pow(t, 2.0) / x)) + (t_1 + (math.pow(l, 2.0) / x))) + ((t_1 + math.pow(l, 2.0)) / x))) / math.sqrt(2.0)) elif t <= 2.9e-140: tmp = t / (l * math.sqrt((1.0 / x))) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 * (t ^ 2.0)) tmp = 0.0 if (t <= -6.4e+66) tmp = Float64(t / Float64(t * Float64(-sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))))); elseif (t <= -1.12e-148) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + Float64((l ^ 2.0) / x))) + Float64(Float64(t_1 + (l ^ 2.0)) / x))) / sqrt(2.0))); elseif (t <= 2.9e-140) tmp = Float64(t / Float64(l * sqrt(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) t_1 = 2.0 * (t ^ 2.0); tmp = 0.0; if (t <= -6.4e+66) tmp = t / (t * -sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= -1.12e-148) tmp = t / (sqrt((((2.0 * ((t ^ 2.0) / x)) + (t_1 + ((l ^ 2.0) / x))) + ((t_1 + (l ^ 2.0)) / x))) / sqrt(2.0)); elseif (t <= 2.9e-140) tmp = t / (l * sqrt((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_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.4e+66], N[(t / N[(t * (-N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.12e-148], N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-140], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
\mathbf{if}\;t \leq -6.4 \cdot 10^{+66}:\\
\;\;\;\;\frac{t}{t \cdot \left(-\sqrt{\frac{x + 1}{x + -1}}\right)}\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{-148}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{t_1 + {\ell}^{2}}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-140}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -6.3999999999999999e66Initial program 31.6%
Simplified31.7%
Taylor expanded in t around -inf 98.5%
associate-*r*98.5%
neg-mul-198.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
+-commutative98.5%
Simplified98.5%
if -6.3999999999999999e66 < t < -1.1199999999999999e-148Initial program 57.0%
Simplified57.0%
Taylor expanded in x around inf 87.6%
if -1.1199999999999999e-148 < t < 2.89999999999999997e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
Taylor expanded in l around 0 51.2%
if 2.89999999999999997e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification81.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-146) (/ t (* t (- (sqrt (/ (+ x 1.0) (+ x -1.0)))))) (if (<= t 2.9e-140) (/ t (* l (sqrt (/ 1.0 x)))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-146) {
tmp = t / (t * -sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 2.9e-140) {
tmp = t / (l * sqrt((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 <= (-4d-146)) then
tmp = t / (t * -sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
else if (t <= 2.9d-140) then
tmp = t / (l * sqrt((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 <= -4e-146) {
tmp = t / (t * -Math.sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= 2.9e-140) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-146: tmp = t / (t * -math.sqrt(((x + 1.0) / (x + -1.0)))) elif t <= 2.9e-140: tmp = t / (l * math.sqrt((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 <= -4e-146) tmp = Float64(t / Float64(t * Float64(-sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))))); elseif (t <= 2.9e-140) tmp = Float64(t / Float64(l * sqrt(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 <= -4e-146) tmp = t / (t * -sqrt(((x + 1.0) / (x + -1.0)))); elseif (t <= 2.9e-140) tmp = t / (l * sqrt((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, -4e-146], N[(t / N[(t * (-N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-140], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $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^{-146}:\\
\;\;\;\;\frac{t}{t \cdot \left(-\sqrt{\frac{x + 1}{x + -1}}\right)}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-140}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.0000000000000001e-146Initial program 41.4%
Simplified41.5%
Taylor expanded in t around -inf 89.9%
associate-*r*89.9%
neg-mul-189.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
if -4.0000000000000001e-146 < t < 2.89999999999999997e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
Taylor expanded in l around 0 51.2%
if 2.89999999999999997e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification80.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -3.45e-143) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 4e-140) (/ t (* l (sqrt (/ 1.0 x)))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -3.45e-143) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 4e-140) {
tmp = t / (l * sqrt((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 <= (-3.45d-143)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 4d-140) then
tmp = t / (l * sqrt((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 <= -3.45e-143) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 4e-140) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -3.45e-143: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 4e-140: tmp = t / (l * math.sqrt((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 <= -3.45e-143) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 4e-140) tmp = Float64(t / Float64(l * sqrt(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 <= -3.45e-143) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 4e-140) tmp = t / (l * sqrt((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, -3.45e-143], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-140], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.45 \cdot 10^{-143}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-140}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.44999999999999994e-143Initial program 41.4%
Simplified41.5%
Taylor expanded in t around -inf 89.9%
associate-*r*89.9%
neg-mul-189.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around inf 89.0%
associate-*r/89.0%
metadata-eval89.0%
Simplified89.0%
unpow289.0%
Applied egg-rr89.0%
if -3.44999999999999994e-143 < t < 3.9999999999999999e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
Taylor expanded in l around 0 51.2%
if 3.9999999999999999e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification79.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1.6e-141) (- (sqrt (/ (+ x -1.0) (+ x 1.0)))) (if (<= t 2.9e-140) (/ t (* l (sqrt (/ 1.0 x)))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.6e-141) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2.9e-140) {
tmp = t / (l * sqrt((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 <= (-1.6d-141)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 2.9d-140) then
tmp = t / (l * sqrt((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 <= -1.6e-141) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2.9e-140) {
tmp = t / (l * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.6e-141: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 2.9e-140: tmp = t / (l * math.sqrt((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 <= -1.6e-141) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 2.9e-140) tmp = Float64(t / Float64(l * sqrt(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 <= -1.6e-141) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 2.9e-140) tmp = t / (l * sqrt((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, -1.6e-141], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 2.9e-140], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-141}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-140}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.6000000000000001e-141Initial program 41.4%
Simplified41.5%
Taylor expanded in t around -inf 89.9%
associate-*r*89.9%
neg-mul-189.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in t around 0 89.9%
mul-1-neg89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
if -1.6000000000000001e-141 < t < 2.89999999999999997e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
Taylor expanded in l around 0 51.2%
if 2.89999999999999997e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification80.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -3.9e-205) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 3.7e-140) (* (sqrt x) (/ t l)) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -3.9e-205) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.7e-140) {
tmp = sqrt(x) * (t / l);
} 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 <= (-3.9d-205)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 3.7d-140) then
tmp = sqrt(x) * (t / l)
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 <= -3.9e-205) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.7e-140) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -3.9e-205: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 3.7e-140: tmp = math.sqrt(x) * (t / l) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -3.9e-205) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 3.7e-140) tmp = Float64(sqrt(x) * Float64(t / l)); 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 <= -3.9e-205) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 3.7e-140) tmp = sqrt(x) * (t / l); 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, -3.9e-205], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-140], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-205}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-140}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.90000000000000018e-205Initial program 36.4%
Simplified36.5%
Taylor expanded in t around -inf 84.7%
associate-*r*84.7%
neg-mul-184.7%
+-commutative84.7%
sub-neg84.7%
metadata-eval84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in x around inf 83.9%
associate-*r/83.9%
metadata-eval83.9%
Simplified83.9%
unpow283.9%
Applied egg-rr83.9%
if -3.90000000000000018e-205 < t < 3.69999999999999977e-140Initial program 5.4%
Simplified5.4%
Taylor expanded in x around inf 57.9%
Taylor expanded in t around 0 57.4%
cancel-sign-sub-inv57.4%
metadata-eval57.4%
distribute-rgt1-in57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in t around 0 51.2%
if 3.69999999999999977e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification79.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -9.2e-146) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 3e-140) (* t (/ (sqrt x) l)) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -9.2e-146) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3e-140) {
tmp = t * (sqrt(x) / l);
} 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 <= (-9.2d-146)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 3d-140) then
tmp = t * (sqrt(x) / l)
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 <= -9.2e-146) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3e-140) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -9.2e-146: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 3e-140: tmp = t * (math.sqrt(x) / l) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -9.2e-146) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 3e-140) tmp = Float64(t * Float64(sqrt(x) / l)); 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 <= -9.2e-146) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 3e-140) tmp = t * (sqrt(x) / l); 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, -9.2e-146], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-140], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-146}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-140}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -9.2000000000000003e-146Initial program 41.4%
Simplified41.5%
Taylor expanded in t around -inf 89.9%
associate-*r*89.9%
neg-mul-189.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around inf 89.0%
associate-*r/89.0%
metadata-eval89.0%
Simplified89.0%
unpow289.0%
Applied egg-rr89.0%
if -9.2000000000000003e-146 < t < 3.00000000000000018e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
clear-num51.2%
associate-/r/52.3%
clear-num52.3%
sqrt-undiv52.4%
associate-*r/52.4%
Applied egg-rr52.4%
Taylor expanded in l around 0 51.0%
associate-*l/51.0%
*-lft-identity51.0%
Simplified51.0%
if 3.00000000000000018e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification79.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1.65e-141) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 3.3e-140) (/ t (/ l (sqrt x))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.65e-141) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.3e-140) {
tmp = t / (l / sqrt(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 <= (-1.65d-141)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 3.3d-140) then
tmp = t / (l / sqrt(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 <= -1.65e-141) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 3.3e-140) {
tmp = t / (l / Math.sqrt(x));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.65e-141: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 3.3e-140: tmp = t / (l / math.sqrt(x)) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.65e-141) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 3.3e-140) tmp = Float64(t / Float64(l / sqrt(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 <= -1.65e-141) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 3.3e-140) tmp = t / (l / sqrt(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, -1.65e-141], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-140], N[(t / N[(l / N[Sqrt[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 -1.65 \cdot 10^{-141}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-140}:\\
\;\;\;\;\frac{t}{\frac{\ell}{\sqrt{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.65e-141Initial program 41.4%
Simplified41.5%
Taylor expanded in t around -inf 89.9%
associate-*r*89.9%
neg-mul-189.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around inf 89.0%
associate-*r/89.0%
metadata-eval89.0%
Simplified89.0%
unpow289.0%
Applied egg-rr89.0%
if -1.65e-141 < t < 3.29999999999999987e-140Initial program 4.5%
Simplified4.5%
Taylor expanded in x around inf 52.7%
Taylor expanded in t around 0 52.2%
cancel-sign-sub-inv52.2%
metadata-eval52.2%
distribute-rgt1-in52.2%
metadata-eval52.2%
Simplified52.2%
expm1-log1p-u51.8%
expm1-udef24.7%
sqrt-undiv24.7%
*-commutative24.7%
associate-/l*24.7%
metadata-eval24.7%
Applied egg-rr24.7%
expm1-def52.0%
expm1-log1p52.5%
/-rgt-identity52.5%
Simplified52.5%
expm1-log1p-u52.1%
expm1-udef35.0%
sqrt-div34.4%
unpow234.4%
sqrt-prod24.4%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
expm1-def40.8%
expm1-log1p51.2%
Simplified51.2%
if 3.29999999999999987e-140 < t Initial program 38.7%
Simplified38.6%
Taylor expanded in t around -inf 1.6%
associate-*r*1.6%
neg-mul-11.6%
+-commutative1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in t around 0 1.6%
mul-1-neg1.6%
sub-neg1.6%
metadata-eval1.6%
+-commutative1.6%
Simplified1.6%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt87.6%
+-commutative87.6%
Simplified87.6%
Final simplification79.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.2%
Simplified33.3%
Taylor expanded in t around -inf 77.7%
associate-*r*77.7%
neg-mul-177.7%
+-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 77.0%
associate-*r/77.0%
metadata-eval77.0%
Simplified77.0%
unpow277.0%
Applied egg-rr77.0%
if -4.999999999999985e-310 < t Initial program 30.5%
Simplified30.4%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in t around 0 1.7%
mul-1-neg1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.0%
+-commutative76.0%
Simplified76.0%
Final simplification76.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-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 <= -5e-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 <= (-5d-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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, -5e-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 -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\left(-t\right) - \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.2%
Simplified33.3%
Taylor expanded in t around -inf 77.7%
associate-*r*77.7%
neg-mul-177.7%
+-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 76.8%
neg-mul-176.8%
+-commutative76.8%
unsub-neg76.8%
associate-*r/76.8%
neg-mul-176.8%
Simplified76.8%
if -4.999999999999985e-310 < t Initial program 30.5%
Simplified30.4%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in t around 0 1.7%
mul-1-neg1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.0%
+-commutative76.0%
Simplified76.0%
Final simplification76.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.2%
Simplified33.3%
Taylor expanded in t around -inf 77.7%
associate-*r*77.7%
neg-mul-177.7%
+-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 76.8%
if -4.999999999999985e-310 < t Initial program 30.5%
Simplified30.4%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in t around 0 1.7%
mul-1-neg1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.1%
Simplified75.1%
Final simplification76.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.2%
Simplified33.3%
Taylor expanded in t around -inf 77.7%
associate-*r*77.7%
neg-mul-177.7%
+-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 76.8%
if -4.999999999999985e-310 < t Initial program 30.5%
Simplified30.4%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in t around 0 1.7%
mul-1-neg1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt76.0%
+-commutative76.0%
Simplified76.0%
Final simplification76.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.2%
Simplified33.3%
Taylor expanded in t around -inf 77.7%
associate-*r*77.7%
neg-mul-177.7%
+-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 76.3%
if -4.999999999999985e-310 < t Initial program 30.5%
Simplified30.4%
Taylor expanded in t around -inf 1.7%
associate-*r*1.7%
neg-mul-11.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in t around 0 1.7%
mul-1-neg1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt75.1%
Simplified75.1%
Final simplification75.8%
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.9%
Simplified31.9%
Taylor expanded in t around -inf 41.2%
associate-*r*41.2%
neg-mul-141.2%
+-commutative41.2%
sub-neg41.2%
metadata-eval41.2%
+-commutative41.2%
Simplified41.2%
Taylor expanded in x around inf 40.5%
Final simplification40.5%
herbie shell --seed 2023299
(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)))))