(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)))))
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
(if (<= t -4.2e-256)
(- t_1)
(if (<= t 5.8e-248)
(expm1
(log1p
(*
t
(/
(sqrt 2.0)
(sqrt
(fma
(/ (+ x 1.0) (+ -1.0 x))
(fma 2.0 (* t t) (* l l))
(* l l)))))))
t_1))))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)));
}
double code(double x, double l, double t) {
double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
double tmp;
if (t <= -4.2e-256) {
tmp = -t_1;
} else if (t <= 5.8e-248) {
tmp = expm1(log1p((t * (sqrt(2.0) / sqrt(fma(((x + 1.0) / (-1.0 + x)), fma(2.0, (t * t), (l * l)), (l * l)))))));
} else {
tmp = t_1;
}
return tmp;
}
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 code(x, l, t) t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4.2e-256) tmp = Float64(-t_1); elseif (t <= 5.8e-248) tmp = expm1(log1p(Float64(t * Float64(sqrt(2.0) / sqrt(fma(Float64(Float64(x + 1.0) / Float64(-1.0 + x)), fma(2.0, Float64(t * t), Float64(l * l)), Float64(l * l))))))); else tmp = t_1; end return tmp 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]
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.2e-256], (-t$95$1), If[LessEqual[t, 5.8e-248], N[(Exp[N[Log[1 + N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision], t$95$1]]]
\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}}
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{-256}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-248}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{-1 + x}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \ell\right)}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -4.20000000000000005e-256Initial program 41.7
Simplified41.7
Taylor expanded in t around inf 62.9
Applied egg-rr35.9
Taylor expanded in t around -inf 13.0
Simplified13.0
if -4.20000000000000005e-256 < t < 5.8000000000000002e-248Initial program 63.0
Simplified63.0
Applied egg-rr44.8
if 5.8000000000000002e-248 < t Initial program 41.4
Simplified41.4
Taylor expanded in t around inf 11.7
Taylor expanded in t around 0 11.7
Final simplification14.6
herbie shell --seed 2022178
(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)))))