
(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 8 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}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (/ (pow l 2.0) x))
(t_3 (+ 2.0 (/ 4.0 x)))
(t_4 (* 2.0 (pow t_m 2.0))))
(*
t_s
(if (<= t_m 7.8e-172)
(*
t_m
(/
(sqrt 2.0)
(fma
0.5
(* (/ (* 2.0 t_2) t_m) (sqrt (/ 1.0 t_3)))
(* t_m (sqrt t_3)))))
(if (<= t_m 6.5e+68)
(*
t_m
(/
(sqrt 2.0)
(sqrt
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 t_4))
(/ (+ (pow l 2.0) t_4) x)))))
(+ 1.0 (/ -1.0 x)))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = pow(l, 2.0) / x;
double t_3 = 2.0 + (4.0 / x);
double t_4 = 2.0 * pow(t_m, 2.0);
double tmp;
if (t_m <= 7.8e-172) {
tmp = t_m * (sqrt(2.0) / fma(0.5, (((2.0 * t_2) / t_m) * sqrt((1.0 / t_3))), (t_m * sqrt(t_3))));
} else if (t_m <= 6.5e+68) {
tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + t_4)) + ((pow(l, 2.0) + t_4) / x))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64((l ^ 2.0) / x) t_3 = Float64(2.0 + Float64(4.0 / x)) t_4 = Float64(2.0 * (t_m ^ 2.0)) tmp = 0.0 if (t_m <= 7.8e-172) tmp = Float64(t_m * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(Float64(2.0 * t_2) / t_m) * sqrt(Float64(1.0 / t_3))), Float64(t_m * sqrt(t_3))))); elseif (t_m <= 6.5e+68) tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + t_4)) + Float64(Float64((l ^ 2.0) + t_4) / x))))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return Float64(t_s * tmp) end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 7.8e-172], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(N[(2.0 * t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.5e+68], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[l, 2.0], $MachinePrecision] + t$95$4), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{{\ell}^{2}}{x}\\
t_3 := 2 + \frac{4}{x}\\
t_4 := 2 \cdot {t_m}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 7.8 \cdot 10^{-172}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{2 \cdot t_2}{t_m} \cdot \sqrt{\frac{1}{t_3}}, t_m \cdot \sqrt{t_3}\right)}\\
\mathbf{elif}\;t_m \leq 6.5 \cdot 10^{+68}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t_m}^{2}}{x} + \left(t_2 + t_4\right)\right) + \frac{{\ell}^{2} + t_4}{x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
\end{array}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (/ (pow l 2.0) x)) (t_3 (+ 2.0 (/ 4.0 x))))
(*
t_s
(if (<= t_m 7.8e-171)
(*
t_m
(/
(sqrt 2.0)
(fma
0.5
(* (/ (* 2.0 t_2) t_m) (sqrt (/ 1.0 t_3)))
(* t_m (sqrt t_3)))))
(if (<= t_m 1.4e+74)
(*
t_m
(/
(sqrt 2.0)
(sqrt
(+
t_2
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (* 2.0 (pow t_m 2.0))))))))
(+ 1.0 (/ -1.0 x)))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = pow(l, 2.0) / x;
double t_3 = 2.0 + (4.0 / x);
double tmp;
if (t_m <= 7.8e-171) {
tmp = t_m * (sqrt(2.0) / fma(0.5, (((2.0 * t_2) / t_m) * sqrt((1.0 / t_3))), (t_m * sqrt(t_3))));
} else if (t_m <= 1.4e+74) {
tmp = t_m * (sqrt(2.0) / sqrt((t_2 + ((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (2.0 * pow(t_m, 2.0)))))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64((l ^ 2.0) / x) t_3 = Float64(2.0 + Float64(4.0 / x)) tmp = 0.0 if (t_m <= 7.8e-171) tmp = Float64(t_m * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(Float64(2.0 * t_2) / t_m) * sqrt(Float64(1.0 / t_3))), Float64(t_m * sqrt(t_3))))); elseif (t_m <= 1.4e+74) tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64(2.0 * (t_m ^ 2.0)))))))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return Float64(t_s * tmp) end
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_, t$95$m_] := Block[{t$95$2 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 7.8e-171], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(N[(2.0 * t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.4e+74], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{{\ell}^{2}}{x}\\
t_3 := 2 + \frac{4}{x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 7.8 \cdot 10^{-171}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{2 \cdot t_2}{t_m} \cdot \sqrt{\frac{1}{t_3}}, t_m \cdot \sqrt{t_3}\right)}\\
\mathbf{elif}\;t_m \leq 1.4 \cdot 10^{+74}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(2 \cdot \frac{{t_m}^{2}}{x} + \left(t_2 + 2 \cdot {t_m}^{2}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
\end{array}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(let* ((t_2 (+ 2.0 (/ 4.0 x))))
(*
t_s
(if (<= t_m 880.0)
(*
t_m
(/
(sqrt 2.0)
(fma
0.5
(* (/ (* 2.0 (/ (pow l 2.0) x)) t_m) (sqrt (/ 1.0 t_2)))
(* t_m (sqrt t_2)))))
(+ 1.0 (/ -1.0 x))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double t_2 = 2.0 + (4.0 / x);
double tmp;
if (t_m <= 880.0) {
tmp = t_m * (sqrt(2.0) / fma(0.5, (((2.0 * (pow(l, 2.0) / x)) / t_m) * sqrt((1.0 / t_2))), (t_m * sqrt(t_2))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return t_s * tmp;
}
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) t_2 = Float64(2.0 + Float64(4.0 / x)) tmp = 0.0 if (t_m <= 880.0) tmp = Float64(t_m * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(Float64(2.0 * Float64((l ^ 2.0) / x)) / t_m) * sqrt(Float64(1.0 / t_2))), Float64(t_m * sqrt(t_2))))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return Float64(t_s * tmp) end
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_, t$95$m_] := Block[{t$95$2 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 880.0], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := 2 + \frac{4}{x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 880:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{2 \cdot \frac{{\ell}^{2}}{x}}{t_m} \cdot \sqrt{\frac{1}{t_2}}, t_m \cdot \sqrt{t_2}\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
\end{array}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= (* l l) 1e+277)
(+ 1.0 (/ -1.0 x))
(* (sqrt 2.0) (/ t_m (* l (sqrt (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))))))))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if ((l * l) <= 1e+277) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = sqrt(2.0) * (t_m / (l * sqrt(((1.0 / x) + (1.0 / (x + -1.0))))));
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if ((l * l) <= 1d+277) then
tmp = 1.0d0 + ((-1.0d0) / x)
else
tmp = sqrt(2.0d0) * (t_m / (l * sqrt(((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))))))
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if ((l * l) <= 1e+277) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = Math.sqrt(2.0) * (t_m / (l * Math.sqrt(((1.0 / x) + (1.0 / (x + -1.0))))));
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if (l * l) <= 1e+277: tmp = 1.0 + (-1.0 / x) else: tmp = math.sqrt(2.0) * (t_m / (l * math.sqrt(((1.0 / x) + (1.0 / (x + -1.0)))))) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (Float64(l * l) <= 1e+277) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l * sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))))))); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if ((l * l) <= 1e+277) tmp = 1.0 + (-1.0 / x); else tmp = sqrt(2.0) * (t_m / (l * sqrt(((1.0 / x) + (1.0 / (x + -1.0)))))); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 1e+277], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{+277}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t_m}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\
\end{array}
\end{array}
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l t_m)
:precision binary64
(*
t_s
(if (<= l 1.08e+142)
(+ 1.0 (/ -1.0 x))
(if (or (<= l 9.5e+217) (not (<= l 5.5e+254)))
(* t_m (/ (sqrt x) l))
1.0))))t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 1.08e+142) {
tmp = 1.0 + (-1.0 / x);
} else if ((l <= 9.5e+217) || !(l <= 5.5e+254)) {
tmp = t_m * (sqrt(x) / l);
} else {
tmp = 1.0;
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (l <= 1.08d+142) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if ((l <= 9.5d+217) .or. (.not. (l <= 5.5d+254))) then
tmp = t_m * (sqrt(x) / l)
else
tmp = 1.0d0
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (l <= 1.08e+142) {
tmp = 1.0 + (-1.0 / x);
} else if ((l <= 9.5e+217) || !(l <= 5.5e+254)) {
tmp = t_m * (Math.sqrt(x) / l);
} else {
tmp = 1.0;
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if l <= 1.08e+142: tmp = 1.0 + (-1.0 / x) elif (l <= 9.5e+217) or not (l <= 5.5e+254): tmp = t_m * (math.sqrt(x) / l) else: tmp = 1.0 return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (l <= 1.08e+142) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif ((l <= 9.5e+217) || !(l <= 5.5e+254)) tmp = Float64(t_m * Float64(sqrt(x) / l)); else tmp = 1.0; end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (l <= 1.08e+142) tmp = 1.0 + (-1.0 / x); elseif ((l <= 9.5e+217) || ~((l <= 5.5e+254))) tmp = t_m * (sqrt(x) / l); else tmp = 1.0; end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[l, 1.08e+142], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 9.5e+217], N[Not[LessEqual[l, 5.5e+254]], $MachinePrecision]], N[(t$95$m * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 1.0]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.08 \cdot 10^{+142}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+217} \lor \neg \left(\ell \leq 5.5 \cdot 10^{+254}\right):\\
\;\;\;\;t_m \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (if (<= t_m 5e-241) (* (sqrt x) (/ t_m l)) (+ 1.0 (/ -1.0 x)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 5e-241) {
tmp = sqrt(x) * (t_m / l);
} else {
tmp = 1.0 + (-1.0 / x);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 5d-241) then
tmp = sqrt(x) * (t_m / l)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
double tmp;
if (t_m <= 5e-241) {
tmp = Math.sqrt(x) * (t_m / l);
} else {
tmp = 1.0 + (-1.0 / x);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): tmp = 0 if t_m <= 5e-241: tmp = math.sqrt(x) * (t_m / l) else: tmp = 1.0 + (-1.0 / x) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) tmp = 0.0 if (t_m <= 5e-241) tmp = Float64(sqrt(x) * Float64(t_m / l)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return Float64(t_s * tmp) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l, t_m) tmp = 0.0; if (t_m <= 5e-241) tmp = sqrt(x) * (t_m / l); else tmp = 1.0 + (-1.0 / x); end tmp_2 = t_s * tmp; end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 5e-241], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 5 \cdot 10^{-241}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t_m}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * (1.0 + (-1.0 / x))
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * Float64(1.0 + Float64(-1.0 / x))) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * (1.0 + (-1.0 / x)); end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) (FPCore (t_s x l t_m) :precision binary64 (* t_s 1.0))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
return t_s * 1.0;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) def code(t_s, x, l, t_m): return t_s * 1.0
t_m = abs(t) t_s = copysign(1.0, t) function code(t_s, x, l, t_m) return Float64(t_s * 1.0) end
t_m = abs(t); t_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l, t_m) tmp = t_s * 1.0; end
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_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
t_s \cdot 1
\end{array}
herbie shell --seed 2023350
(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)))))