
(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 14 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 (* l (/ l x))))
(if (<= t -5e+109)
(- t_1)
(if (<= t -1.26e-169)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (- (* 2.0 (fma t t (/ t (/ x t)))) (/ l (/ x (- l))))))))
(if (<= t 3.6e-179)
(/ (* t (sqrt x)) l)
(if (<= t 1.18e+88)
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (fma t t (* t (/ t x)))) (* 2.0 t_2)))))
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 = l * (l / x);
double tmp;
if (t <= -5e+109) {
tmp = -t_1;
} else if (t <= -1.26e-169) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + ((2.0 * fma(t, t, (t / (x / t)))) - (l / (x / -l))))));
} else if (t <= 3.6e-179) {
tmp = (t * sqrt(x)) / l;
} else if (t <= 1.18e+88) {
tmp = t * (sqrt(2.0) / sqrt(((2.0 * fma(t, t, (t * (t / x)))) + (2.0 * t_2))));
} 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 * Float64(l / x)) tmp = 0.0 if (t <= -5e+109) tmp = Float64(-t_1); elseif (t <= -1.26e-169) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(Float64(2.0 * fma(t, t, Float64(t / Float64(x / t)))) - Float64(l / Float64(x / Float64(-l)))))))); elseif (t <= 3.6e-179) tmp = Float64(Float64(t * sqrt(x)) / l); elseif (t <= 1.18e+88) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * fma(t, t, Float64(t * Float64(t / x)))) + Float64(2.0 * t_2))))); 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[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e+109], (-t$95$1), If[LessEqual[t, -1.26e-169], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(N[(2.0 * N[(t * t + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l / N[(x / (-l)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-179], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.18e+88], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * t + N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * t$95$2), $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 := \ell \cdot \frac{\ell}{x}\\
\mathbf{if}\;t \leq -5 \cdot 10^{+109}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -1.26 \cdot 10^{-169}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{\frac{x}{t}}\right) - \frac{\ell}{\frac{x}{-\ell}}\right)}}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-179}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 1.18 \cdot 10^{+88}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \mathsf{fma}\left(t, t, t \cdot \frac{t}{x}\right) + 2 \cdot t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.0000000000000001e109Initial program 14.0%
associate-*r/13.9%
fma-neg13.9%
remove-double-neg13.9%
fma-neg13.9%
sub-neg13.9%
metadata-eval13.9%
remove-double-neg13.9%
+-commutative13.9%
fma-def13.9%
Simplified13.9%
Taylor expanded in t around inf 5.4%
associate-/l*17.0%
+-commutative17.0%
sub-neg17.0%
metadata-eval17.0%
+-commutative17.0%
unpow217.0%
Simplified17.0%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
Simplified97.8%
if -5.0000000000000001e109 < t < -1.26e-169Initial program 53.7%
associate-*l/53.7%
Simplified53.7%
Taylor expanded in x around inf 71.4%
associate--l+71.4%
unpow271.4%
distribute-lft-out71.4%
unpow271.4%
unpow271.4%
associate-*r/71.4%
mul-1-neg71.4%
+-commutative71.4%
unpow271.4%
unpow271.4%
fma-udef71.4%
Simplified71.4%
Taylor expanded in t around 0 71.4%
associate-*r/71.4%
mul-1-neg71.4%
unpow271.4%
distribute-rgt-neg-in71.4%
Simplified71.4%
expm1-log1p-u69.9%
expm1-udef38.1%
associate-/l*38.1%
+-commutative38.1%
fma-def38.1%
Applied egg-rr38.1%
expm1-def69.9%
expm1-log1p71.4%
associate-/r/71.4%
associate-/l*71.4%
associate-/l*83.9%
Simplified83.9%
if -1.26e-169 < t < 3.60000000000000007e-179Initial program 4.1%
associate-*l/4.1%
Simplified4.1%
Taylor expanded in x around inf 55.3%
associate--l+55.3%
unpow255.3%
distribute-lft-out55.3%
unpow255.3%
unpow255.3%
associate-*r/55.3%
mul-1-neg55.3%
+-commutative55.3%
unpow255.3%
unpow255.3%
fma-udef55.3%
Simplified55.3%
Taylor expanded in t around 0 55.0%
cancel-sign-sub-inv55.0%
metadata-eval55.0%
distribute-rgt1-in55.0%
metadata-eval55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in l around 0 42.4%
associate-*l/47.8%
Applied egg-rr47.8%
if 3.60000000000000007e-179 < t < 1.1799999999999999e88Initial program 47.7%
associate-*l/47.7%
Simplified47.7%
Taylor expanded in x around inf 76.1%
associate--l+76.1%
unpow276.1%
distribute-lft-out76.1%
unpow276.1%
unpow276.1%
associate-*r/76.1%
mul-1-neg76.1%
+-commutative76.1%
unpow276.1%
unpow276.1%
fma-udef76.1%
Simplified76.1%
Taylor expanded in t around 0 76.1%
associate-*r/76.1%
mul-1-neg76.1%
unpow276.1%
distribute-rgt-neg-in76.1%
Simplified76.1%
expm1-log1p-u74.5%
expm1-udef36.7%
associate-/l*36.7%
+-commutative36.7%
fma-def36.7%
Applied egg-rr36.7%
expm1-def74.5%
expm1-log1p76.1%
+-commutative76.1%
distribute-rgt-neg-out76.1%
unpow276.1%
mul-1-neg76.1%
associate-*r/76.1%
cancel-sign-sub-inv76.1%
metadata-eval76.1%
*-lft-identity76.1%
associate-+l+76.1%
Simplified84.3%
if 1.1799999999999999e88 < t Initial program 15.6%
associate-*r/15.5%
fma-neg15.5%
remove-double-neg15.5%
fma-neg15.5%
sub-neg15.5%
metadata-eval15.5%
remove-double-neg15.5%
+-commutative15.5%
fma-def15.5%
Simplified15.5%
Taylor expanded in t around inf 5.1%
associate-/l*20.2%
+-commutative20.2%
sub-neg20.2%
metadata-eval20.2%
+-commutative20.2%
unpow220.2%
Simplified20.2%
Taylor expanded in t around 0 98.2%
Final simplification82.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* 2.0 (fma t t (* t (/ t x)))) (* 2.0 (* l (/ l x))))))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -7e+109)
(- t_2)
(if (<= t -1.7e-172)
t_1
(if (<= t 3.2e-179)
(/ (* t (sqrt x)) l)
(if (<= t 1.1e+88) t_1 t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * fma(t, t, (t * (t / x)))) + (2.0 * (l * (l / x))))));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7e+109) {
tmp = -t_2;
} else if (t <= -1.7e-172) {
tmp = t_1;
} else if (t <= 3.2e-179) {
tmp = (t * sqrt(x)) / l;
} else if (t <= 1.1e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * fma(t, t, Float64(t * Float64(t / x)))) + Float64(2.0 * Float64(l * Float64(l / x))))))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -7e+109) tmp = Float64(-t_2); elseif (t <= -1.7e-172) tmp = t_1; elseif (t <= 3.2e-179) tmp = Float64(Float64(t * sqrt(x)) / l); elseif (t <= 1.1e+88) tmp = t_1; else tmp = t_2; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * t + N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7e+109], (-t$95$2), If[LessEqual[t, -1.7e-172], t$95$1, If[LessEqual[t, 3.2e-179], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.1e+88], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \mathsf{fma}\left(t, t, t \cdot \frac{t}{x}\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+109}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-179}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.99999999999999966e109Initial program 14.0%
associate-*r/13.9%
fma-neg13.9%
remove-double-neg13.9%
fma-neg13.9%
sub-neg13.9%
metadata-eval13.9%
remove-double-neg13.9%
+-commutative13.9%
fma-def13.9%
Simplified13.9%
Taylor expanded in t around inf 5.4%
associate-/l*17.0%
+-commutative17.0%
sub-neg17.0%
metadata-eval17.0%
+-commutative17.0%
unpow217.0%
Simplified17.0%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
Simplified97.8%
if -6.99999999999999966e109 < t < -1.6999999999999999e-172 or 3.2000000000000001e-179 < t < 1.10000000000000004e88Initial program 50.8%
associate-*l/50.8%
Simplified50.8%
Taylor expanded in x around inf 73.7%
associate--l+73.7%
unpow273.7%
distribute-lft-out73.7%
unpow273.7%
unpow273.7%
associate-*r/73.7%
mul-1-neg73.7%
+-commutative73.7%
unpow273.7%
unpow273.7%
fma-udef73.7%
Simplified73.7%
Taylor expanded in t around 0 73.7%
associate-*r/73.7%
mul-1-neg73.7%
unpow273.7%
distribute-rgt-neg-in73.7%
Simplified73.7%
expm1-log1p-u72.1%
expm1-udef37.4%
associate-/l*37.4%
+-commutative37.4%
fma-def37.4%
Applied egg-rr37.4%
expm1-def72.1%
expm1-log1p73.7%
+-commutative73.7%
distribute-rgt-neg-out73.7%
unpow273.7%
mul-1-neg73.7%
associate-*r/73.7%
cancel-sign-sub-inv73.7%
metadata-eval73.7%
*-lft-identity73.7%
associate-+l+73.7%
Simplified84.1%
if -1.6999999999999999e-172 < t < 3.2000000000000001e-179Initial program 4.1%
associate-*l/4.1%
Simplified4.1%
Taylor expanded in x around inf 55.3%
associate--l+55.3%
unpow255.3%
distribute-lft-out55.3%
unpow255.3%
unpow255.3%
associate-*r/55.3%
mul-1-neg55.3%
+-commutative55.3%
unpow255.3%
unpow255.3%
fma-udef55.3%
Simplified55.3%
Taylor expanded in t around 0 55.0%
cancel-sign-sub-inv55.0%
metadata-eval55.0%
distribute-rgt1-in55.0%
metadata-eval55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in l around 0 42.4%
associate-*l/47.8%
Applied egg-rr47.8%
if 1.10000000000000004e88 < t Initial program 15.6%
associate-*r/15.5%
fma-neg15.5%
remove-double-neg15.5%
fma-neg15.5%
sub-neg15.5%
metadata-eval15.5%
remove-double-neg15.5%
+-commutative15.5%
fma-def15.5%
Simplified15.5%
Taylor expanded in t around inf 5.1%
associate-/l*20.2%
+-commutative20.2%
sub-neg20.2%
metadata-eval20.2%
+-commutative20.2%
unpow220.2%
Simplified20.2%
Taylor expanded in t around 0 98.2%
Final simplification82.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))))
(t_2 (/ (* l l) x))
(t_3
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (+ t_2 (* 2.0 (+ (* t t) (/ (* t t) x))))))))))
(if (<= t -1.75e-20)
(- t_1)
(if (<= t -1.58e-139)
t_3
(if (<= t -8.2e-184)
-1.0
(if (<= t 1.5e-155)
(/ (* t (sqrt x)) l)
(if (<= t 80000000000.0) t_3 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 = (l * l) / x;
double t_3 = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -1.75e-20) {
tmp = -t_1;
} else if (t <= -1.58e-139) {
tmp = t_3;
} else if (t <= -8.2e-184) {
tmp = -1.0;
} else if (t <= 1.5e-155) {
tmp = (t * sqrt(x)) / l;
} else if (t <= 80000000000.0) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = (l * l) / x
t_3 = t * (sqrt(2.0d0) / sqrt((t_2 + (t_2 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
if (t <= (-1.75d-20)) then
tmp = -t_1
else if (t <= (-1.58d-139)) then
tmp = t_3
else if (t <= (-8.2d-184)) then
tmp = -1.0d0
else if (t <= 1.5d-155) then
tmp = (t * sqrt(x)) / l
else if (t <= 80000000000.0d0) then
tmp = t_3
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 = (l * l) / x;
double t_3 = t * (Math.sqrt(2.0) / Math.sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -1.75e-20) {
tmp = -t_1;
} else if (t <= -1.58e-139) {
tmp = t_3;
} else if (t <= -8.2e-184) {
tmp = -1.0;
} else if (t <= 1.5e-155) {
tmp = (t * Math.sqrt(x)) / l;
} else if (t <= 80000000000.0) {
tmp = t_3;
} 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 = (l * l) / x t_3 = t * (math.sqrt(2.0) / math.sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x))))))) tmp = 0 if t <= -1.75e-20: tmp = -t_1 elif t <= -1.58e-139: tmp = t_3 elif t <= -8.2e-184: tmp = -1.0 elif t <= 1.5e-155: tmp = (t * math.sqrt(x)) / l elif t <= 80000000000.0: tmp = t_3 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(Float64(l * l) / x) t_3 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_2 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))) tmp = 0.0 if (t <= -1.75e-20) tmp = Float64(-t_1); elseif (t <= -1.58e-139) tmp = t_3; elseif (t <= -8.2e-184) tmp = -1.0; elseif (t <= 1.5e-155) tmp = Float64(Float64(t * sqrt(x)) / l); elseif (t <= 80000000000.0) tmp = t_3; 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 = (l * l) / x; t_3 = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x))))))); tmp = 0.0; if (t <= -1.75e-20) tmp = -t_1; elseif (t <= -1.58e-139) tmp = t_3; elseif (t <= -8.2e-184) tmp = -1.0; elseif (t <= 1.5e-155) tmp = (t * sqrt(x)) / l; elseif (t <= 80000000000.0) tmp = t_3; 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[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$2 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.75e-20], (-t$95$1), If[LessEqual[t, -1.58e-139], t$95$3, If[LessEqual[t, -8.2e-184], -1.0, If[LessEqual[t, 1.5e-155], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 80000000000.0], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \frac{\ell \cdot \ell}{x}\\
t_3 := t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -1.75 \cdot 10^{-20}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -1.58 \cdot 10^{-139}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-184}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-155}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 80000000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.75000000000000002e-20Initial program 37.8%
associate-*r/37.7%
fma-neg37.7%
remove-double-neg37.7%
fma-neg37.7%
sub-neg37.7%
metadata-eval37.7%
remove-double-neg37.7%
+-commutative37.7%
fma-def37.7%
Simplified37.7%
Taylor expanded in t around inf 28.6%
associate-/l*40.2%
+-commutative40.2%
sub-neg40.2%
metadata-eval40.2%
+-commutative40.2%
unpow240.2%
Simplified40.2%
Taylor expanded in t around -inf 87.6%
mul-1-neg87.6%
+-commutative87.6%
sub-neg87.6%
metadata-eval87.6%
Simplified87.6%
if -1.75000000000000002e-20 < t < -1.57999999999999993e-139 or 1.49999999999999992e-155 < t < 8e10Initial program 42.8%
associate-*l/42.7%
Simplified42.7%
Taylor expanded in x around inf 81.4%
associate--l+81.4%
unpow281.4%
distribute-lft-out81.4%
unpow281.4%
unpow281.4%
associate-*r/81.4%
mul-1-neg81.4%
+-commutative81.4%
unpow281.4%
unpow281.4%
fma-udef81.4%
Simplified81.4%
Taylor expanded in t around 0 81.4%
associate-*r/81.4%
mul-1-neg81.4%
unpow281.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if -1.57999999999999993e-139 < t < -8.2e-184Initial program 28.2%
associate-*l/28.0%
Simplified28.0%
Taylor expanded in t around -inf 87.1%
mul-1-neg87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
Simplified87.1%
Taylor expanded in x around inf 88.0%
if -8.2e-184 < t < 1.49999999999999992e-155Initial program 3.8%
associate-*l/3.9%
Simplified3.9%
Taylor expanded in x around inf 53.0%
associate--l+53.0%
unpow253.0%
distribute-lft-out53.0%
unpow253.0%
unpow253.0%
associate-*r/53.0%
mul-1-neg53.0%
+-commutative53.0%
unpow253.0%
unpow253.0%
fma-udef53.0%
Simplified53.0%
Taylor expanded in t around 0 52.6%
cancel-sign-sub-inv52.6%
metadata-eval52.6%
distribute-rgt1-in52.6%
metadata-eval52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in l around 0 39.6%
associate-*l/46.2%
Applied egg-rr46.2%
if 8e10 < t Initial program 29.0%
associate-*r/29.0%
fma-neg29.0%
remove-double-neg29.0%
fma-neg29.0%
sub-neg29.0%
metadata-eval29.0%
remove-double-neg29.0%
+-commutative29.0%
fma-def29.0%
Simplified29.0%
Taylor expanded in t around inf 17.8%
associate-/l*33.9%
+-commutative33.9%
sub-neg33.9%
metadata-eval33.9%
+-commutative33.9%
unpow233.9%
Simplified33.9%
Taylor expanded in t around 0 94.3%
Final simplification79.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1.75e-184) (+ (/ 1.0 x) (- -1.0 (/ 0.5 (* x x)))) (if (<= t 2.5e-173) (/ (* t (sqrt x)) l) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.75e-184) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 2.5e-173) {
tmp = (t * sqrt(x)) / l;
} 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.75d-184)) then
tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x * x)))
else if (t <= 2.5d-173) then
tmp = (t * sqrt(x)) / l
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.75e-184) {
tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x)));
} else if (t <= 2.5e-173) {
tmp = (t * Math.sqrt(x)) / l;
} 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.75e-184: tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))) elif t <= 2.5e-173: tmp = (t * math.sqrt(x)) / l 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.75e-184) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / Float64(x * x)))); elseif (t <= 2.5e-173) tmp = Float64(Float64(t * sqrt(x)) / l); 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.75e-184) tmp = (1.0 / x) + (-1.0 - (0.5 / (x * x))); elseif (t <= 2.5e-173) tmp = (t * sqrt(x)) / l; 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.75e-184], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-173], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $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.75 \cdot 10^{-184}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-173}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -1.74999999999999991e-184Initial program 37.2%
associate-*l/37.2%
Simplified37.2%
Taylor expanded in t around -inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
+-commutative80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in x around inf 80.5%
associate-*r/80.5%
metadata-eval80.5%
unpow280.5%
Simplified80.5%
if -1.74999999999999991e-184 < t < 2.5000000000000001e-173Initial program 4.0%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in x around inf 57.4%
associate--l+57.4%
unpow257.4%
distribute-lft-out57.4%
unpow257.4%
unpow257.4%
associate-*r/57.4%
mul-1-neg57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
fma-udef57.4%
Simplified57.4%
Taylor expanded in t around 0 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
distribute-rgt1-in57.2%
metadata-eval57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in l around 0 44.6%
associate-*l/50.0%
Applied egg-rr50.0%
if 2.5000000000000001e-173 < t Initial program 32.8%
associate-*r/32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
+-commutative32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around inf 31.3%
associate-/l*31.1%
+-commutative31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
unpow231.1%
Simplified31.1%
Taylor expanded in t around 0 82.3%
Final simplification75.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 -7e-176) (- t_1) (if (<= t 1.92e-178) (/ (* t (sqrt x)) l) 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 <= -7e-176) {
tmp = -t_1;
} else if (t <= 1.92e-178) {
tmp = (t * sqrt(x)) / l;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-7d-176)) then
tmp = -t_1
else if (t <= 1.92d-178) then
tmp = (t * sqrt(x)) / l
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7e-176) {
tmp = -t_1;
} else if (t <= 1.92e-178) {
tmp = (t * Math.sqrt(x)) / l;
} 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 <= -7e-176: tmp = -t_1 elif t <= 1.92e-178: tmp = (t * math.sqrt(x)) / l 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 <= -7e-176) tmp = Float64(-t_1); elseif (t <= 1.92e-178) tmp = Float64(Float64(t * sqrt(x)) / l); 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 <= -7e-176) tmp = -t_1; elseif (t <= 1.92e-178) tmp = (t * sqrt(x)) / l; else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7e-176], (-t$95$1), If[LessEqual[t, 1.92e-178], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{-176}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.92 \cdot 10^{-178}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7e-176Initial program 37.2%
associate-*r/37.1%
fma-neg37.1%
remove-double-neg37.1%
fma-neg37.1%
sub-neg37.1%
metadata-eval37.1%
remove-double-neg37.1%
+-commutative37.1%
fma-def37.1%
Simplified37.1%
Taylor expanded in t around inf 34.5%
associate-/l*35.9%
+-commutative35.9%
sub-neg35.9%
metadata-eval35.9%
+-commutative35.9%
unpow235.9%
Simplified35.9%
Taylor expanded in t around -inf 81.1%
mul-1-neg81.1%
+-commutative81.1%
sub-neg81.1%
metadata-eval81.1%
Simplified81.1%
if -7e-176 < t < 1.92e-178Initial program 4.0%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in x around inf 57.4%
associate--l+57.4%
unpow257.4%
distribute-lft-out57.4%
unpow257.4%
unpow257.4%
associate-*r/57.4%
mul-1-neg57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
fma-udef57.4%
Simplified57.4%
Taylor expanded in t around 0 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
distribute-rgt1-in57.2%
metadata-eval57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in l around 0 44.6%
associate-*l/50.0%
Applied egg-rr50.0%
if 1.92e-178 < t Initial program 32.8%
associate-*r/32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
+-commutative32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around inf 31.3%
associate-/l*31.1%
+-commutative31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
unpow231.1%
Simplified31.1%
Taylor expanded in t around 0 82.3%
Final simplification76.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -6.6e-182)
(+ (/ 1.0 x) (- -1.0 t_1))
(if (<= t 2.95e-176) (* (sqrt x) (/ t l)) (+ (+ 1.0 t_1) (/ -1.0 x))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -6.6e-182) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.95e-176) {
tmp = sqrt(x) * (t / l);
} else {
tmp = (1.0 + t_1) + (-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 = 0.5d0 / (x * x)
if (t <= (-6.6d-182)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else if (t <= 2.95d-176) then
tmp = sqrt(x) * (t / l)
else
tmp = (1.0d0 + t_1) + ((-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 = 0.5 / (x * x);
double tmp;
if (t <= -6.6e-182) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.95e-176) {
tmp = Math.sqrt(x) * (t / l);
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -6.6e-182: tmp = (1.0 / x) + (-1.0 - t_1) elif t <= 2.95e-176: tmp = math.sqrt(x) * (t / l) else: tmp = (1.0 + t_1) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -6.6e-182) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); elseif (t <= 2.95e-176) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = Float64(Float64(1.0 + t_1) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -6.6e-182) tmp = (1.0 / x) + (-1.0 - t_1); elseif (t <= 2.95e-176) tmp = sqrt(x) * (t / l); else tmp = (1.0 + t_1) + (-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[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.6e-182], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.95e-176], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{-182}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{-176}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_1\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -6.59999999999999991e-182Initial program 37.2%
associate-*l/37.2%
Simplified37.2%
Taylor expanded in t around -inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
+-commutative80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in x around inf 80.5%
associate-*r/80.5%
metadata-eval80.5%
unpow280.5%
Simplified80.5%
if -6.59999999999999991e-182 < t < 2.9499999999999998e-176Initial program 4.0%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in x around inf 57.4%
associate--l+57.4%
unpow257.4%
distribute-lft-out57.4%
unpow257.4%
unpow257.4%
associate-*r/57.4%
mul-1-neg57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
fma-udef57.4%
Simplified57.4%
Taylor expanded in t around 0 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
distribute-rgt1-in57.2%
metadata-eval57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in l around 0 44.6%
if 2.9499999999999998e-176 < t Initial program 32.8%
associate-*r/32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
+-commutative32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around inf 31.3%
associate-/l*31.1%
+-commutative31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
unpow231.1%
Simplified31.1%
Taylor expanded in x around inf 81.5%
associate-*r/81.5%
metadata-eval81.5%
unpow281.5%
Simplified81.5%
Final simplification74.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -1.15e-176)
(+ (/ 1.0 x) (- -1.0 t_1))
(if (<= t 2.05e-174) (* t (/ (sqrt x) l)) (+ (+ 1.0 t_1) (/ -1.0 x))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1.15e-176) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.05e-174) {
tmp = t * (sqrt(x) / l);
} else {
tmp = (1.0 + t_1) + (-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 = 0.5d0 / (x * x)
if (t <= (-1.15d-176)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else if (t <= 2.05d-174) then
tmp = t * (sqrt(x) / l)
else
tmp = (1.0d0 + t_1) + ((-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 = 0.5 / (x * x);
double tmp;
if (t <= -1.15e-176) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.05e-174) {
tmp = t * (Math.sqrt(x) / l);
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -1.15e-176: tmp = (1.0 / x) + (-1.0 - t_1) elif t <= 2.05e-174: tmp = t * (math.sqrt(x) / l) else: tmp = (1.0 + t_1) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -1.15e-176) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); elseif (t <= 2.05e-174) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = Float64(Float64(1.0 + t_1) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -1.15e-176) tmp = (1.0 / x) + (-1.0 - t_1); elseif (t <= 2.05e-174) tmp = t * (sqrt(x) / l); else tmp = (1.0 + t_1) + (-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[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e-176], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e-174], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-176}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-174}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_1\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.1500000000000001e-176Initial program 37.2%
associate-*l/37.2%
Simplified37.2%
Taylor expanded in t around -inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
+-commutative80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in x around inf 80.5%
associate-*r/80.5%
metadata-eval80.5%
unpow280.5%
Simplified80.5%
if -1.1500000000000001e-176 < t < 2.05e-174Initial program 4.0%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in x around inf 57.4%
associate--l+57.4%
unpow257.4%
distribute-lft-out57.4%
unpow257.4%
unpow257.4%
associate-*r/57.4%
mul-1-neg57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
fma-udef57.4%
Simplified57.4%
Taylor expanded in t around 0 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
distribute-rgt1-in57.2%
metadata-eval57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in l around 0 49.8%
associate-*l/49.9%
*-lft-identity49.9%
Simplified49.9%
if 2.05e-174 < t Initial program 32.8%
associate-*r/32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
+-commutative32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around inf 31.3%
associate-/l*31.1%
+-commutative31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
unpow231.1%
Simplified31.1%
Taylor expanded in x around inf 81.5%
associate-*r/81.5%
metadata-eval81.5%
unpow281.5%
Simplified81.5%
Final simplification75.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -7.2e-176)
(+ (/ 1.0 x) (- -1.0 t_1))
(if (<= t 2.75e-176) (/ (* t (sqrt x)) l) (+ (+ 1.0 t_1) (/ -1.0 x))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -7.2e-176) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.75e-176) {
tmp = (t * sqrt(x)) / l;
} else {
tmp = (1.0 + t_1) + (-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 = 0.5d0 / (x * x)
if (t <= (-7.2d-176)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else if (t <= 2.75d-176) then
tmp = (t * sqrt(x)) / l
else
tmp = (1.0d0 + t_1) + ((-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 = 0.5 / (x * x);
double tmp;
if (t <= -7.2e-176) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else if (t <= 2.75e-176) {
tmp = (t * Math.sqrt(x)) / l;
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -7.2e-176: tmp = (1.0 / x) + (-1.0 - t_1) elif t <= 2.75e-176: tmp = (t * math.sqrt(x)) / l else: tmp = (1.0 + t_1) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -7.2e-176) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); elseif (t <= 2.75e-176) tmp = Float64(Float64(t * sqrt(x)) / l); else tmp = Float64(Float64(1.0 + t_1) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -7.2e-176) tmp = (1.0 / x) + (-1.0 - t_1); elseif (t <= 2.75e-176) tmp = (t * sqrt(x)) / l; else tmp = (1.0 + t_1) + (-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[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.2e-176], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.75e-176], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{-176}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_1\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -7.2000000000000005e-176Initial program 37.2%
associate-*l/37.2%
Simplified37.2%
Taylor expanded in t around -inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
+-commutative80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in x around inf 80.5%
associate-*r/80.5%
metadata-eval80.5%
unpow280.5%
Simplified80.5%
if -7.2000000000000005e-176 < t < 2.75e-176Initial program 4.0%
associate-*l/4.0%
Simplified4.0%
Taylor expanded in x around inf 57.4%
associate--l+57.4%
unpow257.4%
distribute-lft-out57.4%
unpow257.4%
unpow257.4%
associate-*r/57.4%
mul-1-neg57.4%
+-commutative57.4%
unpow257.4%
unpow257.4%
fma-udef57.4%
Simplified57.4%
Taylor expanded in t around 0 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
distribute-rgt1-in57.2%
metadata-eval57.2%
unpow257.2%
Simplified57.2%
Taylor expanded in l around 0 44.6%
associate-*l/50.0%
Applied egg-rr50.0%
if 2.75e-176 < t Initial program 32.8%
associate-*r/32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
+-commutative32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around inf 31.3%
associate-/l*31.1%
+-commutative31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
unpow231.1%
Simplified31.1%
Taylor expanded in x around inf 81.5%
associate-*r/81.5%
metadata-eval81.5%
unpow281.5%
Simplified81.5%
Final simplification75.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-309) (+ -1.0 (/ 1.0 x)) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-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 <= (-1d-309)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-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 <= -1e-309) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 + (1.0 / x) else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-309) tmp = -1.0 + (1.0 / x); else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-309], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 31.0%
associate-*l/31.0%
Simplified31.0%
Taylor expanded in t around -inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
+-commutative72.0%
sub-neg72.0%
metadata-eval72.0%
+-commutative72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
Taylor expanded in x around inf 71.8%
if -1.000000000000002e-309 < t Initial program 28.1%
associate-*r/28.0%
fma-neg28.0%
remove-double-neg28.0%
fma-neg28.0%
sub-neg28.0%
metadata-eval28.0%
remove-double-neg28.0%
+-commutative28.0%
fma-def28.0%
Simplified28.0%
Taylor expanded in t around inf 26.2%
associate-/l*26.0%
+-commutative26.0%
sub-neg26.0%
metadata-eval26.0%
+-commutative26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in x around inf 72.2%
associate-*r/72.2%
metadata-eval72.2%
unpow272.2%
Simplified72.2%
Final simplification72.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (/ 0.5 (* x x)))) (if (<= t -1e-309) (+ (/ 1.0 x) (- -1.0 t_1)) (+ (+ 1.0 t_1) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1e-309) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else {
tmp = (1.0 + t_1) + (-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 = 0.5d0 / (x * x)
if (t <= (-1d-309)) then
tmp = (1.0d0 / x) + ((-1.0d0) - t_1)
else
tmp = (1.0d0 + t_1) + ((-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 = 0.5 / (x * x);
double tmp;
if (t <= -1e-309) {
tmp = (1.0 / x) + (-1.0 - t_1);
} else {
tmp = (1.0 + t_1) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -1e-309: tmp = (1.0 / x) + (-1.0 - t_1) else: tmp = (1.0 + t_1) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -1e-309) tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - t_1)); else tmp = Float64(Float64(1.0 + t_1) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -1e-309) tmp = (1.0 / x) + (-1.0 - t_1); else tmp = (1.0 + t_1) + (-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[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-309], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_1\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 31.0%
associate-*l/31.0%
Simplified31.0%
Taylor expanded in t around -inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
+-commutative72.0%
sub-neg72.0%
metadata-eval72.0%
+-commutative72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
Taylor expanded in x around inf 71.9%
associate-*r/71.9%
metadata-eval71.9%
unpow271.9%
Simplified71.9%
if -1.000000000000002e-309 < t Initial program 28.1%
associate-*r/28.0%
fma-neg28.0%
remove-double-neg28.0%
fma-neg28.0%
sub-neg28.0%
metadata-eval28.0%
remove-double-neg28.0%
+-commutative28.0%
fma-def28.0%
Simplified28.0%
Taylor expanded in t around inf 26.2%
associate-/l*26.0%
+-commutative26.0%
sub-neg26.0%
metadata-eval26.0%
+-commutative26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in x around inf 72.2%
associate-*r/72.2%
metadata-eval72.2%
unpow272.2%
Simplified72.2%
Final simplification72.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-309) -1.0 (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
tmp = -1.0;
} 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 <= (-1d-309)) then
tmp = -1.0d0
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 <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-309) tmp = -1.0; 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 <= -1e-309) tmp = -1.0; 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, -1e-309], -1.0, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 31.0%
associate-*l/31.0%
Simplified31.0%
Taylor expanded in t around -inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
+-commutative72.0%
sub-neg72.0%
metadata-eval72.0%
+-commutative72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
Taylor expanded in x around inf 71.5%
if -1.000000000000002e-309 < t Initial program 28.1%
associate-*r/28.0%
fma-neg28.0%
remove-double-neg28.0%
fma-neg28.0%
sub-neg28.0%
metadata-eval28.0%
remove-double-neg28.0%
+-commutative28.0%
fma-def28.0%
Simplified28.0%
Taylor expanded in t around inf 26.2%
associate-/l*26.0%
+-commutative26.0%
sub-neg26.0%
metadata-eval26.0%
+-commutative26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in x around inf 71.7%
Final simplification71.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-309) (+ -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 <= -1e-309) {
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 <= (-1d-309)) 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 <= -1e-309) {
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 <= -1e-309: 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 <= -1e-309) 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 <= -1e-309) 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, -1e-309], 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 -1 \cdot 10^{-309}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 31.0%
associate-*l/31.0%
Simplified31.0%
Taylor expanded in t around -inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
+-commutative72.0%
sub-neg72.0%
metadata-eval72.0%
+-commutative72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
Taylor expanded in x around inf 71.8%
if -1.000000000000002e-309 < t Initial program 28.1%
associate-*r/28.0%
fma-neg28.0%
remove-double-neg28.0%
fma-neg28.0%
sub-neg28.0%
metadata-eval28.0%
remove-double-neg28.0%
+-commutative28.0%
fma-def28.0%
Simplified28.0%
Taylor expanded in t around inf 26.2%
associate-/l*26.0%
+-commutative26.0%
sub-neg26.0%
metadata-eval26.0%
+-commutative26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in x around inf 71.7%
Final simplification71.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-309) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-309) {
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 <= (-1d-309)) 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 <= -1e-309) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-309: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-309) 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 <= -1e-309) 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, -1e-309], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.000000000000002e-309Initial program 31.0%
associate-*l/31.0%
Simplified31.0%
Taylor expanded in t around -inf 72.0%
mul-1-neg72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
+-commutative72.0%
sub-neg72.0%
metadata-eval72.0%
+-commutative72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
Taylor expanded in x around inf 71.5%
if -1.000000000000002e-309 < t Initial program 28.1%
associate-*r/28.0%
fma-neg28.0%
remove-double-neg28.0%
fma-neg28.0%
sub-neg28.0%
metadata-eval28.0%
remove-double-neg28.0%
+-commutative28.0%
fma-def28.0%
Simplified28.0%
Taylor expanded in t around inf 26.2%
associate-/l*26.0%
+-commutative26.0%
sub-neg26.0%
metadata-eval26.0%
+-commutative26.0%
unpow226.0%
Simplified26.0%
Taylor expanded in x around inf 70.7%
Final simplification71.1%
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.5%
associate-*l/29.5%
Simplified29.5%
Taylor expanded in t around -inf 36.3%
mul-1-neg36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
+-commutative36.3%
sub-neg36.3%
metadata-eval36.3%
+-commutative36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
Simplified36.3%
Taylor expanded in x around inf 36.1%
Final simplification36.1%
herbie shell --seed 2023230
(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)))))