
(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 12 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}
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1e+55)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(if (<= l_m 2.95e+180)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* 2.0 (pow (/ l_m (sqrt x)) 2.0))))))
(if (<= l_m 2.45e+204)
(+ 1.0 (/ (- -1.0 (/ -0.5 x)) x))
(* (sqrt 2.0) (/ t_m (* l_m (* (sqrt 2.0) (sqrt (/ 1.0 x)))))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 1e+55) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else if (l_m <= 2.95e+180) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (2.0 * pow((l_m / sqrt(x)), 2.0)))));
} else if (l_m <= 2.45e+204) {
tmp = 1.0 + ((-1.0 - (-0.5 / x)) / x);
} else {
tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * sqrt((1.0 / x)))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 1e+55) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); elseif (l_m <= 2.95e+180) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64(2.0 * (Float64(l_m / sqrt(x)) ^ 2.0)))))); elseif (l_m <= 2.45e+204) tmp = Float64(1.0 + Float64(Float64(-1.0 - Float64(-0.5 / x)) / x)); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 1e+55], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.95e+180], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[N[(l$95$m / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.45e+204], N[(1.0 + N[(N[(-1.0 - N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 10^{+55}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{elif}\;l\_m \leq 2.95 \cdot 10^{+180}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, 2 \cdot {\left(\frac{l\_m}{\sqrt{x}}\right)}^{2}\right)}}\\
\mathbf{elif}\;l\_m \leq 2.45 \cdot 10^{+204}:\\
\;\;\;\;1 + \frac{-1 - \frac{-0.5}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\end{array}
\end{array}
if l < 1.00000000000000001e55Initial program 39.0%
Simplified34.2%
Taylor expanded in t around inf 43.3%
Taylor expanded in t around 0 43.3%
Taylor expanded in x around inf 43.3%
Taylor expanded in x around -inf 43.4%
mul-1-neg43.4%
unsub-neg43.4%
mul-1-neg43.4%
unsub-neg43.4%
sub-neg43.4%
associate-*r/43.4%
metadata-eval43.4%
distribute-neg-frac43.4%
metadata-eval43.4%
Simplified43.4%
if 1.00000000000000001e55 < l < 2.9500000000000001e180Initial program 6.9%
Simplified6.9%
Taylor expanded in l around 0 25.8%
fma-define25.8%
sub-neg25.8%
metadata-eval25.8%
associate-/l*39.6%
+-commutative39.6%
+-commutative39.6%
associate--l+46.1%
sub-neg46.1%
metadata-eval46.1%
+-commutative46.1%
sub-neg46.1%
metadata-eval46.1%
+-commutative46.1%
Simplified46.1%
Taylor expanded in x around inf 69.1%
add-sqr-sqrt54.9%
sqrt-div54.8%
sqrt-pow154.8%
metadata-eval54.8%
pow154.8%
sqrt-div54.4%
sqrt-pow181.3%
metadata-eval81.3%
pow181.3%
Applied egg-rr81.3%
unpow281.3%
Simplified81.3%
if 2.9500000000000001e180 < l < 2.4499999999999999e204Initial program 0.0%
Simplified0.0%
Taylor expanded in t around inf 60.5%
Taylor expanded in t around 0 60.8%
Taylor expanded in x around inf 60.8%
Taylor expanded in x around -inf 60.8%
mul-1-neg60.8%
unsub-neg60.8%
sub-neg60.8%
associate-*r/60.8%
metadata-eval60.8%
distribute-neg-frac60.8%
metadata-eval60.8%
Simplified60.8%
if 2.4499999999999999e204 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.0%
associate--l+23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in x around inf 81.2%
associate-*l*80.9%
Simplified80.9%
Final simplification47.2%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 1e+33)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(if (<= (* l_m l_m) 2e+287)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (+ (/ 1.0 (+ x -1.0)) (/ (+ 1.0 (/ 1.0 x)) x)))))))
(* (sqrt 2.0) (/ t_m (* (sqrt (/ 1.0 x)) (* l_m (sqrt 2.0)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if ((l_m * l_m) <= 1e+33) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else if ((l_m * l_m) <= 2e+287) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * ((1.0 / (x + -1.0)) + ((1.0 + (1.0 / x)) / x))))));
} else {
tmp = sqrt(2.0) * (t_m / (sqrt((1.0 / x)) * (l_m * sqrt(2.0))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (Float64(l_m * l_m) <= 1e+33) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); elseif (Float64(l_m * l_m) <= 2e+287) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 + Float64(1.0 / x)) / x))))))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(sqrt(Float64(1.0 / x)) * Float64(l_m * sqrt(2.0))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e+33], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+287], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{+33}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \left(\frac{1}{x + -1} + \frac{1 + \frac{1}{x}}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\frac{1}{x}} \cdot \left(l\_m \cdot \sqrt{2}\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 9.9999999999999995e32Initial program 48.8%
Simplified42.4%
Taylor expanded in t around inf 49.9%
Taylor expanded in t around 0 50.0%
Taylor expanded in x around inf 50.0%
Taylor expanded in x around -inf 50.0%
mul-1-neg50.0%
unsub-neg50.0%
mul-1-neg50.0%
unsub-neg50.0%
sub-neg50.0%
associate-*r/50.0%
metadata-eval50.0%
distribute-neg-frac50.0%
metadata-eval50.0%
Simplified50.0%
if 9.9999999999999995e32 < (*.f64 l l) < 2.0000000000000002e287Initial program 17.7%
Simplified17.7%
Taylor expanded in l around 0 25.5%
fma-define25.5%
sub-neg25.5%
metadata-eval25.5%
associate-/l*41.1%
+-commutative41.1%
+-commutative41.1%
associate--l+47.2%
sub-neg47.2%
metadata-eval47.2%
+-commutative47.2%
sub-neg47.2%
metadata-eval47.2%
+-commutative47.2%
Simplified47.2%
Taylor expanded in x around inf 77.8%
if 2.0000000000000002e287 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 0.2%
associate--l+18.5%
sub-neg18.5%
metadata-eval18.5%
+-commutative18.5%
sub-neg18.5%
metadata-eval18.5%
+-commutative18.5%
Simplified18.5%
Taylor expanded in x around inf 37.3%
Final simplification51.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 3.2e+16)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(if (<= l_m 5e+145)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (/ (+ 2.0 (/ (+ 2.0 (* 2.0 (/ 1.0 x))) x)) x))))))
(* (sqrt 2.0) (/ t_m (* (sqrt (/ 1.0 x)) (* l_m (sqrt 2.0)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 3.2e+16) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else if (l_m <= 5e+145) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * ((2.0 + ((2.0 + (2.0 * (1.0 / x))) / x)) / x)))));
} else {
tmp = sqrt(2.0) * (t_m / (sqrt((1.0 / x)) * (l_m * sqrt(2.0))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 3.2e+16) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); elseif (l_m <= 5e+145) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(Float64(2.0 + Float64(Float64(2.0 + Float64(2.0 * Float64(1.0 / x))) / x)) / x)))))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(sqrt(Float64(1.0 / x)) * Float64(l_m * sqrt(2.0))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 3.2e+16], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 5e+145], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(N[(2.0 + N[(2.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 3.2 \cdot 10^{+16}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{elif}\;l\_m \leq 5 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \frac{2 + \frac{2 + 2 \cdot \frac{1}{x}}{x}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\frac{1}{x}} \cdot \left(l\_m \cdot \sqrt{2}\right)}\\
\end{array}
\end{array}
if l < 3.2e16Initial program 39.2%
Simplified34.4%
Taylor expanded in t around inf 43.6%
Taylor expanded in t around 0 43.7%
Taylor expanded in x around inf 43.7%
Taylor expanded in x around -inf 43.7%
mul-1-neg43.7%
unsub-neg43.7%
mul-1-neg43.7%
unsub-neg43.7%
sub-neg43.7%
associate-*r/43.7%
metadata-eval43.7%
distribute-neg-frac43.7%
metadata-eval43.7%
Simplified43.7%
if 3.2e16 < l < 4.99999999999999967e145Initial program 14.7%
Simplified14.7%
Taylor expanded in l around 0 33.8%
fma-define33.8%
sub-neg33.8%
metadata-eval33.8%
associate-/l*54.6%
+-commutative54.6%
+-commutative54.6%
associate--l+60.5%
sub-neg60.5%
metadata-eval60.5%
+-commutative60.5%
sub-neg60.5%
metadata-eval60.5%
+-commutative60.5%
Simplified60.5%
Taylor expanded in x around -inf 92.4%
if 4.99999999999999967e145 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.2%
associate--l+14.3%
sub-neg14.3%
metadata-eval14.3%
+-commutative14.3%
sub-neg14.3%
metadata-eval14.3%
+-commutative14.3%
Simplified14.3%
Taylor expanded in x around inf 65.5%
Final simplification47.9%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 1e+33)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(if (<= (* l_m l_m) 2e+287)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* (pow l_m 2.0) (/ (+ 2.0 (/ 2.0 x)) x))))))
(* (sqrt 2.0) (/ t_m (* (sqrt (/ 1.0 x)) (* l_m (sqrt 2.0)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if ((l_m * l_m) <= 1e+33) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else if ((l_m * l_m) <= 2e+287) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (pow(l_m, 2.0) * ((2.0 + (2.0 / x)) / x)))));
} else {
tmp = sqrt(2.0) * (t_m / (sqrt((1.0 / x)) * (l_m * sqrt(2.0))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (Float64(l_m * l_m) <= 1e+33) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); elseif (Float64(l_m * l_m) <= 2e+287) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(Float64(2.0 + Float64(2.0 / x)) / x)))))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(sqrt(Float64(1.0 / x)) * Float64(l_m * sqrt(2.0))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e+33], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e+287], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{+33}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{elif}\;l\_m \cdot l\_m \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, {l\_m}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\frac{1}{x}} \cdot \left(l\_m \cdot \sqrt{2}\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 9.9999999999999995e32Initial program 48.8%
Simplified42.4%
Taylor expanded in t around inf 49.9%
Taylor expanded in t around 0 50.0%
Taylor expanded in x around inf 50.0%
Taylor expanded in x around -inf 50.0%
mul-1-neg50.0%
unsub-neg50.0%
mul-1-neg50.0%
unsub-neg50.0%
sub-neg50.0%
associate-*r/50.0%
metadata-eval50.0%
distribute-neg-frac50.0%
metadata-eval50.0%
Simplified50.0%
if 9.9999999999999995e32 < (*.f64 l l) < 2.0000000000000002e287Initial program 17.7%
Simplified17.7%
Taylor expanded in l around 0 25.5%
fma-define25.5%
sub-neg25.5%
metadata-eval25.5%
associate-/l*41.1%
+-commutative41.1%
+-commutative41.1%
associate--l+47.2%
sub-neg47.2%
metadata-eval47.2%
+-commutative47.2%
sub-neg47.2%
metadata-eval47.2%
+-commutative47.2%
Simplified47.2%
Taylor expanded in x around inf 77.8%
associate-*r/77.8%
metadata-eval77.8%
Simplified77.8%
if 2.0000000000000002e287 < (*.f64 l l) Initial program 0.1%
Simplified0.1%
Taylor expanded in l around inf 0.2%
associate--l+18.5%
sub-neg18.5%
metadata-eval18.5%
+-commutative18.5%
sub-neg18.5%
metadata-eval18.5%
+-commutative18.5%
Simplified18.5%
Taylor expanded in x around inf 37.3%
Final simplification51.6%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 3.4e+16)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(if (<= l_m 5e+145)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* 2.0 (/ (pow l_m 2.0) x))))))
(* (sqrt 2.0) (/ t_m (* (sqrt (/ 1.0 x)) (* l_m (sqrt 2.0)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 3.4e+16) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else if (l_m <= 5e+145) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (2.0 * (pow(l_m, 2.0) / x)))));
} else {
tmp = sqrt(2.0) * (t_m / (sqrt((1.0 / x)) * (l_m * sqrt(2.0))));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 3.4e+16) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); elseif (l_m <= 5e+145) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64(2.0 * Float64((l_m ^ 2.0) / x)))))); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(sqrt(Float64(1.0 / x)) * Float64(l_m * sqrt(2.0))))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 3.4e+16], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 5e+145], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 3.4 \cdot 10^{+16}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{elif}\;l\_m \leq 5 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, 2 \cdot \frac{{l\_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\frac{1}{x}} \cdot \left(l\_m \cdot \sqrt{2}\right)}\\
\end{array}
\end{array}
if l < 3.4e16Initial program 39.2%
Simplified34.4%
Taylor expanded in t around inf 43.6%
Taylor expanded in t around 0 43.7%
Taylor expanded in x around inf 43.7%
Taylor expanded in x around -inf 43.7%
mul-1-neg43.7%
unsub-neg43.7%
mul-1-neg43.7%
unsub-neg43.7%
sub-neg43.7%
associate-*r/43.7%
metadata-eval43.7%
distribute-neg-frac43.7%
metadata-eval43.7%
Simplified43.7%
if 3.4e16 < l < 4.99999999999999967e145Initial program 14.7%
Simplified14.7%
Taylor expanded in l around 0 33.8%
fma-define33.8%
sub-neg33.8%
metadata-eval33.8%
associate-/l*54.6%
+-commutative54.6%
+-commutative54.6%
associate--l+60.5%
sub-neg60.5%
metadata-eval60.5%
+-commutative60.5%
sub-neg60.5%
metadata-eval60.5%
+-commutative60.5%
Simplified60.5%
Taylor expanded in x around inf 89.0%
if 4.99999999999999967e145 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.2%
associate--l+14.3%
sub-neg14.3%
metadata-eval14.3%
+-commutative14.3%
sub-neg14.3%
metadata-eval14.3%
+-commutative14.3%
Simplified14.3%
Taylor expanded in x around inf 65.5%
Final simplification47.8%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 3.4e+203)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(* (sqrt 2.0) (/ t_m (* l_m (* (sqrt 2.0) (sqrt (/ 1.0 x)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 3.4e+203) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * sqrt((1.0 / x)))));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (l_m <= 3.4d+203) then
tmp = 1.0d0 + ((((0.5d0 + ((-0.5d0) / x)) / x) + (-1.0d0)) / x)
else
tmp = sqrt(2.0d0) * (t_m / (l_m * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 3.4e+203) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = Math.sqrt(2.0) * (t_m / (l_m * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if l_m <= 3.4e+203: tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x) else: tmp = math.sqrt(2.0) * (t_m / (l_m * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 3.4e+203) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (l_m <= 3.4e+203) tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x); else tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * sqrt((1.0 / x))))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 3.4e+203], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 3.4 \cdot 10^{+203}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\end{array}
\end{array}
if l < 3.4000000000000001e203Initial program 36.4%
Simplified32.1%
Taylor expanded in t around inf 41.6%
Taylor expanded in t around 0 41.6%
Taylor expanded in x around inf 41.6%
Taylor expanded in x around -inf 41.6%
mul-1-neg41.6%
unsub-neg41.6%
mul-1-neg41.6%
unsub-neg41.6%
sub-neg41.6%
associate-*r/41.6%
metadata-eval41.6%
distribute-neg-frac41.6%
metadata-eval41.6%
Simplified41.6%
if 3.4000000000000001e203 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.0%
associate--l+23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in x around inf 81.2%
associate-*l*80.9%
Simplified80.9%
Final simplification43.2%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 4.8e+203)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(* (sqrt 2.0) (* (sqrt x) (/ (* t_m (sqrt 0.5)) l_m))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 4.8e+203) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = sqrt(2.0) * (sqrt(x) * ((t_m * sqrt(0.5)) / l_m));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (l_m <= 4.8d+203) then
tmp = 1.0d0 + ((((0.5d0 + ((-0.5d0) / x)) / x) + (-1.0d0)) / x)
else
tmp = sqrt(2.0d0) * (sqrt(x) * ((t_m * sqrt(0.5d0)) / l_m))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 4.8e+203) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(x) * ((t_m * Math.sqrt(0.5)) / l_m));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if l_m <= 4.8e+203: tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x) else: tmp = math.sqrt(2.0) * (math.sqrt(x) * ((t_m * math.sqrt(0.5)) / l_m)) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 4.8e+203) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); else tmp = Float64(sqrt(2.0) * Float64(sqrt(x) * Float64(Float64(t_m * sqrt(0.5)) / l_m))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (l_m <= 4.8e+203) tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x); else tmp = sqrt(2.0) * (sqrt(x) * ((t_m * sqrt(0.5)) / l_m)); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 4.8e+203], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(t$95$m * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 4.8 \cdot 10^{+203}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(\sqrt{x} \cdot \frac{t\_m \cdot \sqrt{0.5}}{l\_m}\right)\\
\end{array}
\end{array}
if l < 4.8000000000000002e203Initial program 36.4%
Simplified32.1%
Taylor expanded in t around inf 41.6%
Taylor expanded in t around 0 41.6%
Taylor expanded in x around inf 41.6%
Taylor expanded in x around -inf 41.6%
mul-1-neg41.6%
unsub-neg41.6%
mul-1-neg41.6%
unsub-neg41.6%
sub-neg41.6%
associate-*r/41.6%
metadata-eval41.6%
distribute-neg-frac41.6%
metadata-eval41.6%
Simplified41.6%
if 4.8000000000000002e203 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.0%
associate--l+23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in x around inf 71.8%
Final simplification42.8%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 1.6e+204)
(+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))
(* (sqrt 2.0) (* (sqrt x) (* t_m (/ (sqrt 0.5) l_m)))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 1.6e+204) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = sqrt(2.0) * (sqrt(x) * (t_m * (sqrt(0.5) / l_m)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (l_m <= 1.6d+204) then
tmp = 1.0d0 + ((((0.5d0 + ((-0.5d0) / x)) / x) + (-1.0d0)) / x)
else
tmp = sqrt(2.0d0) * (sqrt(x) * (t_m * (sqrt(0.5d0) / l_m)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (l_m <= 1.6e+204) {
tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x);
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(x) * (t_m * (Math.sqrt(0.5) / l_m)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if l_m <= 1.6e+204: tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x) else: tmp = math.sqrt(2.0) * (math.sqrt(x) * (t_m * (math.sqrt(0.5) / l_m))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (l_m <= 1.6e+204) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x)); else tmp = Float64(sqrt(2.0) * Float64(sqrt(x) * Float64(t_m * Float64(sqrt(0.5) / l_m)))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (l_m <= 1.6e+204) tmp = 1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x); else tmp = sqrt(2.0) * (sqrt(x) * (t_m * (sqrt(0.5) / l_m))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[l$95$m, 1.6e+204], N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m * N[(N[Sqrt[0.5], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.6 \cdot 10^{+204}:\\
\;\;\;\;1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(\sqrt{x} \cdot \left(t\_m \cdot \frac{\sqrt{0.5}}{l\_m}\right)\right)\\
\end{array}
\end{array}
if l < 1.6e204Initial program 36.4%
Simplified32.1%
Taylor expanded in t around inf 41.6%
Taylor expanded in t around 0 41.6%
Taylor expanded in x around inf 41.6%
Taylor expanded in x around -inf 41.6%
mul-1-neg41.6%
unsub-neg41.6%
mul-1-neg41.6%
unsub-neg41.6%
sub-neg41.6%
associate-*r/41.6%
metadata-eval41.6%
distribute-neg-frac41.6%
metadata-eval41.6%
Simplified41.6%
if 1.6e204 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 0.0%
associate--l+23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
sub-neg23.5%
metadata-eval23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in x around inf 71.8%
*-commutative71.8%
associate-/l*71.8%
Simplified71.8%
Final simplification42.8%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ (+ (/ (+ 0.5 (/ -0.5 x)) x) -1.0) x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((((0.5d0 + ((-0.5d0) / x)) / x) + (-1.0d0)) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 + Float64(Float64(Float64(Float64(0.5 + Float64(-0.5 / x)) / x) + -1.0) / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 + ((((0.5 + (-0.5 / x)) / x) + -1.0) / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(N[(N[(0.5 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{\frac{0.5 + \frac{-0.5}{x}}{x} + -1}{x}\right)
\end{array}
Initial program 35.0%
Simplified30.8%
Taylor expanded in t around inf 40.5%
Taylor expanded in t around 0 40.5%
Taylor expanded in x around inf 40.5%
Taylor expanded in x around -inf 40.5%
mul-1-neg40.5%
unsub-neg40.5%
mul-1-neg40.5%
unsub-neg40.5%
sub-neg40.5%
associate-*r/40.5%
metadata-eval40.5%
distribute-neg-frac40.5%
metadata-eval40.5%
Simplified40.5%
Final simplification40.5%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ (- -1.0 (/ -0.5 x)) x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + (((-1.0d0) - ((-0.5d0) / x)) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 + Float64(Float64(-1.0 - Float64(-0.5 / x)) / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(-1.0 - N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{-1 - \frac{-0.5}{x}}{x}\right)
\end{array}
Initial program 35.0%
Simplified30.8%
Taylor expanded in t around inf 40.5%
Taylor expanded in t around 0 40.5%
Taylor expanded in x around inf 40.5%
Taylor expanded in x around -inf 40.5%
mul-1-neg40.5%
unsub-neg40.5%
sub-neg40.5%
associate-*r/40.5%
metadata-eval40.5%
distribute-neg-frac40.5%
metadata-eval40.5%
Simplified40.5%
Final simplification40.5%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (- 1.0 (/ 1.0 x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - (1.0 / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 - (1.0d0 / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - (1.0 / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 - (1.0 / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 - Float64(1.0 / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 - (1.0 / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 - \frac{1}{x}\right)
\end{array}
Initial program 35.0%
Simplified30.8%
Taylor expanded in t around inf 40.5%
Taylor expanded in x around inf 40.4%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * 1.0
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * 1.0) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * 1.0; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot 1
\end{array}
Initial program 35.0%
Simplified30.8%
Taylor expanded in t around inf 40.5%
Taylor expanded in x around inf 39.9%
herbie shell --seed 2024180
(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)))))