
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 2.0 (/ 4.0 x)))
(t_2 (sqrt (/ (+ x 1.0) (+ x -1.0))))
(t_3 (* 2.0 (pow t 2.0)))
(t_4 (+ (pow l 2.0) t_3))
(t_5 (/ (pow l 2.0) x)))
(if (<= t -1.62e+44)
(/ t (* (- t) t_2))
(if (<= t -1.4e-157)
(/
t
(/
(sqrt
(+
(+ (* 2.0 (* t (+ t (/ t x)))) t_5)
(/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
(sqrt 2.0)))
(if (<= t -3.5e-258)
(/
t
(/
(-
(* (/ (* -0.5 (* 2.0 t_5)) t) (sqrt (/ 1.0 t_1)))
(* t (sqrt t_1)))
(sqrt 2.0)))
(if (<= t 2.1e-227)
(/ (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) (/ 1.0 t)) l)
(if (<= t 1.4e+38)
(/
t
(/
(sqrt
(+
(+
(/ (+ t_4 t_4) (pow x 2.0))
(+ (* 2.0 (/ (pow t 2.0) x)) (+ t_5 t_3)))
(/ t_4 x)))
(sqrt 2.0)))
(/ t (* t t_2)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 + (4.0 / x);
double t_2 = sqrt(((x + 1.0) / (x + -1.0)));
double t_3 = 2.0 * pow(t, 2.0);
double t_4 = pow(l, 2.0) + t_3;
double t_5 = pow(l, 2.0) / x;
double tmp;
if (t <= -1.62e+44) {
tmp = t / (-t * t_2);
} else if (t <= -1.4e-157) {
tmp = t / (sqrt((((2.0 * (t * (t + (t / x)))) + t_5) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
} else if (t <= -3.5e-258) {
tmp = t / (((((-0.5 * (2.0 * t_5)) / t) * sqrt((1.0 / t_1))) - (t * sqrt(t_1))) / sqrt(2.0));
} else if (t <= 2.1e-227) {
tmp = (sqrt((2.0 * fma(0.5, x, -0.5))) / (1.0 / t)) / l;
} else if (t <= 1.4e+38) {
tmp = t / (sqrt(((((t_4 + t_4) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_5 + t_3))) + (t_4 / x))) / sqrt(2.0));
} else {
tmp = t / (t * t_2);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 + Float64(4.0 / x)) t_2 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) t_3 = Float64(2.0 * (t ^ 2.0)) t_4 = Float64((l ^ 2.0) + t_3) t_5 = Float64((l ^ 2.0) / x) tmp = 0.0 if (t <= -1.62e+44) tmp = Float64(t / Float64(Float64(-t) * t_2)); elseif (t <= -1.4e-157) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + t_5) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0))); elseif (t <= -3.5e-258) tmp = Float64(t / Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(2.0 * t_5)) / t) * sqrt(Float64(1.0 / t_1))) - Float64(t * sqrt(t_1))) / sqrt(2.0))); elseif (t <= 2.1e-227) tmp = Float64(Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / Float64(1.0 / t)) / l); elseif (t <= 1.4e+38) tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_4 + t_4) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_5 + t_3))) + Float64(t_4 / x))) / sqrt(2.0))); else tmp = Float64(t / Float64(t * t_2)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[l, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.62e+44], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.4e-157], N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.5e-258], N[(t / N[(N[(N[(N[(N[(-0.5 * N[(2.0 * t$95$5), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-227], N[(N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.4e+38], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$4 + t$95$4), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \frac{4}{x}\\
t_2 := \sqrt{\frac{x + 1}{x + -1}}\\
t_3 := 2 \cdot {t}^{2}\\
t_4 := {\ell}^{2} + t_3\\
t_5 := \frac{{\ell}^{2}}{x}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-157}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_5\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-258}:\\
\;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_5\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\
\;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_5 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_2}\\
\end{array}
\end{array}
if t < -1.6199999999999999e44Initial program 36.1%
Simplified36.0%
Taylor expanded in t around -inf 96.4%
associate-*r*96.4%
neg-mul-196.4%
+-commutative96.4%
sub-neg96.4%
metadata-eval96.4%
+-commutative96.4%
Simplified96.4%
if -1.6199999999999999e44 < t < -1.40000000000000005e-157Initial program 51.9%
Simplified51.9%
Taylor expanded in x around inf 84.8%
expm1-log1p-u83.2%
expm1-udef36.3%
Applied egg-rr36.3%
expm1-def83.2%
expm1-log1p84.8%
fma-udef84.8%
fma-udef84.8%
associate-+r+84.8%
distribute-lft-out84.8%
unpow284.8%
associate-*r/84.8%
unpow284.8%
distribute-lft-out84.8%
Simplified84.8%
if -1.40000000000000005e-157 < t < -3.50000000000000001e-258Initial program 2.4%
Simplified2.4%
Taylor expanded in x around inf 19.3%
Taylor expanded in t around -inf 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
Simplified65.2%
if -3.50000000000000001e-258 < t < 2.1e-227Initial program 1.7%
Simplified1.7%
Taylor expanded in l around inf 0.8%
*-commutative0.8%
associate--l+36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in x around 0 47.3%
associate-*r*47.3%
/-rgt-identity47.3%
associate-*r/53.5%
sqrt-unprod53.5%
fma-neg53.5%
metadata-eval53.5%
/-rgt-identity53.5%
Applied egg-rr53.5%
remove-double-div53.5%
un-div-inv53.5%
Applied egg-rr53.5%
if 2.1e-227 < t < 1.4e38Initial program 36.0%
Simplified36.0%
Taylor expanded in x around -inf 75.7%
if 1.4e38 < t Initial program 40.3%
Simplified40.3%
Taylor expanded in t around inf 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Final simplification84.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 2.0 (/ 4.0 x)))
(t_2 (sqrt (/ (+ x 1.0) (+ x -1.0))))
(t_3 (/ (pow l 2.0) x))
(t_4
(/
t
(/
(sqrt
(+
(+ (* 2.0 (* t (+ t (/ t x)))) t_3)
(/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
(sqrt 2.0)))))
(if (<= t -7e+44)
(/ t (* (- t) t_2))
(if (<= t -3.4e-158)
t_4
(if (<= t -1.05e-254)
(/
t
(/
(-
(* (/ (* -0.5 (* 2.0 t_3)) t) (sqrt (/ 1.0 t_1)))
(* t (sqrt t_1)))
(sqrt 2.0)))
(if (<= t 2.1e-227)
(/ (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) (/ 1.0 t)) l)
(if (<= t 1.1e+39) t_4 (/ t (* t t_2)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 + (4.0 / x);
double t_2 = sqrt(((x + 1.0) / (x + -1.0)));
double t_3 = pow(l, 2.0) / x;
double t_4 = t / (sqrt((((2.0 * (t * (t + (t / x)))) + t_3) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
double tmp;
if (t <= -7e+44) {
tmp = t / (-t * t_2);
} else if (t <= -3.4e-158) {
tmp = t_4;
} else if (t <= -1.05e-254) {
tmp = t / (((((-0.5 * (2.0 * t_3)) / t) * sqrt((1.0 / t_1))) - (t * sqrt(t_1))) / sqrt(2.0));
} else if (t <= 2.1e-227) {
tmp = (sqrt((2.0 * fma(0.5, x, -0.5))) / (1.0 / t)) / l;
} else if (t <= 1.1e+39) {
tmp = t_4;
} else {
tmp = t / (t * t_2);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 + Float64(4.0 / x)) t_2 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) t_3 = Float64((l ^ 2.0) / x) t_4 = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + t_3) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0))) tmp = 0.0 if (t <= -7e+44) tmp = Float64(t / Float64(Float64(-t) * t_2)); elseif (t <= -3.4e-158) tmp = t_4; elseif (t <= -1.05e-254) tmp = Float64(t / Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(2.0 * t_3)) / t) * sqrt(Float64(1.0 / t_1))) - Float64(t * sqrt(t_1))) / sqrt(2.0))); elseif (t <= 2.1e-227) tmp = Float64(Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / Float64(1.0 / t)) / l); elseif (t <= 1.1e+39) tmp = t_4; else tmp = Float64(t / Float64(t * t_2)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+44], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.4e-158], t$95$4, If[LessEqual[t, -1.05e-254], N[(t / N[(N[(N[(N[(N[(-0.5 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-227], N[(N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.1e+39], t$95$4, N[(t / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \frac{4}{x}\\
t_2 := \sqrt{\frac{x + 1}{x + -1}}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_3\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-158}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_3\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\
\;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+39}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_2}\\
\end{array}
\end{array}
if t < -6.9999999999999998e44Initial program 36.1%
Simplified36.0%
Taylor expanded in t around -inf 96.4%
associate-*r*96.4%
neg-mul-196.4%
+-commutative96.4%
sub-neg96.4%
metadata-eval96.4%
+-commutative96.4%
Simplified96.4%
if -6.9999999999999998e44 < t < -3.3999999999999999e-158 or 2.1e-227 < t < 1.1000000000000001e39Initial program 43.7%
Simplified43.7%
Taylor expanded in x around inf 80.0%
expm1-log1p-u78.9%
expm1-udef30.7%
Applied egg-rr30.7%
expm1-def78.9%
expm1-log1p80.0%
fma-udef80.0%
fma-udef80.0%
associate-+r+80.0%
distribute-lft-out80.0%
unpow280.0%
associate-*r/80.0%
unpow280.0%
distribute-lft-out80.0%
Simplified80.0%
if -3.3999999999999999e-158 < t < -1.04999999999999998e-254Initial program 2.4%
Simplified2.4%
Taylor expanded in x around inf 19.3%
Taylor expanded in t around -inf 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
Simplified65.2%
if -1.04999999999999998e-254 < t < 2.1e-227Initial program 1.7%
Simplified1.7%
Taylor expanded in l around inf 0.8%
*-commutative0.8%
associate--l+36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
sub-neg36.5%
metadata-eval36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in x around 0 47.3%
associate-*r*47.3%
/-rgt-identity47.3%
associate-*r/53.5%
sqrt-unprod53.5%
fma-neg53.5%
metadata-eval53.5%
/-rgt-identity53.5%
Applied egg-rr53.5%
remove-double-div53.5%
un-div-inv53.5%
Applied egg-rr53.5%
if 1.1000000000000001e39 < t Initial program 40.3%
Simplified40.3%
Taylor expanded in t around inf 98.6%
+-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Final simplification84.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -4.3e-254)
(/ t (* (- t) t_1))
(if (<= t 6.8e-147)
(* t (/ (sqrt (* 2.0 (fma x 0.5 -0.5))) l))
(/ t (* t 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 <= -4.3e-254) {
tmp = t / (-t * t_1);
} else if (t <= 6.8e-147) {
tmp = t * (sqrt((2.0 * fma(x, 0.5, -0.5))) / l);
} else {
tmp = t / (t * 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 <= -4.3e-254) tmp = Float64(t / Float64(Float64(-t) * t_1)); elseif (t <= 6.8e-147) tmp = Float64(t * Float64(sqrt(Float64(2.0 * fma(x, 0.5, -0.5))) / l)); else tmp = Float64(t / Float64(t * 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]}, If[LessEqual[t, -4.3e-254], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-147], N[(t * N[(N[Sqrt[N[(2.0 * N[(x * 0.5 + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-147}:\\
\;\;\;\;t \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\
\end{array}
\end{array}
if t < -4.2999999999999997e-254Initial program 35.1%
Simplified35.1%
Taylor expanded in t around -inf 81.1%
associate-*r*81.1%
neg-mul-181.1%
+-commutative81.1%
sub-neg81.1%
metadata-eval81.1%
+-commutative81.1%
Simplified81.1%
if -4.2999999999999997e-254 < t < 6.79999999999999991e-147Initial program 4.2%
Simplified4.2%
Taylor expanded in l around inf 0.9%
*-commutative0.9%
associate--l+35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
Simplified35.1%
Taylor expanded in x around 0 46.9%
expm1-log1p-u46.7%
expm1-udef32.8%
associate-*r*32.8%
*-commutative32.8%
sqrt-unprod32.8%
fma-neg32.8%
metadata-eval32.8%
Applied egg-rr32.8%
expm1-def46.8%
expm1-log1p47.0%
associate-*l/51.4%
*-commutative51.4%
associate-*l/51.4%
*-commutative51.4%
fma-udef51.4%
*-commutative51.4%
fma-def51.4%
Simplified51.4%
if 6.79999999999999991e-147 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
Final simplification78.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x 1.0) (+ x -1.0)))))
(if (<= t -4.3e-254)
(/ t (* (- t) t_1))
(if (<= t 1.4e-145)
(/ (* t (sqrt (* 2.0 (fma 0.5 x -0.5)))) l)
(/ t (* t 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 <= -4.3e-254) {
tmp = t / (-t * t_1);
} else if (t <= 1.4e-145) {
tmp = (t * sqrt((2.0 * fma(0.5, x, -0.5)))) / l;
} else {
tmp = t / (t * 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 <= -4.3e-254) tmp = Float64(t / Float64(Float64(-t) * t_1)); elseif (t <= 1.4e-145) tmp = Float64(Float64(t * sqrt(Float64(2.0 * fma(0.5, x, -0.5)))) / l); else tmp = Float64(t / Float64(t * 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]}, If[LessEqual[t, -4.3e-254], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-145], N[(N[(t * N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-145}:\\
\;\;\;\;\frac{t \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\
\end{array}
\end{array}
if t < -4.2999999999999997e-254Initial program 35.1%
Simplified35.1%
Taylor expanded in t around -inf 81.1%
associate-*r*81.1%
neg-mul-181.1%
+-commutative81.1%
sub-neg81.1%
metadata-eval81.1%
+-commutative81.1%
Simplified81.1%
if -4.2999999999999997e-254 < t < 1.4000000000000001e-145Initial program 4.2%
Simplified4.2%
Taylor expanded in l around inf 0.9%
*-commutative0.9%
associate--l+35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
Simplified35.1%
Taylor expanded in x around 0 46.9%
associate-*r*46.9%
/-rgt-identity46.9%
associate-*r/51.4%
sqrt-unprod51.4%
fma-neg51.4%
metadata-eval51.4%
/-rgt-identity51.4%
Applied egg-rr51.4%
if 1.4000000000000001e-145 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
Final simplification78.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -4.3e-254)
(/ t (fabs t))
(if (<= t 7.2e-145)
(* (/ t l) (sqrt x))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4.3e-254) {
tmp = t / fabs(t);
} else if (t <= 7.2e-145) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t / (t * 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 <= (-4.3d-254)) then
tmp = t / abs(t)
else if (t <= 7.2d-145) then
tmp = (t / l) * sqrt(x)
else
tmp = t / (t * 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 <= -4.3e-254) {
tmp = t / Math.abs(t);
} else if (t <= 7.2e-145) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4.3e-254: tmp = t / math.fabs(t) elif t <= 7.2e-145: tmp = (t / l) * math.sqrt(x) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4.3e-254) tmp = Float64(t / abs(t)); elseif (t <= 7.2e-145) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(t / Float64(t * 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 <= -4.3e-254) tmp = t / abs(t); elseif (t <= 7.2e-145) tmp = (t / l) * sqrt(x); else tmp = t / (t * 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, -4.3e-254], N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-145], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left|t\right|}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -4.2999999999999997e-254Initial program 35.1%
Simplified35.1%
Taylor expanded in x around inf 1.7%
add-sqr-sqrt0.0%
sqrt-unprod42.1%
associate-/l*42.2%
sqrt-undiv42.2%
metadata-eval42.2%
metadata-eval42.2%
associate-/l*42.2%
sqrt-undiv42.2%
metadata-eval42.2%
metadata-eval42.2%
frac-times42.2%
pow242.2%
metadata-eval42.2%
Applied egg-rr42.2%
/-rgt-identity42.2%
unpow242.2%
rem-sqrt-square78.7%
Simplified78.7%
if -4.2999999999999997e-254 < t < 7.2000000000000001e-145Initial program 4.2%
Simplified4.2%
Taylor expanded in l around inf 1.8%
associate--l+37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in x around inf 60.9%
Taylor expanded in t around 0 47.0%
if 7.2000000000000001e-145 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
Final simplification76.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 -2.3e-257)
(/ t (* (- t) t_1))
(if (<= t 8.8e-148) (* (/ t l) (sqrt x)) (/ t (* t 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 <= -2.3e-257) {
tmp = t / (-t * t_1);
} else if (t <= 8.8e-148) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t / (t * 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 <= (-2.3d-257)) then
tmp = t / (-t * t_1)
else if (t <= 8.8d-148) then
tmp = (t / l) * sqrt(x)
else
tmp = t / (t * 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 <= -2.3e-257) {
tmp = t / (-t * t_1);
} else if (t <= 8.8e-148) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t / (t * 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 <= -2.3e-257: tmp = t / (-t * t_1) elif t <= 8.8e-148: tmp = (t / l) * math.sqrt(x) else: tmp = t / (t * 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 <= -2.3e-257) tmp = Float64(t / Float64(Float64(-t) * t_1)); elseif (t <= 8.8e-148) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(t / Float64(t * 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 <= -2.3e-257) tmp = t / (-t * t_1); elseif (t <= 8.8e-148) tmp = (t / l) * sqrt(x); else tmp = t / (t * 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, -2.3e-257], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-148], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-257}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-148}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\
\end{array}
\end{array}
if t < -2.3e-257Initial program 35.1%
Simplified35.1%
Taylor expanded in t around -inf 81.1%
associate-*r*81.1%
neg-mul-181.1%
+-commutative81.1%
sub-neg81.1%
metadata-eval81.1%
+-commutative81.1%
Simplified81.1%
if -2.3e-257 < t < 8.80000000000000068e-148Initial program 4.2%
Simplified4.2%
Taylor expanded in l around inf 1.8%
associate--l+37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in x around inf 60.9%
Taylor expanded in t around 0 47.0%
if 8.80000000000000068e-148 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
Final simplification78.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4.3e-254) (/ t (fabs t)) (if (<= t 1.55e-146) (* (/ t l) (sqrt x)) (/ t t))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4.3e-254) {
tmp = t / fabs(t);
} else if (t <= 1.55e-146) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t / t;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.3d-254)) then
tmp = t / abs(t)
else if (t <= 1.55d-146) then
tmp = (t / l) * sqrt(x)
else
tmp = t / t
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -4.3e-254) {
tmp = t / Math.abs(t);
} else if (t <= 1.55e-146) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t / t;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4.3e-254: tmp = t / math.fabs(t) elif t <= 1.55e-146: tmp = (t / l) * math.sqrt(x) else: tmp = t / t return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4.3e-254) tmp = Float64(t / abs(t)); elseif (t <= 1.55e-146) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(t / t); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4.3e-254) tmp = t / abs(t); elseif (t <= 1.55e-146) tmp = (t / l) * sqrt(x); else tmp = t / t; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -4.3e-254], N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-146], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / t), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left|t\right|}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-146}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t}\\
\end{array}
\end{array}
if t < -4.2999999999999997e-254Initial program 35.1%
Simplified35.1%
Taylor expanded in x around inf 1.7%
add-sqr-sqrt0.0%
sqrt-unprod42.1%
associate-/l*42.2%
sqrt-undiv42.2%
metadata-eval42.2%
metadata-eval42.2%
associate-/l*42.2%
sqrt-undiv42.2%
metadata-eval42.2%
metadata-eval42.2%
frac-times42.2%
pow242.2%
metadata-eval42.2%
Applied egg-rr42.2%
/-rgt-identity42.2%
unpow242.2%
rem-sqrt-square78.7%
Simplified78.7%
if -4.2999999999999997e-254 < t < 1.5499999999999999e-146Initial program 4.2%
Simplified4.2%
Taylor expanded in l around inf 1.8%
associate--l+37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
Simplified37.3%
Taylor expanded in x around inf 60.9%
Taylor expanded in t around 0 47.0%
if 1.5499999999999999e-146 < t Initial program 41.8%
Simplified41.8%
Taylor expanded in x around inf 86.2%
Final simplification76.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (/ t (fabs t)))
l = abs(l);
double code(double x, double l, double t) {
return t / fabs(t);
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = t / abs(t)
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return t / Math.abs(t);
}
l = abs(l) def code(x, l, t): return t / math.fabs(t)
l = abs(l) function code(x, l, t) return Float64(t / abs(t)) end
l = abs(l) function tmp = code(x, l, t) tmp = t / abs(t); end
NOTE: l should be positive before calling this function code[x_, l_, t_] := N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{t}{\left|t\right|}
\end{array}
Initial program 32.8%
Simplified32.7%
Taylor expanded in x around inf 36.1%
add-sqr-sqrt35.0%
sqrt-unprod40.7%
associate-/l*40.8%
sqrt-undiv40.8%
metadata-eval40.8%
metadata-eval40.8%
associate-/l*40.8%
sqrt-undiv40.8%
metadata-eval40.8%
metadata-eval40.8%
frac-times40.8%
pow240.8%
metadata-eval40.8%
Applied egg-rr40.8%
/-rgt-identity40.8%
unpow240.8%
rem-sqrt-square73.5%
Simplified73.5%
Final simplification73.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (/ t t))
l = abs(l);
double code(double x, double l, double t) {
return t / t;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = t / t
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return t / t;
}
l = abs(l) def code(x, l, t): return t / t
l = abs(l) function code(x, l, t) return Float64(t / t) end
l = abs(l) function tmp = code(x, l, t) tmp = t / t; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := N[(t / t), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{t}{t}
\end{array}
Initial program 32.8%
Simplified32.7%
Taylor expanded in x around inf 36.2%
Final simplification36.2%
herbie shell --seed 2023312
(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)))))