
(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 10 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))))
(if (<= t -5.2e-161)
(- t_1)
(if (<= t 1.05e-304)
(/
t
(*
(sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 2.0)))))
(/ l (sqrt 2.0))))
(if (<= t 5e-160)
1.0
(if (<= t 6.4e+18)
(/
t
(/
(sqrt
(+
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x)))
(/ (+ t_2 (pow l 2.0)) 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 <= -5.2e-161) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
tmp = t / (sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / pow(x, 2.0))))) * (l / sqrt(2.0)));
} else if (t <= 5e-160) {
tmp = 1.0;
} else if (t <= 6.4e+18) {
tmp = t / (sqrt((((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x))) + ((t_2 + pow(l, 2.0)) / x))) / sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = 2.0d0 * (t ** 2.0d0)
if (t <= (-5.2d-161)) then
tmp = -t_1
else if (t <= 1.05d-304) then
tmp = t / (sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + (1.0d0 / (x ** 2.0d0))))) * (l / sqrt(2.0d0)))
else if (t <= 5d-160) then
tmp = 1.0d0
else if (t <= 6.4d+18) then
tmp = t / (sqrt((((2.0d0 * ((t ** 2.0d0) / x)) + (t_2 + ((l ** 2.0d0) / x))) + ((t_2 + (l ** 2.0d0)) / x))) / sqrt(2.0d0))
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = 2.0 * Math.pow(t, 2.0);
double tmp;
if (t <= -5.2e-161) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
tmp = t / (Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 2.0))))) * (l / Math.sqrt(2.0)));
} else if (t <= 5e-160) {
tmp = 1.0;
} else if (t <= 6.4e+18) {
tmp = t / (Math.sqrt((((2.0 * (Math.pow(t, 2.0) / x)) + (t_2 + (Math.pow(l, 2.0) / x))) + ((t_2 + Math.pow(l, 2.0)) / x))) / Math.sqrt(2.0));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = 2.0 * math.pow(t, 2.0) tmp = 0 if t <= -5.2e-161: tmp = -t_1 elif t <= 1.05e-304: tmp = t / (math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / math.pow(x, 2.0))))) * (l / math.sqrt(2.0))) elif t <= 5e-160: tmp = 1.0 elif t <= 6.4e+18: tmp = t / (math.sqrt((((2.0 * (math.pow(t, 2.0) / x)) + (t_2 + (math.pow(l, 2.0) / x))) + ((t_2 + math.pow(l, 2.0)) / x))) / math.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 <= -5.2e-161) tmp = Float64(-t_1); elseif (t <= 1.05e-304) tmp = Float64(t / Float64(sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0))))) * Float64(l / sqrt(2.0)))); elseif (t <= 5e-160) tmp = 1.0; elseif (t <= 6.4e+18) 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(t_2 + (l ^ 2.0)) / x))) / sqrt(2.0))); 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))); t_2 = 2.0 * (t ^ 2.0); tmp = 0.0; if (t <= -5.2e-161) tmp = -t_1; elseif (t <= 1.05e-304) tmp = t / (sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / (x ^ 2.0))))) * (l / sqrt(2.0))); elseif (t <= 5e-160) tmp = 1.0; elseif (t <= 6.4e+18) tmp = t / (sqrt((((2.0 * ((t ^ 2.0) / x)) + (t_2 + ((l ^ 2.0) / x))) + ((t_2 + (l ^ 2.0)) / x))) / sqrt(2.0)); else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(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, -5.2e-161], (-t$95$1), If[LessEqual[t, 1.05e-304], N[(t / N[(N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-160], 1.0, If[LessEqual[t, 6.4e+18], 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[(t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $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 -5.2 \cdot 10^{-161}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)} \cdot \frac{\ell}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-160}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+18}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right) + \frac{t_2 + {\ell}^{2}}{x}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.19999999999999991e-161Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around 0 86.2%
mul-1-neg86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
if -5.19999999999999991e-161 < t < 1.05000000000000004e-304Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 4.0%
*-commutative4.0%
associate--l+30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
Simplified30.9%
Taylor expanded in x around inf 58.4%
if 1.05000000000000004e-304 < t < 4.99999999999999994e-160Initial program 2.8%
Simplified2.8%
Taylor expanded in t around -inf 1.8%
mul-1-neg1.8%
*-commutative1.8%
distribute-rgt-neg-in1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in t around 0 1.8%
mul-1-neg1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt70.1%
Simplified70.1%
if 4.99999999999999994e-160 < t < 6.4e18Initial program 38.1%
Simplified38.1%
Taylor expanded in x around inf 84.5%
if 6.4e18 < t Initial program 35.3%
Simplified35.3%
Taylor expanded in t around inf 92.9%
+-commutative92.9%
sub-neg92.9%
metadata-eval92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around 0 92.9%
Final simplification83.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.65e-153)
(- t_1)
(if (<= t 1.05e-304)
(/
t
(*
(sqrt (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 2.0)))))
(/ l (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 tmp;
if (t <= -1.65e-153) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
tmp = t / (sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / pow(x, 2.0))))) * (l / sqrt(2.0)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.65d-153)) then
tmp = -t_1
else if (t <= 1.05d-304) then
tmp = t / (sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / x) + (1.0d0 / (x ** 2.0d0))))) * (l / sqrt(2.0d0)))
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.65e-153) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
tmp = t / (Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 2.0))))) * (l / Math.sqrt(2.0)));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.65e-153: tmp = -t_1 elif t <= 1.05e-304: tmp = t / (math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / math.pow(x, 2.0))))) * (l / math.sqrt(2.0))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.65e-153) tmp = Float64(-t_1); elseif (t <= 1.05e-304) tmp = Float64(t / Float64(sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0))))) * Float64(l / sqrt(2.0)))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.65e-153) tmp = -t_1; elseif (t <= 1.05e-304) tmp = t / (sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / (x ^ 2.0))))) * (l / sqrt(2.0))); else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.65e-153], (-t$95$1), If[LessEqual[t, 1.05e-304], N[(t / N[(N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{-153}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)} \cdot \frac{\ell}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.64999999999999994e-153Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around 0 86.2%
mul-1-neg86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
if -1.64999999999999994e-153 < t < 1.05000000000000004e-304Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 4.0%
*-commutative4.0%
associate--l+30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
Simplified30.9%
Taylor expanded in x around inf 58.4%
if 1.05000000000000004e-304 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
sub-neg79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in t around 0 79.5%
Final simplification80.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1.7e-161) (+ -1.0 (/ 1.0 x)) (if (<= t 1.26e-306) (* (/ t l) (sqrt x)) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.7e-161) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.26e-306) {
tmp = (t / l) * sqrt(x);
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.7d-161)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 1.26d-306) then
tmp = (t / l) * sqrt(x)
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1.7e-161) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.26e-306) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.7e-161: tmp = -1.0 + (1.0 / x) elif t <= 1.26e-306: tmp = (t / l) * math.sqrt(x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.7e-161) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.26e-306) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.7e-161) tmp = -1.0 + (1.0 / x); elseif (t <= 1.26e-306) tmp = (t / l) * sqrt(x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1.7e-161], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.26e-306], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-161}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-306}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -1.69999999999999991e-161Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in x around inf 84.5%
if -1.69999999999999991e-161 < t < 1.2600000000000001e-306Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 3.6%
*-commutative3.6%
associate--l+30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
associate-/l*30.4%
Simplified30.4%
Taylor expanded in x around inf 53.1%
sqrt-div53.2%
metadata-eval53.2%
frac-times57.0%
*-un-lft-identity57.0%
add-sqr-sqrt57.0%
add-sqr-sqrt57.0%
hypot-def57.1%
inv-pow57.1%
sqrt-pow157.1%
+-commutative57.1%
metadata-eval57.1%
inv-pow57.1%
sqrt-pow157.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in x around inf 53.3%
if 1.2600000000000001e-306 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
sub-neg79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in t around 0 79.5%
Final simplification79.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -3.55e-158)
(+ -1.0 (/ 1.0 x))
(if (<= t 1.26e-306)
(/ 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 <= -3.55e-158) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.26e-306) {
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 <= (-3.55d-158)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 1.26d-306) 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 <= -3.55e-158) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 1.26e-306) {
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 <= -3.55e-158: tmp = -1.0 + (1.0 / x) elif t <= 1.26e-306: 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 <= -3.55e-158) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 1.26e-306) 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 <= -3.55e-158) tmp = -1.0 + (1.0 / x); elseif (t <= 1.26e-306) 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, -3.55e-158], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.26e-306], 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 -3.55 \cdot 10^{-158}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-306}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.55000000000000002e-158Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in x around inf 84.5%
if -3.55000000000000002e-158 < t < 1.2600000000000001e-306Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 3.6%
*-commutative3.6%
associate--l+30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
associate-/l*30.4%
Simplified30.4%
Taylor expanded in x around inf 53.1%
sqrt-div53.2%
metadata-eval53.2%
frac-times57.0%
*-un-lft-identity57.0%
add-sqr-sqrt57.0%
add-sqr-sqrt57.0%
hypot-def57.1%
inv-pow57.1%
sqrt-pow157.1%
+-commutative57.1%
metadata-eval57.1%
inv-pow57.1%
sqrt-pow157.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in x around inf 57.2%
if 1.2600000000000001e-306 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
sub-neg79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in t around 0 79.5%
Final simplification79.5%
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 -8e-152)
(- t_1)
(if (<= t 1.05e-304) (/ 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 <= -8e-152) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
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 <= (-8d-152)) then
tmp = -t_1
else if (t <= 1.05d-304) 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 <= -8e-152) {
tmp = -t_1;
} else if (t <= 1.05e-304) {
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 <= -8e-152: tmp = -t_1 elif t <= 1.05e-304: 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 <= -8e-152) tmp = Float64(-t_1); elseif (t <= 1.05e-304) 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 <= -8e-152) tmp = -t_1; elseif (t <= 1.05e-304) 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, -8e-152], (-t$95$1), If[LessEqual[t, 1.05e-304], 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 -8 \cdot 10^{-152}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.00000000000000053e-152Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around 0 86.2%
mul-1-neg86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
if -8.00000000000000053e-152 < t < 1.05000000000000004e-304Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 3.6%
*-commutative3.6%
associate--l+30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
associate-/l*30.4%
Simplified30.4%
Taylor expanded in x around inf 53.1%
sqrt-div53.2%
metadata-eval53.2%
frac-times57.0%
*-un-lft-identity57.0%
add-sqr-sqrt57.0%
add-sqr-sqrt57.0%
hypot-def57.1%
inv-pow57.1%
sqrt-pow157.1%
+-commutative57.1%
metadata-eval57.1%
inv-pow57.1%
sqrt-pow157.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in x around inf 57.2%
if 1.05000000000000004e-304 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around inf 79.5%
+-commutative79.5%
sub-neg79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in t around 0 79.5%
Final simplification80.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4.3e-160) (+ -1.0 (/ 1.0 x)) (if (<= t 8e-305) (* (/ t l) (sqrt x)) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4.3e-160) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 8e-305) {
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 <= (-4.3d-160)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 8d-305) 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 <= -4.3e-160) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 8e-305) {
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 <= -4.3e-160: tmp = -1.0 + (1.0 / x) elif t <= 8e-305: 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 <= -4.3e-160) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 8e-305) tmp = Float64(Float64(t / 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 <= -4.3e-160) tmp = -1.0 + (1.0 / x); elseif (t <= 8e-305) 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, -4.3e-160], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-305], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-160}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-305}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.30000000000000014e-160Initial program 39.7%
Simplified39.7%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
+-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in x around inf 84.5%
if -4.30000000000000014e-160 < t < 7.99999999999999997e-305Initial program 1.9%
Simplified1.9%
Taylor expanded in l around inf 3.6%
*-commutative3.6%
associate--l+30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
sub-neg30.4%
metadata-eval30.4%
+-commutative30.4%
associate-/l*30.4%
Simplified30.4%
Taylor expanded in x around inf 53.1%
sqrt-div53.2%
metadata-eval53.2%
frac-times57.0%
*-un-lft-identity57.0%
add-sqr-sqrt57.0%
add-sqr-sqrt57.0%
hypot-def57.1%
inv-pow57.1%
sqrt-pow157.1%
+-commutative57.1%
metadata-eval57.1%
inv-pow57.1%
sqrt-pow157.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in x around inf 53.3%
if 7.99999999999999997e-305 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around -inf 1.7%
mul-1-neg1.7%
*-commutative1.7%
distribute-rgt-neg-in1.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%
+-commutative0.0%
unpow20.0%
rem-square-sqrt78.9%
Simplified78.9%
Final simplification78.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) 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 32.8%
Simplified32.7%
Taylor expanded in t around -inf 75.5%
mul-1-neg75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
+-commutative75.5%
sub-neg75.5%
metadata-eval75.5%
+-commutative75.5%
Simplified75.5%
Taylor expanded in x around inf 74.1%
if -4.999999999999985e-310 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around -inf 1.7%
mul-1-neg1.7%
*-commutative1.7%
distribute-rgt-neg-in1.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-sqrt78.3%
Simplified78.3%
Final simplification76.1%
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 32.8%
Simplified32.7%
Taylor expanded in t around -inf 75.5%
mul-1-neg75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
+-commutative75.5%
sub-neg75.5%
metadata-eval75.5%
+-commutative75.5%
Simplified75.5%
Taylor expanded in x around inf 74.1%
if -4.999999999999985e-310 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around -inf 1.7%
mul-1-neg1.7%
*-commutative1.7%
distribute-rgt-neg-in1.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%
+-commutative0.0%
unpow20.0%
rem-square-sqrt78.9%
Simplified78.9%
Final simplification76.3%
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 32.8%
Simplified32.7%
Taylor expanded in t around -inf 75.5%
mul-1-neg75.5%
*-commutative75.5%
distribute-rgt-neg-in75.5%
+-commutative75.5%
sub-neg75.5%
metadata-eval75.5%
+-commutative75.5%
Simplified75.5%
Taylor expanded in x around inf 73.3%
if -4.999999999999985e-310 < t Initial program 31.0%
Simplified31.0%
Taylor expanded in t around -inf 1.7%
mul-1-neg1.7%
*-commutative1.7%
distribute-rgt-neg-in1.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-sqrt78.3%
Simplified78.3%
Final simplification75.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 31.9%
Simplified31.9%
Taylor expanded in t around -inf 40.9%
mul-1-neg40.9%
*-commutative40.9%
distribute-rgt-neg-in40.9%
+-commutative40.9%
sub-neg40.9%
metadata-eval40.9%
+-commutative40.9%
Simplified40.9%
Taylor expanded in x around inf 39.7%
Final simplification39.7%
herbie shell --seed 2023308
(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)))))