Average Error: 43.0 → 9.0
Time: 12.8s
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 := \frac{\ell}{\frac{x}{\ell}}\\ t_2 := \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\\ t_3 := t \cdot \sqrt{2}\\ t_4 := \frac{t_3}{t_2 \cdot \left(-t\right)}\\ t_5 := \frac{t_3}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(\left(t \cdot t + t_1\right) + \frac{t_1}{x}\right)\right)\right)}}\right)}^{2}}\\ \mathbf{if}\;t \leq -1.571665268792021 \cdot 10^{+71}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -1.0337511219279627 \cdot 10^{-137}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t \leq -3.555419331691467 \cdot 10^{-260}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 2.2762156236312662 \cdot 10^{+86}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;\frac{t_3}{t \cdot 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 (/ l (/ x l)))
        (t_2 (sqrt (+ (/ 2.0 (+ x -1.0)) (* 2.0 (/ x (+ x -1.0))))))
        (t_3 (* t (sqrt 2.0)))
        (t_4 (/ t_3 (* t_2 (- t))))
        (t_5
         (/
          t_3
          (pow
           (sqrt
            (sqrt
             (fma
              4.0
              (pow (/ t x) 2.0)
              (fma (/ (* t t) x) 4.0 (* 2.0 (+ (+ (* t t) t_1) (/ t_1 x)))))))
           2.0))))
   (if (<= t -1.571665268792021e+71)
     t_4
     (if (<= t -1.0337511219279627e-137)
       t_5
       (if (<= t -3.555419331691467e-260)
         t_4
         (if (<= t 2.2762156236312662e+86) t_5 (/ t_3 (* t 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 = l / (x / l);
	double t_2 = sqrt(((2.0 / (x + -1.0)) + (2.0 * (x / (x + -1.0)))));
	double t_3 = t * sqrt(2.0);
	double t_4 = t_3 / (t_2 * -t);
	double t_5 = t_3 / pow(sqrt(sqrt(fma(4.0, pow((t / x), 2.0), fma(((t * t) / x), 4.0, (2.0 * (((t * t) + t_1) + (t_1 / x))))))), 2.0);
	double tmp;
	if (t <= -1.571665268792021e+71) {
		tmp = t_4;
	} else if (t <= -1.0337511219279627e-137) {
		tmp = t_5;
	} else if (t <= -3.555419331691467e-260) {
		tmp = t_4;
	} else if (t <= 2.2762156236312662e+86) {
		tmp = t_5;
	} else {
		tmp = t_3 / (t * 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(l / Float64(x / l))
	t_2 = sqrt(Float64(Float64(2.0 / Float64(x + -1.0)) + Float64(2.0 * Float64(x / Float64(x + -1.0)))))
	t_3 = Float64(t * sqrt(2.0))
	t_4 = Float64(t_3 / Float64(t_2 * Float64(-t)))
	t_5 = Float64(t_3 / (sqrt(sqrt(fma(4.0, (Float64(t / x) ^ 2.0), fma(Float64(Float64(t * t) / x), 4.0, Float64(2.0 * Float64(Float64(Float64(t * t) + t_1) + Float64(t_1 / x))))))) ^ 2.0))
	tmp = 0.0
	if (t <= -1.571665268792021e+71)
		tmp = t_4;
	elseif (t <= -1.0337511219279627e-137)
		tmp = t_5;
	elseif (t <= -3.555419331691467e-260)
		tmp = t_4;
	elseif (t <= 2.2762156236312662e+86)
		tmp = t_5;
	else
		tmp = Float64(t_3 / Float64(t * 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[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(2.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[(t$95$2 * (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 / N[Power[N[Sqrt[N[Sqrt[N[(4.0 * N[Power[N[(t / x), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] * 4.0 + N[(2.0 * N[(N[(N[(t * t), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.571665268792021e+71], t$95$4, If[LessEqual[t, -1.0337511219279627e-137], t$95$5, If[LessEqual[t, -3.555419331691467e-260], t$95$4, If[LessEqual[t, 2.2762156236312662e+86], t$95$5, N[(t$95$3 / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\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 := \frac{\ell}{\frac{x}{\ell}}\\
t_2 := \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\\
t_3 := t \cdot \sqrt{2}\\
t_4 := \frac{t_3}{t_2 \cdot \left(-t\right)}\\
t_5 := \frac{t_3}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(\left(t \cdot t + t_1\right) + \frac{t_1}{x}\right)\right)\right)}}\right)}^{2}}\\
\mathbf{if}\;t \leq -1.571665268792021 \cdot 10^{+71}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq -1.0337511219279627 \cdot 10^{-137}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t \leq -3.555419331691467 \cdot 10^{-260}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq 2.2762156236312662 \cdot 10^{+86}:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;\frac{t_3}{t \cdot t_2}\\


\end{array}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.57166526879202102e71 or -1.03375112192796272e-137 < t < -3.55541933169146715e-260

    1. Initial program 49.8

      \[\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 t around -inf 10.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-1 \cdot \left(\sqrt{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}} \cdot t\right)}} \]
    3. Simplified10.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-t \cdot \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}}} \]

    if -1.57166526879202102e71 < t < -1.03375112192796272e-137 or -3.55541933169146715e-260 < t < 2.2762156236312662e86

    1. Initial program 35.7

      \[\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 16.7

      \[\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. Simplified16.7

      \[\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. Applied egg-rr16.8

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \color{blue}{4 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{2}} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 2 \cdot {t}^{2}\right)\right)}\right)}}\right)}^{2}} \]
    6. Simplified10.7

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

    if 2.2762156236312662e86 < t

    1. Initial program 49.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 t around inf 2.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\sqrt{2 \cdot \frac{1}{x - 1} + 2 \cdot \frac{x}{x - 1}} \cdot t}} \]
    3. Simplified2.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.571665268792021 \cdot 10^{+71}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}} \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -1.0337511219279627 \cdot 10^{-137}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right) + \frac{\frac{\ell}{\frac{x}{\ell}}}{x}\right)\right)\right)}}\right)}^{2}}\\ \mathbf{elif}\;t \leq -3.555419331691467 \cdot 10^{-260}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}} \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq 2.2762156236312662 \cdot 10^{+86}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right) + \frac{\frac{\ell}{\frac{x}{\ell}}}{x}\right)\right)\right)}}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}}\\ \end{array} \]

Reproduce

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