Average Error: 42.8 → 12.5
Time: 9.6s
Precision: binary64
\[\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 := t \cdot \sqrt{2}\\ t_2 := \frac{\left|t_1\right|}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}\right)\right)}\\ \mathbf{if}\;\ell \leq 8.858220110000705 \cdot 10^{+168}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\ell \leq 3.3598491021846746 \cdot 10^{+245}:\\ \;\;\;\;\frac{t_1}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{{x}^{3}} + \frac{2}{x \cdot x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
(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 (* t (sqrt 2.0)))
        (t_2
         (/
          (fabs t_1)
          (fma
           t
           (sqrt 2.0)
           (fma
            2.0
            (/ t (* (sqrt 2.0) x))
            (/ l (/ (* (sqrt 2.0) (* t x)) l)))))))
   (if (<= l 8.858220110000705e+168)
     t_2
     (if (<= l 3.3598491021846746e+245)
       (/
        t_1
        (* l (sqrt (+ (/ 2.0 x) (+ (/ 2.0 (pow x 3.0)) (/ 2.0 (* x x)))))))
       t_2))))
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 = t * sqrt(2.0);
	double t_2 = fabs(t_1) / fma(t, sqrt(2.0), fma(2.0, (t / (sqrt(2.0) * x)), (l / ((sqrt(2.0) * (t * x)) / l))));
	double tmp;
	if (l <= 8.858220110000705e+168) {
		tmp = t_2;
	} else if (l <= 3.3598491021846746e+245) {
		tmp = t_1 / (l * sqrt(((2.0 / x) + ((2.0 / pow(x, 3.0)) + (2.0 / (x * x))))));
	} else {
		tmp = t_2;
	}
	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 = Float64(t * sqrt(2.0))
	t_2 = Float64(abs(t_1) / fma(t, sqrt(2.0), fma(2.0, Float64(t / Float64(sqrt(2.0) * x)), Float64(l / Float64(Float64(sqrt(2.0) * Float64(t * x)) / l)))))
	tmp = 0.0
	if (l <= 8.858220110000705e+168)
		tmp = t_2;
	elseif (l <= 3.3598491021846746e+245)
		tmp = Float64(t_1 / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / (x ^ 3.0)) + Float64(2.0 / Float64(x * x)))))));
	else
		tmp = t_2;
	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[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[t$95$1], $MachinePrecision] / N[(t * N[Sqrt[2.0], $MachinePrecision] + N[(2.0 * N[(t / N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(l / N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 8.858220110000705e+168], t$95$2, If[LessEqual[l, 3.3598491021846746e+245], N[(t$95$1 / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\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 := t \cdot \sqrt{2}\\
t_2 := \frac{\left|t_1\right|}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}\right)\right)}\\
\mathbf{if}\;\ell \leq 8.858220110000705 \cdot 10^{+168}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;\ell \leq 3.3598491021846746 \cdot 10^{+245}:\\
\;\;\;\;\frac{t_1}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{{x}^{3}} + \frac{2}{x \cdot x}\right)}}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 2 regimes
  2. if l < 8.85822011000070548e168 or 3.3598491021846746e245 < l

    1. Initial program 41.6

      \[\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}} \]
    2. Taylor expanded in x around inf 30.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{2}} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{3}} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 2 \cdot {t}^{2}\right)\right)\right)\right)\right)}}} \]
    3. Simplified30.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(4, \frac{t \cdot t}{x \cdot x}, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \mathsf{fma}\left(4, \frac{t \cdot t}{{x}^{3}}, \mathsf{fma}\left(2, \frac{\ell \cdot \ell}{x \cdot x}, \mathsf{fma}\left(2, \frac{\ell \cdot \ell}{{x}^{3}}, 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)\right)\right)\right)\right)\right)}}} \]
    4. Taylor expanded in x around inf 37.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{{\ell}^{2}}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}} \]
    5. Simplified35.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{x \cdot \sqrt{2}}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(x \cdot t\right)}{\ell}}\right)\right)}} \]
    6. Applied egg-rr11.8

      \[\leadsto \frac{\color{blue}{\left|t \cdot \sqrt{2}\right|}}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{x \cdot \sqrt{2}}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(x \cdot t\right)}{\ell}}\right)\right)} \]

    if 8.85822011000070548e168 < l < 3.3598491021846746e245

    1. Initial program 64.0

      \[\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}} \]
    2. Taylor expanded in x around inf 57.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{2}} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{3}} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 2 \cdot {t}^{2}\right)\right)\right)\right)\right)}}} \]
    3. Simplified57.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(4, \frac{t \cdot t}{x \cdot x}, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \mathsf{fma}\left(4, \frac{t \cdot t}{{x}^{3}}, \mathsf{fma}\left(2, \frac{\ell \cdot \ell}{x \cdot x}, \mathsf{fma}\left(2, \frac{\ell \cdot \ell}{{x}^{3}}, 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)\right)\right)\right)\right)\right)}}} \]
    4. Taylor expanded in l around inf 25.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\ell \cdot \sqrt{2 \cdot \frac{1}{x} + \left(2 \cdot \frac{1}{{x}^{3}} + 2 \cdot \frac{1}{{x}^{2}}\right)}}} \]
    5. Simplified25.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{{x}^{3}} + \frac{2}{x \cdot x}\right)}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification12.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 8.858220110000705 \cdot 10^{+168}:\\ \;\;\;\;\frac{\left|t \cdot \sqrt{2}\right|}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 3.3598491021846746 \cdot 10^{+245}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{{x}^{3}} + \frac{2}{x \cdot x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|t \cdot \sqrt{2}\right|}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}\right)\right)}\\ \end{array} \]

Reproduce

herbie shell --seed 2022150 
(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)))))