
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (/ (+ x -1.0) (+ x 1.0))))
(*
t_s
(if (<= t_m 8.5e-245)
(/ (* t_m (sqrt (* x 0.5))) (/ l_m (sqrt 2.0)))
(if (<= t_m 2.75e-176)
(*
t_m
(/
(sqrt 2.0)
(+
(*
0.5
(/
(+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l_m 2.0)))
(* t_m (* x (sqrt 2.0)))))
(* t_m (sqrt 2.0)))))
(if (<= t_m 3.2e+55)
(*
t_m
(/
(sqrt 2.0)
(sqrt
(fma 2.0 (/ (pow t_m 2.0) t_2) (* 2.0 (/ (pow l_m 2.0) x))))))
(sqrt t_2)))))))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 t_2 = (x + -1.0) / (x + 1.0);
double tmp;
if (t_m <= 8.5e-245) {
tmp = (t_m * sqrt((x * 0.5))) / (l_m / sqrt(2.0));
} else if (t_m <= 2.75e-176) {
tmp = t_m * (sqrt(2.0) / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l_m, 2.0))) / (t_m * (x * sqrt(2.0))))) + (t_m * sqrt(2.0))));
} else if (t_m <= 3.2e+55) {
tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), (2.0 * (pow(l_m, 2.0) / x)))));
} else {
tmp = sqrt(t_2);
}
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) t_2 = Float64(Float64(x + -1.0) / Float64(x + 1.0)) tmp = 0.0 if (t_m <= 8.5e-245) tmp = Float64(Float64(t_m * sqrt(Float64(x * 0.5))) / Float64(l_m / sqrt(2.0))); elseif (t_m <= 2.75e-176) tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l_m ^ 2.0))) / Float64(t_m * Float64(x * sqrt(2.0))))) + Float64(t_m * sqrt(2.0))))); elseif (t_m <= 3.2e+55) tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(2.0 * Float64((l_m ^ 2.0) / x)))))); else tmp = sqrt(t_2); 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_] := Block[{t$95$2 = N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.5e-245], N[(N[(t$95$m * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.75e-176], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.2e+55], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{x + -1}{x + 1}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 8.5 \cdot 10^{-245}:\\
\;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\
\mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + 2 \cdot {l_m}^{2}}{t_m \cdot \left(x \cdot \sqrt{2}\right)} + t_m \cdot \sqrt{2}}\\
\mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t_2}\\
\end{array}
\end{array}
\end{array}
if t < 8.50000000000000022e-245Initial program 35.9%
Simplified35.9%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+6.1%
sub-neg6.1%
metadata-eval6.1%
+-commutative6.1%
sub-neg6.1%
sub-neg6.1%
metadata-eval6.1%
+-commutative6.1%
metadata-eval6.1%
Simplified6.1%
Taylor expanded in x around inf 12.4%
*-commutative12.4%
Simplified12.4%
associate-/l*12.4%
associate-*r/12.4%
Applied egg-rr12.4%
if 8.50000000000000022e-245 < t < 2.75e-176Initial program 2.1%
Simplified2.1%
Taylor expanded in l around 0 2.1%
fma-def2.1%
associate-/l*2.1%
+-commutative2.1%
sub-neg2.1%
metadata-eval2.1%
+-commutative2.1%
associate--l+32.3%
sub-neg32.3%
metadata-eval32.3%
+-commutative32.3%
sub-neg32.3%
metadata-eval32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in x around inf 82.3%
if 2.75e-176 < t < 3.2000000000000003e55Initial program 49.5%
Simplified49.7%
Taylor expanded in l around 0 51.0%
fma-def51.0%
associate-/l*57.9%
+-commutative57.9%
sub-neg57.9%
metadata-eval57.9%
+-commutative57.9%
associate--l+64.7%
sub-neg64.7%
metadata-eval64.7%
+-commutative64.7%
sub-neg64.7%
metadata-eval64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in x around inf 86.5%
if 3.2000000000000003e55 < t Initial program 30.9%
Simplified31.0%
Taylor expanded in t around inf 90.8%
+-commutative90.8%
sub-neg90.8%
metadata-eval90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in t around 0 91.3%
Final simplification47.3%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<=
(/
(* t_m (sqrt 2.0))
(sqrt
(-
(* (/ (+ x 1.0) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
(* l_m l_m))))
2.0)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(/
t_m
(*
(/ l_m (sqrt 2.0))
(sqrt
(+
(/ 1.0 (+ x -1.0))
(+ (/ 1.0 (pow x 2.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 3.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 (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + ((1.0 / pow(x, 2.0)) + ((1.0 / x) + (1.0 / pow(x, 3.0)))))));
}
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 (((t_m * sqrt(2.0d0)) / sqrt(((((x + 1.0d0) / (x + (-1.0d0))) * ((l_m * l_m) + (2.0d0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0d0) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = t_m / ((l_m / sqrt(2.0d0)) * sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / (x ** 2.0d0)) + ((1.0d0 / x) + (1.0d0 / (x ** 3.0d0)))))))
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 (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m / ((l_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / Math.pow(x, 2.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 3.0)))))));
}
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 ((t_m * math.sqrt(2.0)) / math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = t_m / ((l_m / math.sqrt(2.0)) * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / math.pow(x, 2.0)) + ((1.0 / x) + (1.0 / math.pow(x, 3.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(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= 2.0) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(t_m / Float64(Float64(l_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / (x ^ 2.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 3.0)))))))); 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 (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + ((1.0 / (x ^ 2.0)) + ((1.0 / x) + (1.0 / (x ^ 3.0))))))); 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[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m / N[(N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $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}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_m}{\frac{l_m}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{{x}^{2}} + \left(\frac{1}{x} + \frac{1}{{x}^{3}}\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 51.6%
Simplified51.7%
Taylor expanded in t around inf 39.3%
+-commutative39.3%
sub-neg39.3%
metadata-eval39.3%
+-commutative39.3%
Simplified39.3%
Taylor expanded in t around 0 39.5%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 1.1%
Simplified1.1%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+17.3%
sub-neg17.3%
metadata-eval17.3%
+-commutative17.3%
sub-neg17.3%
sub-neg17.3%
metadata-eval17.3%
+-commutative17.3%
metadata-eval17.3%
Simplified17.3%
sqrt-div17.3%
metadata-eval17.3%
associate-/l*17.3%
frac-times17.2%
*-un-lft-identity17.2%
+-commutative17.2%
+-commutative17.2%
+-commutative17.2%
Applied egg-rr17.2%
Taylor expanded in x around inf 38.6%
associate-+r+38.6%
+-commutative38.6%
associate-+l+38.6%
Simplified38.6%
Final simplification39.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (/ (+ x -1.0) (+ x 1.0))))
(*
t_s
(if (<= t_m 1e-211)
(/ (* t_m (sqrt (* x 0.5))) (/ l_m (sqrt 2.0)))
(if (<= t_m 2.4e-177)
1.0
(if (<= t_m 3.2e+55)
(*
t_m
(/
(sqrt 2.0)
(sqrt
(fma 2.0 (/ (pow t_m 2.0) t_2) (* 2.0 (/ (pow l_m 2.0) x))))))
(sqrt t_2)))))))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 t_2 = (x + -1.0) / (x + 1.0);
double tmp;
if (t_m <= 1e-211) {
tmp = (t_m * sqrt((x * 0.5))) / (l_m / sqrt(2.0));
} else if (t_m <= 2.4e-177) {
tmp = 1.0;
} else if (t_m <= 3.2e+55) {
tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), (2.0 * (pow(l_m, 2.0) / x)))));
} else {
tmp = sqrt(t_2);
}
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) t_2 = Float64(Float64(x + -1.0) / Float64(x + 1.0)) tmp = 0.0 if (t_m <= 1e-211) tmp = Float64(Float64(t_m * sqrt(Float64(x * 0.5))) / Float64(l_m / sqrt(2.0))); elseif (t_m <= 2.4e-177) tmp = 1.0; elseif (t_m <= 3.2e+55) tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(2.0 * Float64((l_m ^ 2.0) / x)))))); else tmp = sqrt(t_2); 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_] := Block[{t$95$2 = N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1e-211], N[(N[(t$95$m * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.4e-177], 1.0, If[LessEqual[t$95$m, 3.2e+55], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{x + -1}{x + 1}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 10^{-211}:\\
\;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\
\mathbf{elif}\;t_m \leq 2.4 \cdot 10^{-177}:\\
\;\;\;\;1\\
\mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t_2}\\
\end{array}
\end{array}
\end{array}
if t < 1.00000000000000009e-211Initial program 34.8%
Simplified34.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+7.5%
sub-neg7.5%
metadata-eval7.5%
+-commutative7.5%
sub-neg7.5%
sub-neg7.5%
metadata-eval7.5%
+-commutative7.5%
metadata-eval7.5%
Simplified7.5%
Taylor expanded in x around inf 14.1%
*-commutative14.1%
Simplified14.1%
associate-/l*14.1%
associate-*r/14.1%
Applied egg-rr14.1%
if 1.00000000000000009e-211 < t < 2.3999999999999999e-177Initial program 2.5%
Simplified2.5%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around inf 68.1%
if 2.3999999999999999e-177 < t < 3.2000000000000003e55Initial program 49.5%
Simplified49.7%
Taylor expanded in l around 0 51.0%
fma-def51.0%
associate-/l*57.9%
+-commutative57.9%
sub-neg57.9%
metadata-eval57.9%
+-commutative57.9%
associate--l+64.7%
sub-neg64.7%
metadata-eval64.7%
+-commutative64.7%
sub-neg64.7%
metadata-eval64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in x around inf 86.5%
if 3.2000000000000003e55 < t Initial program 30.9%
Simplified31.0%
Taylor expanded in t around inf 90.8%
+-commutative90.8%
sub-neg90.8%
metadata-eval90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in t around 0 91.3%
Final simplification46.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<=
(/
(* t_m (sqrt 2.0))
(sqrt
(-
(* (/ (+ x 1.0) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
(* l_m l_m))))
2.0)
(sqrt (/ (+ x -1.0) (+ x 1.0)))
(/ t_m (* (/ l_m (sqrt 2.0)) (sqrt (+ (/ 1.0 (+ x -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) {
double tmp;
if (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + (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 (((t_m * sqrt(2.0d0)) / sqrt(((((x + 1.0d0) / (x + (-1.0d0))) * ((l_m * l_m) + (2.0d0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0d0) then
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = t_m / ((l_m / sqrt(2.0d0)) * sqrt(((1.0d0 / (x + (-1.0d0))) + (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 (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = t_m / ((l_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / (x + -1.0)) + (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 ((t_m * math.sqrt(2.0)) / math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = t_m / ((l_m / math.sqrt(2.0)) * math.sqrt(((1.0 / (x + -1.0)) + (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 (Float64(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= 2.0) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); else tmp = Float64(t_m / Float64(Float64(l_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + 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 (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) tmp = sqrt(((x + -1.0) / (x + 1.0))); else tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + (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[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m / N[(N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $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}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_m}{\frac{l_m}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 51.6%
Simplified51.7%
Taylor expanded in t around inf 39.3%
+-commutative39.3%
sub-neg39.3%
metadata-eval39.3%
+-commutative39.3%
Simplified39.3%
Taylor expanded in t around 0 39.5%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 1.1%
Simplified1.1%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+17.3%
sub-neg17.3%
metadata-eval17.3%
+-commutative17.3%
sub-neg17.3%
sub-neg17.3%
metadata-eval17.3%
+-commutative17.3%
metadata-eval17.3%
Simplified17.3%
sqrt-div17.3%
metadata-eval17.3%
associate-/l*17.3%
frac-times17.2%
*-un-lft-identity17.2%
+-commutative17.2%
+-commutative17.2%
+-commutative17.2%
Applied egg-rr17.2%
Taylor expanded in x around inf 38.6%
Final simplification39.2%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) (* (sqrt (* x 0.5)) (/ t_m l_m)))))
(*
t_s
(if (<= t_m 2e-211)
t_2
(if (<= t_m 8e-176)
1.0
(if (<= t_m 5.8e-135)
t_2
(if (<= t_m 2.8e-61)
(+ 1.0 (/ -1.0 x))
(if (<= t_m 1.12e-39) t_2 (sqrt (/ (+ x -1.0) (+ x 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) {
double t_2 = sqrt(2.0) * (sqrt((x * 0.5)) * (t_m / l_m));
double tmp;
if (t_m <= 2e-211) {
tmp = t_2;
} else if (t_m <= 8e-176) {
tmp = 1.0;
} else if (t_m <= 5.8e-135) {
tmp = t_2;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = t_2;
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
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) :: t_2
real(8) :: tmp
t_2 = sqrt(2.0d0) * (sqrt((x * 0.5d0)) * (t_m / l_m))
if (t_m <= 2d-211) then
tmp = t_2
else if (t_m <= 8d-176) then
tmp = 1.0d0
else if (t_m <= 5.8d-135) then
tmp = t_2
else if (t_m <= 2.8d-61) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t_m <= 1.12d-39) then
tmp = t_2
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
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 t_2 = Math.sqrt(2.0) * (Math.sqrt((x * 0.5)) * (t_m / l_m));
double tmp;
if (t_m <= 2e-211) {
tmp = t_2;
} else if (t_m <= 8e-176) {
tmp = 1.0;
} else if (t_m <= 5.8e-135) {
tmp = t_2;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = t_2;
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
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): t_2 = math.sqrt(2.0) * (math.sqrt((x * 0.5)) * (t_m / l_m)) tmp = 0 if t_m <= 2e-211: tmp = t_2 elif t_m <= 8e-176: tmp = 1.0 elif t_m <= 5.8e-135: tmp = t_2 elif t_m <= 2.8e-61: tmp = 1.0 + (-1.0 / x) elif t_m <= 1.12e-39: tmp = t_2 else: tmp = math.sqrt(((x + -1.0) / (x + 1.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) t_2 = Float64(sqrt(2.0) * Float64(sqrt(Float64(x * 0.5)) * Float64(t_m / l_m))) tmp = 0.0 if (t_m <= 2e-211) tmp = t_2; elseif (t_m <= 8e-176) tmp = 1.0; elseif (t_m <= 5.8e-135) tmp = t_2; elseif (t_m <= 2.8e-61) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t_m <= 1.12e-39) tmp = t_2; else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); 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) t_2 = sqrt(2.0) * (sqrt((x * 0.5)) * (t_m / l_m)); tmp = 0.0; if (t_m <= 2e-211) tmp = t_2; elseif (t_m <= 8e-176) tmp = 1.0; elseif (t_m <= 5.8e-135) tmp = t_2; elseif (t_m <= 2.8e-61) tmp = 1.0 + (-1.0 / x); elseif (t_m <= 1.12e-39) tmp = t_2; else tmp = sqrt(((x + -1.0) / (x + 1.0))); 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_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2e-211], t$95$2, If[LessEqual[t$95$m, 8e-176], 1.0, If[LessEqual[t$95$m, 5.8e-135], t$95$2, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t_m}{l_m}\right)\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2 \cdot 10^{-211}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_m \leq 8 \cdot 10^{-176}:\\
\;\;\;\;1\\
\mathbf{elif}\;t_m \leq 5.8 \cdot 10^{-135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 2.00000000000000017e-211 or 8e-176 < t < 5.8000000000000004e-135 or 2.8000000000000001e-61 < t < 1.12e-39Initial program 33.0%
Simplified33.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+8.5%
sub-neg8.5%
metadata-eval8.5%
+-commutative8.5%
sub-neg8.5%
sub-neg8.5%
metadata-eval8.5%
+-commutative8.5%
metadata-eval8.5%
Simplified8.5%
Taylor expanded in x around inf 17.7%
*-commutative17.7%
Simplified17.7%
associate-/l*17.7%
*-un-lft-identity17.7%
div-inv17.7%
times-frac17.7%
pow1/217.7%
pow-flip17.8%
metadata-eval17.8%
Applied egg-rr17.8%
associate-*r/17.7%
associate-*l/17.7%
*-lft-identity17.7%
Simplified17.7%
expm1-log1p-u17.0%
expm1-udef6.2%
div-inv6.2%
pow-flip6.2%
metadata-eval6.2%
pow1/26.2%
Applied egg-rr6.2%
expm1-def17.1%
expm1-log1p17.8%
associate-*r*17.8%
*-commutative17.8%
Simplified17.8%
if 2.00000000000000017e-211 < t < 8e-176Initial program 2.5%
Simplified2.5%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around inf 68.1%
if 5.8000000000000004e-135 < t < 2.8000000000000001e-61Initial program 37.8%
Simplified37.8%
Taylor expanded in t around inf 53.6%
+-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
+-commutative53.6%
Simplified53.6%
Taylor expanded in x around inf 53.6%
if 1.12e-39 < t Initial program 42.0%
Simplified42.1%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in t around 0 88.1%
Final simplification43.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (sqrt (* x 0.5))) (t_3 (* t_2 (* t_m (/ (sqrt 2.0) l_m)))))
(*
t_s
(if (<= t_m 2.2e-211)
t_3
(if (<= t_m 2.75e-176)
1.0
(if (<= t_m 4.6e-135)
t_3
(if (<= t_m 2.8e-61)
(+ 1.0 (/ -1.0 x))
(if (<= t_m 1.12e-39)
(* (sqrt 2.0) (* t_2 (/ t_m l_m)))
(sqrt (/ (+ x -1.0) (+ x 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) {
double t_2 = sqrt((x * 0.5));
double t_3 = t_2 * (t_m * (sqrt(2.0) / l_m));
double tmp;
if (t_m <= 2.2e-211) {
tmp = t_3;
} else if (t_m <= 2.75e-176) {
tmp = 1.0;
} else if (t_m <= 4.6e-135) {
tmp = t_3;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_2 = sqrt((x * 0.5d0))
t_3 = t_2 * (t_m * (sqrt(2.0d0) / l_m))
if (t_m <= 2.2d-211) then
tmp = t_3
else if (t_m <= 2.75d-176) then
tmp = 1.0d0
else if (t_m <= 4.6d-135) then
tmp = t_3
else if (t_m <= 2.8d-61) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t_m <= 1.12d-39) then
tmp = sqrt(2.0d0) * (t_2 * (t_m / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
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 t_2 = Math.sqrt((x * 0.5));
double t_3 = t_2 * (t_m * (Math.sqrt(2.0) / l_m));
double tmp;
if (t_m <= 2.2e-211) {
tmp = t_3;
} else if (t_m <= 2.75e-176) {
tmp = 1.0;
} else if (t_m <= 4.6e-135) {
tmp = t_3;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = Math.sqrt(2.0) * (t_2 * (t_m / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
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): t_2 = math.sqrt((x * 0.5)) t_3 = t_2 * (t_m * (math.sqrt(2.0) / l_m)) tmp = 0 if t_m <= 2.2e-211: tmp = t_3 elif t_m <= 2.75e-176: tmp = 1.0 elif t_m <= 4.6e-135: tmp = t_3 elif t_m <= 2.8e-61: tmp = 1.0 + (-1.0 / x) elif t_m <= 1.12e-39: tmp = math.sqrt(2.0) * (t_2 * (t_m / l_m)) else: tmp = math.sqrt(((x + -1.0) / (x + 1.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) t_2 = sqrt(Float64(x * 0.5)) t_3 = Float64(t_2 * Float64(t_m * Float64(sqrt(2.0) / l_m))) tmp = 0.0 if (t_m <= 2.2e-211) tmp = t_3; elseif (t_m <= 2.75e-176) tmp = 1.0; elseif (t_m <= 4.6e-135) tmp = t_3; elseif (t_m <= 2.8e-61) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t_m <= 1.12e-39) tmp = Float64(sqrt(2.0) * Float64(t_2 * Float64(t_m / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); 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) t_2 = sqrt((x * 0.5)); t_3 = t_2 * (t_m * (sqrt(2.0) / l_m)); tmp = 0.0; if (t_m <= 2.2e-211) tmp = t_3; elseif (t_m <= 2.75e-176) tmp = 1.0; elseif (t_m <= 4.6e-135) tmp = t_3; elseif (t_m <= 2.8e-61) tmp = 1.0 + (-1.0 / x); elseif (t_m <= 1.12e-39) tmp = sqrt(2.0) * (t_2 * (t_m / l_m)); else tmp = sqrt(((x + -1.0) / (x + 1.0))); 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_] := Block[{t$95$2 = N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.2e-211], t$95$3, If[LessEqual[t$95$m, 2.75e-176], 1.0, If[LessEqual[t$95$m, 4.6e-135], t$95$3, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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)
\\
\begin{array}{l}
t_2 := \sqrt{x \cdot 0.5}\\
t_3 := t_2 \cdot \left(t_m \cdot \frac{\sqrt{2}}{l_m}\right)\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2.2 \cdot 10^{-211}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;1\\
\mathbf{elif}\;t_m \leq 4.6 \cdot 10^{-135}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 2.19999999999999998e-211 or 2.75e-176 < t < 4.5999999999999998e-135Initial program 33.8%
Simplified33.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+8.3%
sub-neg8.3%
metadata-eval8.3%
+-commutative8.3%
sub-neg8.3%
sub-neg8.3%
metadata-eval8.3%
+-commutative8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x around inf 16.2%
*-commutative16.2%
Simplified16.2%
expm1-log1p-u15.8%
expm1-udef6.2%
*-un-lft-identity6.2%
times-frac6.2%
/-rgt-identity6.2%
Applied egg-rr6.2%
expm1-def15.8%
expm1-log1p16.2%
Simplified16.2%
if 2.19999999999999998e-211 < t < 2.75e-176Initial program 2.5%
Simplified2.5%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around inf 68.1%
if 4.5999999999999998e-135 < t < 2.8000000000000001e-61Initial program 37.8%
Simplified37.8%
Taylor expanded in t around inf 53.6%
+-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
+-commutative53.6%
Simplified53.6%
Taylor expanded in x around inf 53.6%
if 2.8000000000000001e-61 < t < 1.12e-39Initial program 1.2%
Simplified1.2%
Taylor expanded in l around inf 2.0%
*-commutative2.0%
associate--l+15.9%
sub-neg15.9%
metadata-eval15.9%
+-commutative15.9%
sub-neg15.9%
sub-neg15.9%
metadata-eval15.9%
+-commutative15.9%
metadata-eval15.9%
Simplified15.9%
Taylor expanded in x around inf 75.4%
*-commutative75.4%
Simplified75.4%
associate-/l*75.4%
*-un-lft-identity75.4%
div-inv74.7%
times-frac74.4%
pow1/274.4%
pow-flip75.4%
metadata-eval75.4%
Applied egg-rr75.4%
associate-*r/74.6%
associate-*l/74.6%
*-lft-identity74.6%
Simplified74.6%
expm1-log1p-u74.6%
expm1-udef4.4%
div-inv4.4%
pow-flip4.4%
metadata-eval4.4%
pow1/24.4%
Applied egg-rr4.4%
expm1-def75.4%
expm1-log1p75.4%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
if 1.12e-39 < t Initial program 42.0%
Simplified42.1%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in t around 0 88.1%
Final simplification43.7%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (sqrt (* x 0.5))) (t_3 (/ (* t_m t_2) (/ l_m (sqrt 2.0)))))
(*
t_s
(if (<= t_m 1.85e-211)
t_3
(if (<= t_m 1.55e-176)
1.0
(if (<= t_m 3.1e-135)
t_3
(if (<= t_m 2.8e-61)
(+ 1.0 (/ -1.0 x))
(if (<= t_m 1.12e-39)
(* (sqrt 2.0) (* t_2 (/ t_m l_m)))
(sqrt (/ (+ x -1.0) (+ x 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) {
double t_2 = sqrt((x * 0.5));
double t_3 = (t_m * t_2) / (l_m / sqrt(2.0));
double tmp;
if (t_m <= 1.85e-211) {
tmp = t_3;
} else if (t_m <= 1.55e-176) {
tmp = 1.0;
} else if (t_m <= 3.1e-135) {
tmp = t_3;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
} else {
tmp = sqrt(((x + -1.0) / (x + 1.0)));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_2 = sqrt((x * 0.5d0))
t_3 = (t_m * t_2) / (l_m / sqrt(2.0d0))
if (t_m <= 1.85d-211) then
tmp = t_3
else if (t_m <= 1.55d-176) then
tmp = 1.0d0
else if (t_m <= 3.1d-135) then
tmp = t_3
else if (t_m <= 2.8d-61) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t_m <= 1.12d-39) then
tmp = sqrt(2.0d0) * (t_2 * (t_m / l_m))
else
tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
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 t_2 = Math.sqrt((x * 0.5));
double t_3 = (t_m * t_2) / (l_m / Math.sqrt(2.0));
double tmp;
if (t_m <= 1.85e-211) {
tmp = t_3;
} else if (t_m <= 1.55e-176) {
tmp = 1.0;
} else if (t_m <= 3.1e-135) {
tmp = t_3;
} else if (t_m <= 2.8e-61) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.12e-39) {
tmp = Math.sqrt(2.0) * (t_2 * (t_m / l_m));
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
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): t_2 = math.sqrt((x * 0.5)) t_3 = (t_m * t_2) / (l_m / math.sqrt(2.0)) tmp = 0 if t_m <= 1.85e-211: tmp = t_3 elif t_m <= 1.55e-176: tmp = 1.0 elif t_m <= 3.1e-135: tmp = t_3 elif t_m <= 2.8e-61: tmp = 1.0 + (-1.0 / x) elif t_m <= 1.12e-39: tmp = math.sqrt(2.0) * (t_2 * (t_m / l_m)) else: tmp = math.sqrt(((x + -1.0) / (x + 1.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) t_2 = sqrt(Float64(x * 0.5)) t_3 = Float64(Float64(t_m * t_2) / Float64(l_m / sqrt(2.0))) tmp = 0.0 if (t_m <= 1.85e-211) tmp = t_3; elseif (t_m <= 1.55e-176) tmp = 1.0; elseif (t_m <= 3.1e-135) tmp = t_3; elseif (t_m <= 2.8e-61) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t_m <= 1.12e-39) tmp = Float64(sqrt(2.0) * Float64(t_2 * Float64(t_m / l_m))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); 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) t_2 = sqrt((x * 0.5)); t_3 = (t_m * t_2) / (l_m / sqrt(2.0)); tmp = 0.0; if (t_m <= 1.85e-211) tmp = t_3; elseif (t_m <= 1.55e-176) tmp = 1.0; elseif (t_m <= 3.1e-135) tmp = t_3; elseif (t_m <= 2.8e-61) tmp = 1.0 + (-1.0 / x); elseif (t_m <= 1.12e-39) tmp = sqrt(2.0) * (t_2 * (t_m / l_m)); else tmp = sqrt(((x + -1.0) / (x + 1.0))); 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_] := Block[{t$95$2 = N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$m * t$95$2), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.85e-211], t$95$3, If[LessEqual[t$95$m, 1.55e-176], 1.0, If[LessEqual[t$95$m, 3.1e-135], t$95$3, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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)
\\
\begin{array}{l}
t_2 := \sqrt{x \cdot 0.5}\\
t_3 := \frac{t_m \cdot t_2}{\frac{l_m}{\sqrt{2}}}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 1.85 \cdot 10^{-211}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_m \leq 1.55 \cdot 10^{-176}:\\
\;\;\;\;1\\
\mathbf{elif}\;t_m \leq 3.1 \cdot 10^{-135}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
\end{array}
if t < 1.8499999999999999e-211 or 1.54999999999999996e-176 < t < 3.1000000000000001e-135Initial program 33.8%
Simplified33.8%
Taylor expanded in l around inf 1.6%
*-commutative1.6%
associate--l+8.3%
sub-neg8.3%
metadata-eval8.3%
+-commutative8.3%
sub-neg8.3%
sub-neg8.3%
metadata-eval8.3%
+-commutative8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x around inf 16.2%
*-commutative16.2%
Simplified16.2%
associate-/l*16.2%
associate-*r/16.2%
Applied egg-rr16.2%
if 1.8499999999999999e-211 < t < 1.54999999999999996e-176Initial program 2.5%
Simplified2.5%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around inf 68.1%
if 3.1000000000000001e-135 < t < 2.8000000000000001e-61Initial program 37.8%
Simplified37.8%
Taylor expanded in t around inf 53.6%
+-commutative53.6%
sub-neg53.6%
metadata-eval53.6%
+-commutative53.6%
Simplified53.6%
Taylor expanded in x around inf 53.6%
if 2.8000000000000001e-61 < t < 1.12e-39Initial program 1.2%
Simplified1.2%
Taylor expanded in l around inf 2.0%
*-commutative2.0%
associate--l+15.9%
sub-neg15.9%
metadata-eval15.9%
+-commutative15.9%
sub-neg15.9%
sub-neg15.9%
metadata-eval15.9%
+-commutative15.9%
metadata-eval15.9%
Simplified15.9%
Taylor expanded in x around inf 75.4%
*-commutative75.4%
Simplified75.4%
associate-/l*75.4%
*-un-lft-identity75.4%
div-inv74.7%
times-frac74.4%
pow1/274.4%
pow-flip75.4%
metadata-eval75.4%
Applied egg-rr75.4%
associate-*r/74.6%
associate-*l/74.6%
*-lft-identity74.6%
Simplified74.6%
expm1-log1p-u74.6%
expm1-udef4.4%
div-inv4.4%
pow-flip4.4%
metadata-eval4.4%
pow1/24.4%
Applied egg-rr4.4%
expm1-def75.4%
expm1-log1p75.4%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
if 1.12e-39 < t Initial program 42.0%
Simplified42.1%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in t around 0 88.1%
Final simplification43.7%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (sqrt (/ (+ x -1.0) (+ x 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 * sqrt(((x + -1.0) / (x + 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 * sqrt(((x + (-1.0d0)) / (x + 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 * Math.sqrt(((x + -1.0) / (x + 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 * math.sqrt(((x + -1.0) / (x + 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 * sqrt(Float64(Float64(x + -1.0) / Float64(x + 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 * sqrt(((x + -1.0) / (x + 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 * N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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 \sqrt{\frac{x + -1}{x + 1}}
\end{array}
Initial program 35.4%
Simplified35.5%
Taylor expanded in t around inf 35.8%
+-commutative35.8%
sub-neg35.8%
metadata-eval35.8%
+-commutative35.8%
Simplified35.8%
Taylor expanded in t around 0 36.0%
Final simplification36.0%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 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.4%
Simplified35.5%
Taylor expanded in t around inf 35.8%
+-commutative35.8%
sub-neg35.8%
metadata-eval35.8%
+-commutative35.8%
Simplified35.8%
Taylor expanded in x around inf 35.7%
Final simplification35.7%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 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.4%
Simplified35.5%
Taylor expanded in t around inf 35.8%
+-commutative35.8%
sub-neg35.8%
metadata-eval35.8%
+-commutative35.8%
Simplified35.8%
Taylor expanded in x around inf 35.4%
Final simplification35.4%
herbie shell --seed 2024018
(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)))))