
(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 11 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 (/ (* l l) x))
(t_2 (/ t (- t)))
(t_3
(/
t
(sqrt (/ (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))) 2.0)))))
(if (<= t -1.26e+61)
t_2
(if (<= t -1.16e-170)
t_3
(if (<= t -1.66e-206)
t_2
(if (<= t 3.2e-217)
(* t (* (sqrt x) (/ 1.0 l)))
(if (<= t 2.55e-147)
1.0
(if (<= t 6.2e-12) t_3 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t / -t;
double t_3 = t / sqrt(((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))) / 2.0));
double tmp;
if (t <= -1.26e+61) {
tmp = t_2;
} else if (t <= -1.16e-170) {
tmp = t_3;
} else if (t <= -1.66e-206) {
tmp = t_2;
} else if (t <= 3.2e-217) {
tmp = t * (sqrt(x) * (1.0 / l));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 6.2e-12) {
tmp = t_3;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (l * l) / x
t_2 = t / -t
t_3 = t / sqrt(((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x))))) / 2.0d0))
if (t <= (-1.26d+61)) then
tmp = t_2
else if (t <= (-1.16d-170)) then
tmp = t_3
else if (t <= (-1.66d-206)) then
tmp = t_2
else if (t <= 3.2d-217) then
tmp = t * (sqrt(x) * (1.0d0 / l))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 6.2d-12) then
tmp = t_3
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 t_1 = (l * l) / x;
double t_2 = t / -t;
double t_3 = t / Math.sqrt(((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))) / 2.0));
double tmp;
if (t <= -1.26e+61) {
tmp = t_2;
} else if (t <= -1.16e-170) {
tmp = t_3;
} else if (t <= -1.66e-206) {
tmp = t_2;
} else if (t <= 3.2e-217) {
tmp = t * (Math.sqrt(x) * (1.0 / l));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 6.2e-12) {
tmp = t_3;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x t_2 = t / -t t_3 = t / math.sqrt(((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))) / 2.0)) tmp = 0 if t <= -1.26e+61: tmp = t_2 elif t <= -1.16e-170: tmp = t_3 elif t <= -1.66e-206: tmp = t_2 elif t <= 3.2e-217: tmp = t * (math.sqrt(x) * (1.0 / l)) elif t <= 2.55e-147: tmp = 1.0 elif t <= 6.2e-12: tmp = t_3 else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(t / Float64(-t)) t_3 = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))))) / 2.0))) tmp = 0.0 if (t <= -1.26e+61) tmp = t_2; elseif (t <= -1.16e-170) tmp = t_3; elseif (t <= -1.66e-206) tmp = t_2; elseif (t <= 3.2e-217) tmp = Float64(t * Float64(sqrt(x) * Float64(1.0 / l))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 6.2e-12) tmp = t_3; 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) t_1 = (l * l) / x; t_2 = t / -t; t_3 = t / sqrt(((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))) / 2.0)); tmp = 0.0; if (t <= -1.26e+61) tmp = t_2; elseif (t <= -1.16e-170) tmp = t_3; elseif (t <= -1.66e-206) tmp = t_2; elseif (t <= 3.2e-217) tmp = t * (sqrt(x) * (1.0 / l)); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 6.2e-12) tmp = t_3; 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_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t / (-t)), $MachinePrecision]}, Block[{t$95$3 = N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.26e+61], t$95$2, If[LessEqual[t, -1.16e-170], t$95$3, If[LessEqual[t, -1.66e-206], t$95$2, If[LessEqual[t, 3.2e-217], N[(t * N[(N[Sqrt[x], $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 6.2e-12], t$95$3, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := \frac{t}{-t}\\
t_3 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}{2}}}\\
\mathbf{if}\;t \leq -1.26 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.16 \cdot 10^{-170}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.66 \cdot 10^{-206}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \left(\sqrt{x} \cdot \frac{1}{\ell}\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-12}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -1.2600000000000001e61 or -1.1599999999999999e-170 < t < -1.66000000000000013e-206Initial program 27.3%
associate-*l/27.3%
Simplified27.3%
*-commutative27.3%
clear-num27.3%
un-div-inv27.3%
sqrt-undiv27.4%
metadata-eval27.4%
sub-neg27.4%
associate-*l/5.5%
sub-neg5.5%
metadata-eval5.5%
Applied egg-rr5.5%
+-commutative5.5%
*-commutative5.5%
+-commutative5.5%
+-commutative5.5%
Simplified5.5%
Taylor expanded in t around inf 7.9%
associate-*r/7.9%
+-commutative7.9%
*-commutative7.9%
unpow27.9%
sub-neg7.9%
metadata-eval7.9%
Simplified7.9%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt95.4%
mul-1-neg95.4%
Simplified95.4%
if -1.2600000000000001e61 < t < -1.1599999999999999e-170 or 2.5499999999999998e-147 < t < 6.2000000000000002e-12Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
*-commutative45.3%
clear-num45.3%
un-div-inv45.3%
sqrt-undiv45.6%
metadata-eval45.6%
sub-neg45.6%
associate-*l/43.0%
sub-neg43.0%
metadata-eval43.0%
Applied egg-rr43.0%
+-commutative43.0%
*-commutative43.0%
+-commutative43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in x around inf 85.2%
distribute-lft-in85.2%
associate--l+85.2%
unpow285.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
mul-1-neg85.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
fma-udef85.2%
Simplified85.2%
Taylor expanded in t around 0 84.4%
unpow284.4%
Simplified84.4%
if -1.66000000000000013e-206 < t < 3.2000000000000001e-217Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 55.4%
associate--l+55.4%
unpow255.4%
distribute-lft-out55.4%
unpow255.4%
unpow255.4%
associate-*r/55.4%
mul-1-neg55.4%
+-commutative55.4%
unpow255.4%
unpow255.4%
fma-udef55.4%
Simplified55.4%
Taylor expanded in t around 0 55.0%
sub-neg55.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in l around 0 47.6%
if 3.2000000000000001e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 6.2000000000000002e-12 < t Initial program 43.1%
associate-*l/43.1%
Simplified43.1%
Taylor expanded in t around inf 21.3%
*-commutative21.3%
+-commutative21.3%
associate-*r/50.6%
sub-neg50.6%
metadata-eval50.6%
associate-*r*50.6%
unpow250.6%
+-commutative50.6%
Simplified50.6%
Taylor expanded in t around 0 92.4%
Final simplification85.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2 (* 2.0 (+ (* t t) (/ (* t t) x))))
(t_3 (/ t (- t))))
(if (<= t -4.8e+60)
t_3
(if (<= t -1e-179)
(/ t (sqrt (/ (+ t_1 (+ t_2 (/ (fma 2.0 (* t t) (* l l)) x))) 2.0)))
(if (<= t -1.55e-209)
t_3
(if (<= t 6.2e-218)
(* t (/ (sqrt x) l))
(if (<= t 2.55e-147)
1.0
(if (<= t 3.2e-12)
(/ t (sqrt (/ (+ t_1 (+ t_1 t_2)) 2.0)))
(sqrt (/ (+ x -1.0) (+ x 1.0)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = 2.0 * ((t * t) + ((t * t) / x));
double t_3 = t / -t;
double tmp;
if (t <= -4.8e+60) {
tmp = t_3;
} else if (t <= -1e-179) {
tmp = t / sqrt(((t_1 + (t_2 + (fma(2.0, (t * t), (l * l)) / x))) / 2.0));
} else if (t <= -1.55e-209) {
tmp = t_3;
} else if (t <= 6.2e-218) {
tmp = t * (sqrt(x) / l);
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 3.2e-12) {
tmp = t / sqrt(((t_1 + (t_1 + t_2)) / 2.0));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) t_3 = Float64(t / Float64(-t)) tmp = 0.0 if (t <= -4.8e+60) tmp = t_3; elseif (t <= -1e-179) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_2 + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x))) / 2.0))); elseif (t <= -1.55e-209) tmp = t_3; elseif (t <= 6.2e-218) tmp = Float64(t * Float64(sqrt(x) / l)); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 3.2e-12) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + t_2)) / 2.0))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t / (-t)), $MachinePrecision]}, If[LessEqual[t, -4.8e+60], t$95$3, If[LessEqual[t, -1e-179], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$2 + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.55e-209], t$95$3, If[LessEqual[t, 6.2e-218], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 3.2e-12], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] / 2.0), $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}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\\
t_3 := \frac{t}{-t}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+60}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-179}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_2 + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}{2}}}\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-209}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-218}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_1 + t_2\right)}{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -4.8e60 or -1e-179 < t < -1.55e-209Initial program 26.9%
associate-*l/26.9%
Simplified26.9%
*-commutative26.9%
clear-num26.9%
un-div-inv26.9%
sqrt-undiv27.0%
metadata-eval27.0%
sub-neg27.0%
associate-*l/5.5%
sub-neg5.5%
metadata-eval5.5%
Applied egg-rr5.5%
+-commutative5.5%
*-commutative5.5%
+-commutative5.5%
+-commutative5.5%
Simplified5.5%
Taylor expanded in t around inf 7.8%
associate-*r/7.8%
+-commutative7.8%
*-commutative7.8%
unpow27.8%
sub-neg7.8%
metadata-eval7.8%
Simplified7.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt94.1%
mul-1-neg94.1%
Simplified94.1%
if -4.8e60 < t < -1e-179Initial program 48.8%
associate-*l/48.8%
Simplified48.8%
*-commutative48.8%
clear-num48.8%
un-div-inv48.8%
sqrt-undiv49.1%
metadata-eval49.1%
sub-neg49.1%
associate-*l/45.1%
sub-neg45.1%
metadata-eval45.1%
Applied egg-rr45.1%
+-commutative45.1%
*-commutative45.1%
+-commutative45.1%
+-commutative45.1%
Simplified45.1%
Taylor expanded in x around inf 87.5%
distribute-lft-in87.5%
associate--l+87.5%
unpow287.5%
+-commutative87.5%
unpow287.5%
unpow287.5%
mul-1-neg87.5%
+-commutative87.5%
unpow287.5%
unpow287.5%
fma-udef87.5%
Simplified87.5%
if -1.55e-209 < t < 6.19999999999999994e-218Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 57.5%
associate--l+57.5%
unpow257.5%
distribute-lft-out57.5%
unpow257.5%
unpow257.5%
associate-*r/57.5%
mul-1-neg57.5%
+-commutative57.5%
unpow257.5%
unpow257.5%
fma-udef57.5%
Simplified57.5%
Taylor expanded in t around 0 57.1%
sub-neg57.1%
unpow257.1%
mul-1-neg57.1%
remove-double-neg57.1%
unpow257.1%
Simplified57.1%
Taylor expanded in l around 0 49.4%
associate-*l/49.4%
*-lft-identity49.4%
Simplified49.4%
if 6.19999999999999994e-218 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 2.5499999999999998e-147 < t < 3.2000000000000001e-12Initial program 38.3%
associate-*l/38.3%
Simplified38.3%
*-commutative38.3%
clear-num38.3%
un-div-inv38.2%
sqrt-undiv38.5%
metadata-eval38.5%
sub-neg38.5%
associate-*l/38.7%
sub-neg38.7%
metadata-eval38.7%
Applied egg-rr38.7%
+-commutative38.7%
*-commutative38.7%
+-commutative38.7%
+-commutative38.7%
Simplified38.7%
Taylor expanded in x around inf 80.6%
distribute-lft-in80.6%
associate--l+80.6%
unpow280.6%
+-commutative80.6%
unpow280.6%
unpow280.6%
mul-1-neg80.6%
+-commutative80.6%
unpow280.6%
unpow280.6%
fma-udef80.6%
Simplified80.6%
Taylor expanded in t around 0 80.6%
unpow280.6%
Simplified80.6%
if 3.2000000000000001e-12 < t Initial program 43.1%
associate-*l/43.1%
Simplified43.1%
Taylor expanded in t around inf 21.3%
*-commutative21.3%
+-commutative21.3%
associate-*r/50.6%
sub-neg50.6%
metadata-eval50.6%
associate-*r*50.6%
unpow250.6%
+-commutative50.6%
Simplified50.6%
Taylor expanded in t around 0 92.4%
Final simplification85.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (/ (sqrt x) l))))
(if (<= t -3.6e-151)
(/ t (- (/ (- t) x) t))
(if (<= t 4.2e-217)
t_1
(if (<= t 8.6e-147)
1.0
(if (<= t 1.32e-92) t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(x) / l);
double tmp;
if (t <= -3.6e-151) {
tmp = t / ((-t / x) - t);
} else if (t <= 4.2e-217) {
tmp = t_1;
} else if (t <= 8.6e-147) {
tmp = 1.0;
} else if (t <= 1.32e-92) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (sqrt(x) / l)
if (t <= (-3.6d-151)) then
tmp = t / ((-t / x) - t)
else if (t <= 4.2d-217) then
tmp = t_1
else if (t <= 8.6d-147) then
tmp = 1.0d0
else if (t <= 1.32d-92) then
tmp = t_1
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 t_1 = t * (Math.sqrt(x) / l);
double tmp;
if (t <= -3.6e-151) {
tmp = t / ((-t / x) - t);
} else if (t <= 4.2e-217) {
tmp = t_1;
} else if (t <= 8.6e-147) {
tmp = 1.0;
} else if (t <= 1.32e-92) {
tmp = t_1;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * (math.sqrt(x) / l) tmp = 0 if t <= -3.6e-151: tmp = t / ((-t / x) - t) elif t <= 4.2e-217: tmp = t_1 elif t <= 8.6e-147: tmp = 1.0 elif t <= 1.32e-92: tmp = t_1 else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(x) / l)) tmp = 0.0 if (t <= -3.6e-151) tmp = Float64(t / Float64(Float64(Float64(-t) / x) - t)); elseif (t <= 4.2e-217) tmp = t_1; elseif (t <= 8.6e-147) tmp = 1.0; elseif (t <= 1.32e-92) tmp = t_1; 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) t_1 = t * (sqrt(x) / l); tmp = 0.0; if (t <= -3.6e-151) tmp = t / ((-t / x) - t); elseif (t <= 4.2e-217) tmp = t_1; elseif (t <= 8.6e-147) tmp = 1.0; elseif (t <= 1.32e-92) tmp = t_1; 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_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-151], N[(t / N[(N[((-t) / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-217], t$95$1, If[LessEqual[t, 8.6e-147], 1.0, If[LessEqual[t, 1.32e-92], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;\frac{t}{\frac{-t}{x} - t}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.60000000000000032e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
*-commutative39.0%
clear-num39.0%
un-div-inv39.0%
sqrt-undiv39.2%
metadata-eval39.2%
sub-neg39.2%
associate-*l/24.1%
sub-neg24.1%
metadata-eval24.1%
Applied egg-rr24.1%
+-commutative24.1%
*-commutative24.1%
+-commutative24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in t around inf 37.5%
associate-*r/37.5%
+-commutative37.5%
*-commutative37.5%
unpow237.5%
sub-neg37.5%
metadata-eval37.5%
Simplified37.5%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
rem-square-sqrt89.0%
mul-1-neg89.0%
fma-neg89.0%
mul-1-neg89.0%
Simplified89.0%
if -3.60000000000000032e-151 < t < 4.2e-217 or 8.6000000000000002e-147 < t < 1.3200000000000001e-92Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 57.8%
associate--l+57.8%
unpow257.8%
distribute-lft-out57.8%
unpow257.8%
unpow257.8%
associate-*r/57.8%
mul-1-neg57.8%
+-commutative57.8%
unpow257.8%
unpow257.8%
fma-udef57.8%
Simplified57.8%
Taylor expanded in t around 0 57.5%
sub-neg57.5%
unpow257.5%
mul-1-neg57.5%
remove-double-neg57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in l around 0 47.7%
associate-*l/47.7%
*-lft-identity47.7%
Simplified47.7%
if 4.2e-217 < t < 8.6000000000000002e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 1.3200000000000001e-92 < t Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in t around inf 29.0%
*-commutative29.0%
+-commutative29.0%
associate-*r/53.5%
sub-neg53.5%
metadata-eval53.5%
associate-*r*53.5%
unpow253.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 88.7%
Final simplification81.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (/ (sqrt x) l))) (t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.75e-150)
(- t_2)
(if (<= t 2.2e-218)
t_1
(if (<= t 1.05e-144) 1.0 (if (<= t 1.15e-92) t_1 t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(x) / l);
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.75e-150) {
tmp = -t_2;
} else if (t <= 2.2e-218) {
tmp = t_1;
} else if (t <= 1.05e-144) {
tmp = 1.0;
} else if (t <= 1.15e-92) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = t * (sqrt(x) / l)
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.75d-150)) then
tmp = -t_2
else if (t <= 2.2d-218) then
tmp = t_1
else if (t <= 1.05d-144) then
tmp = 1.0d0
else if (t <= 1.15d-92) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t * (Math.sqrt(x) / l);
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.75e-150) {
tmp = -t_2;
} else if (t <= 2.2e-218) {
tmp = t_1;
} else if (t <= 1.05e-144) {
tmp = 1.0;
} else if (t <= 1.15e-92) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * (math.sqrt(x) / l) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.75e-150: tmp = -t_2 elif t <= 2.2e-218: tmp = t_1 elif t <= 1.05e-144: tmp = 1.0 elif t <= 1.15e-92: tmp = t_1 else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(x) / l)) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.75e-150) tmp = Float64(-t_2); elseif (t <= 2.2e-218) tmp = t_1; elseif (t <= 1.05e-144) tmp = 1.0; elseif (t <= 1.15e-92) tmp = t_1; else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * (sqrt(x) / l); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.75e-150) tmp = -t_2; elseif (t <= 2.2e-218) tmp = t_1; elseif (t <= 1.05e-144) tmp = 1.0; elseif (t <= 1.15e-92) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.75e-150], (-t$95$2), If[LessEqual[t, 2.2e-218], t$95$1, If[LessEqual[t, 1.05e-144], 1.0, If[LessEqual[t, 1.15e-92], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{x}}{\ell}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.75 \cdot 10^{-150}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-144}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.7499999999999999e-150Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in t around inf 37.4%
*-commutative37.4%
+-commutative37.4%
associate-*r/56.1%
sub-neg56.1%
metadata-eval56.1%
associate-*r*56.1%
unpow256.1%
+-commutative56.1%
Simplified56.1%
Taylor expanded in t around -inf 89.3%
mul-1-neg89.3%
+-commutative89.3%
sub-neg89.3%
metadata-eval89.3%
Simplified89.3%
if -1.7499999999999999e-150 < t < 2.20000000000000007e-218 or 1.0500000000000001e-144 < t < 1.15000000000000008e-92Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 57.8%
associate--l+57.8%
unpow257.8%
distribute-lft-out57.8%
unpow257.8%
unpow257.8%
associate-*r/57.8%
mul-1-neg57.8%
+-commutative57.8%
unpow257.8%
unpow257.8%
fma-udef57.8%
Simplified57.8%
Taylor expanded in t around 0 57.5%
sub-neg57.5%
unpow257.5%
mul-1-neg57.5%
remove-double-neg57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in l around 0 47.7%
associate-*l/47.7%
*-lft-identity47.7%
Simplified47.7%
if 2.20000000000000007e-218 < t < 1.0500000000000001e-144Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 1.15000000000000008e-92 < t Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in t around inf 29.0%
*-commutative29.0%
+-commutative29.0%
associate-*r/53.5%
sub-neg53.5%
metadata-eval53.5%
associate-*r*53.5%
unpow253.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 88.7%
Final simplification81.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt x) (/ t l))))
(if (<= t -2.2e-151)
(/ t (- (/ (- t) x) t))
(if (<= t 3.8e-217)
t_1
(if (<= t 1.95e-144)
1.0
(if (<= t 8.5e-94) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(x) * (t / l);
double tmp;
if (t <= -2.2e-151) {
tmp = t / ((-t / x) - t);
} else if (t <= 3.8e-217) {
tmp = t_1;
} else if (t <= 1.95e-144) {
tmp = 1.0;
} else if (t <= 8.5e-94) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = sqrt(x) * (t / l)
if (t <= (-2.2d-151)) then
tmp = t / ((-t / x) - t)
else if (t <= 3.8d-217) then
tmp = t_1
else if (t <= 1.95d-144) then
tmp = 1.0d0
else if (t <= 8.5d-94) then
tmp = t_1
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 t_1 = Math.sqrt(x) * (t / l);
double tmp;
if (t <= -2.2e-151) {
tmp = t / ((-t / x) - t);
} else if (t <= 3.8e-217) {
tmp = t_1;
} else if (t <= 1.95e-144) {
tmp = 1.0;
} else if (t <= 8.5e-94) {
tmp = t_1;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(x) * (t / l) tmp = 0 if t <= -2.2e-151: tmp = t / ((-t / x) - t) elif t <= 3.8e-217: tmp = t_1 elif t <= 1.95e-144: tmp = 1.0 elif t <= 8.5e-94: tmp = t_1 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(x) * Float64(t / l)) tmp = 0.0 if (t <= -2.2e-151) tmp = Float64(t / Float64(Float64(Float64(-t) / x) - t)); elseif (t <= 3.8e-217) tmp = t_1; elseif (t <= 1.95e-144) tmp = 1.0; elseif (t <= 8.5e-94) tmp = t_1; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(x) * (t / l); tmp = 0.0; if (t <= -2.2e-151) tmp = t / ((-t / x) - t); elseif (t <= 3.8e-217) tmp = t_1; elseif (t <= 1.95e-144) tmp = 1.0; elseif (t <= 8.5e-94) tmp = t_1; 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_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-151], N[(t / N[(N[((-t) / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-217], t$95$1, If[LessEqual[t, 1.95e-144], 1.0, If[LessEqual[t, 8.5e-94], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{t}{\frac{-t}{x} - t}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-144}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -2.1999999999999999e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
*-commutative39.0%
clear-num39.0%
un-div-inv39.0%
sqrt-undiv39.2%
metadata-eval39.2%
sub-neg39.2%
associate-*l/24.1%
sub-neg24.1%
metadata-eval24.1%
Applied egg-rr24.1%
+-commutative24.1%
*-commutative24.1%
+-commutative24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in t around inf 37.5%
associate-*r/37.5%
+-commutative37.5%
*-commutative37.5%
unpow237.5%
sub-neg37.5%
metadata-eval37.5%
Simplified37.5%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
rem-square-sqrt89.0%
mul-1-neg89.0%
fma-neg89.0%
mul-1-neg89.0%
Simplified89.0%
if -2.1999999999999999e-151 < t < 3.79999999999999987e-217 or 1.95000000000000007e-144 < t < 8.50000000000000003e-94Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 57.8%
associate--l+57.8%
unpow257.8%
distribute-lft-out57.8%
unpow257.8%
unpow257.8%
associate-*r/57.8%
mul-1-neg57.8%
+-commutative57.8%
unpow257.8%
unpow257.8%
fma-udef57.8%
Simplified57.8%
Taylor expanded in t around 0 57.5%
sub-neg57.5%
unpow257.5%
mul-1-neg57.5%
remove-double-neg57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in l around 0 36.6%
if 3.79999999999999987e-217 < t < 1.95000000000000007e-144Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 8.50000000000000003e-94 < t Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in t around inf 29.0%
*-commutative29.0%
+-commutative29.0%
associate-*r/53.5%
sub-neg53.5%
metadata-eval53.5%
associate-*r*53.5%
unpow253.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in x around inf 88.2%
associate--l+88.2%
associate-*r/88.2%
metadata-eval88.2%
unpow288.2%
Simplified88.2%
Final simplification79.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (/ (sqrt x) l))))
(if (<= t -3.4e-150)
(/ t (- (/ (- t) x) t))
(if (<= t 6e-217)
t_1
(if (<= t 3.3e-147)
1.0
(if (<= t 4.2e-92) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(x) / l);
double tmp;
if (t <= -3.4e-150) {
tmp = t / ((-t / x) - t);
} else if (t <= 6e-217) {
tmp = t_1;
} else if (t <= 3.3e-147) {
tmp = 1.0;
} else if (t <= 4.2e-92) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t * (sqrt(x) / l)
if (t <= (-3.4d-150)) then
tmp = t / ((-t / x) - t)
else if (t <= 6d-217) then
tmp = t_1
else if (t <= 3.3d-147) then
tmp = 1.0d0
else if (t <= 4.2d-92) then
tmp = t_1
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 t_1 = t * (Math.sqrt(x) / l);
double tmp;
if (t <= -3.4e-150) {
tmp = t / ((-t / x) - t);
} else if (t <= 6e-217) {
tmp = t_1;
} else if (t <= 3.3e-147) {
tmp = 1.0;
} else if (t <= 4.2e-92) {
tmp = t_1;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * (math.sqrt(x) / l) tmp = 0 if t <= -3.4e-150: tmp = t / ((-t / x) - t) elif t <= 6e-217: tmp = t_1 elif t <= 3.3e-147: tmp = 1.0 elif t <= 4.2e-92: tmp = t_1 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(x) / l)) tmp = 0.0 if (t <= -3.4e-150) tmp = Float64(t / Float64(Float64(Float64(-t) / x) - t)); elseif (t <= 6e-217) tmp = t_1; elseif (t <= 3.3e-147) tmp = 1.0; elseif (t <= 4.2e-92) tmp = t_1; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * (sqrt(x) / l); tmp = 0.0; if (t <= -3.4e-150) tmp = t / ((-t / x) - t); elseif (t <= 6e-217) tmp = t_1; elseif (t <= 3.3e-147) tmp = 1.0; elseif (t <= 4.2e-92) tmp = t_1; 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_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-150], N[(t / N[(N[((-t) / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-217], t$95$1, If[LessEqual[t, 3.3e-147], 1.0, If[LessEqual[t, 4.2e-92], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-150}:\\
\;\;\;\;\frac{t}{\frac{-t}{x} - t}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-217}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -3.39999999999999999e-150Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
*-commutative39.0%
clear-num39.0%
un-div-inv39.0%
sqrt-undiv39.2%
metadata-eval39.2%
sub-neg39.2%
associate-*l/24.1%
sub-neg24.1%
metadata-eval24.1%
Applied egg-rr24.1%
+-commutative24.1%
*-commutative24.1%
+-commutative24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in t around inf 37.5%
associate-*r/37.5%
+-commutative37.5%
*-commutative37.5%
unpow237.5%
sub-neg37.5%
metadata-eval37.5%
Simplified37.5%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
rem-square-sqrt89.0%
mul-1-neg89.0%
fma-neg89.0%
mul-1-neg89.0%
Simplified89.0%
if -3.39999999999999999e-150 < t < 6.00000000000000009e-217 or 3.29999999999999987e-147 < t < 4.2e-92Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 57.8%
associate--l+57.8%
unpow257.8%
distribute-lft-out57.8%
unpow257.8%
unpow257.8%
associate-*r/57.8%
mul-1-neg57.8%
+-commutative57.8%
unpow257.8%
unpow257.8%
fma-udef57.8%
Simplified57.8%
Taylor expanded in t around 0 57.5%
sub-neg57.5%
unpow257.5%
mul-1-neg57.5%
remove-double-neg57.5%
unpow257.5%
Simplified57.5%
Taylor expanded in l around 0 47.7%
associate-*l/47.7%
*-lft-identity47.7%
Simplified47.7%
if 6.00000000000000009e-217 < t < 3.29999999999999987e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
Taylor expanded in t around inf 25.2%
*-commutative25.2%
+-commutative25.2%
associate-*r/25.2%
sub-neg25.2%
metadata-eval25.2%
associate-*r*25.2%
unpow225.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around inf 70.9%
if 4.2e-92 < t Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in t around inf 29.0%
*-commutative29.0%
+-commutative29.0%
associate-*r/53.5%
sub-neg53.5%
metadata-eval53.5%
associate-*r*53.5%
unpow253.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in x around inf 88.2%
associate--l+88.2%
associate-*r/88.2%
metadata-eval88.2%
unpow288.2%
Simplified88.2%
Final simplification81.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2e-310) (/ t (- (/ (- t) x) t)) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / ((-t / x) - t);
} 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 <= (-2d-310)) then
tmp = t / ((-t / x) - t)
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 <= -2e-310) {
tmp = t / ((-t / x) - t);
} 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 <= -2e-310: tmp = t / ((-t / x) - t) 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 <= -2e-310) tmp = Float64(t / Float64(Float64(Float64(-t) / x) - t)); else tmp = Float64(1.0 + Float64(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 <= -2e-310) tmp = t / ((-t / x) - t); 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, -2e-310], N[(t / N[(N[((-t) / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\frac{-t}{x} - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
*-commutative33.0%
clear-num33.0%
un-div-inv33.0%
sqrt-undiv33.2%
metadata-eval33.2%
sub-neg33.2%
associate-*l/22.3%
sub-neg22.3%
metadata-eval22.3%
Applied egg-rr22.3%
+-commutative22.3%
*-commutative22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in t around inf 31.8%
associate-*r/31.8%
+-commutative31.8%
*-commutative31.8%
unpow231.8%
sub-neg31.8%
metadata-eval31.8%
Simplified31.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
rem-square-sqrt80.4%
mul-1-neg80.4%
fma-neg80.4%
mul-1-neg80.4%
Simplified80.4%
if -1.999999999999994e-310 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
Taylor expanded in t around inf 24.6%
*-commutative24.6%
+-commutative24.6%
associate-*r/42.8%
sub-neg42.8%
metadata-eval42.8%
associate-*r*42.8%
unpow242.8%
+-commutative42.8%
Simplified42.8%
Taylor expanded in x around inf 75.5%
associate--l+75.5%
associate-*r/75.5%
metadata-eval75.5%
unpow275.5%
Simplified75.5%
Final simplification77.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2e-310) (/ t (- (/ (- t) x) t)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / ((-t / x) - t);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2d-310)) then
tmp = t / ((-t / x) - t)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / ((-t / x) - t);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2e-310: tmp = t / ((-t / x) - t) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2e-310) tmp = Float64(t / Float64(Float64(Float64(-t) / x) - t)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2e-310) tmp = t / ((-t / x) - t); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2e-310], N[(t / N[(N[((-t) / x), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{\frac{-t}{x} - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
*-commutative33.0%
clear-num33.0%
un-div-inv33.0%
sqrt-undiv33.2%
metadata-eval33.2%
sub-neg33.2%
associate-*l/22.3%
sub-neg22.3%
metadata-eval22.3%
Applied egg-rr22.3%
+-commutative22.3%
*-commutative22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in t around inf 31.8%
associate-*r/31.8%
+-commutative31.8%
*-commutative31.8%
unpow231.8%
sub-neg31.8%
metadata-eval31.8%
Simplified31.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
fma-def0.0%
unpow20.0%
rem-square-sqrt80.4%
mul-1-neg80.4%
fma-neg80.4%
mul-1-neg80.4%
Simplified80.4%
if -1.999999999999994e-310 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
Taylor expanded in t around inf 24.6%
*-commutative24.6%
+-commutative24.6%
associate-*r/42.8%
sub-neg42.8%
metadata-eval42.8%
associate-*r*42.8%
unpow242.8%
+-commutative42.8%
Simplified42.8%
Taylor expanded in x around inf 75.0%
Final simplification77.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2e-310) (/ t (- t)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / -t;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2d-310)) then
tmp = t / -t
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / -t;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2e-310: tmp = t / -t else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2e-310) tmp = Float64(t / Float64(-t)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2e-310) tmp = t / -t; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2e-310], N[(t / (-t)), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
*-commutative33.0%
clear-num33.0%
un-div-inv33.0%
sqrt-undiv33.2%
metadata-eval33.2%
sub-neg33.2%
associate-*l/22.3%
sub-neg22.3%
metadata-eval22.3%
Applied egg-rr22.3%
+-commutative22.3%
*-commutative22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in t around inf 31.8%
associate-*r/31.8%
+-commutative31.8%
*-commutative31.8%
unpow231.8%
sub-neg31.8%
metadata-eval31.8%
Simplified31.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt79.8%
mul-1-neg79.8%
Simplified79.8%
if -1.999999999999994e-310 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
Taylor expanded in t around inf 24.6%
*-commutative24.6%
+-commutative24.6%
associate-*r/42.8%
sub-neg42.8%
metadata-eval42.8%
associate-*r*42.8%
unpow242.8%
+-commutative42.8%
Simplified42.8%
Taylor expanded in x around inf 75.0%
Final simplification77.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2e-310) (/ t (- t)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / -t;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2d-310)) then
tmp = t / -t
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -2e-310) {
tmp = t / -t;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2e-310: tmp = t / -t else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2e-310) tmp = Float64(t / Float64(-t)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2e-310) tmp = t / -t; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2e-310], N[(t / (-t)), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{t}{-t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
*-commutative33.0%
clear-num33.0%
un-div-inv33.0%
sqrt-undiv33.2%
metadata-eval33.2%
sub-neg33.2%
associate-*l/22.3%
sub-neg22.3%
metadata-eval22.3%
Applied egg-rr22.3%
+-commutative22.3%
*-commutative22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in t around inf 31.8%
associate-*r/31.8%
+-commutative31.8%
*-commutative31.8%
unpow231.8%
sub-neg31.8%
metadata-eval31.8%
Simplified31.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt79.8%
mul-1-neg79.8%
Simplified79.8%
if -1.999999999999994e-310 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
Taylor expanded in t around inf 24.6%
*-commutative24.6%
+-commutative24.6%
associate-*r/42.8%
sub-neg42.8%
metadata-eval42.8%
associate-*r*42.8%
unpow242.8%
+-commutative42.8%
Simplified42.8%
Taylor expanded in x around inf 74.1%
Final simplification76.9%
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 34.8%
associate-*l/34.8%
Simplified34.8%
Taylor expanded in t around inf 28.0%
*-commutative28.0%
+-commutative28.0%
associate-*r/45.0%
sub-neg45.0%
metadata-eval45.0%
associate-*r*45.0%
unpow245.0%
+-commutative45.0%
Simplified45.0%
Taylor expanded in x around inf 39.3%
Final simplification39.3%
herbie shell --seed 2023279
(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)))))