Average Error: 43.1 → 9.6
Time: 9.2s
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 := \sqrt{2} \cdot x\\ 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 \cdot \left(-t_2\right)}\\ t_5 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{+39}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -1.58 \cdot 10^{-158}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{-220}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-187}:\\ \;\;\;\;\frac{t_3}{{\left({\left(\mathsf{fma}\left(4, t \cdot \frac{t}{x}, 2 \cdot {\left(\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)\right)}^{2}\right)\right)}^{0.25}\right)}^{2}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-165}:\\ \;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{t_1}, \frac{\ell}{t} \cdot \frac{\ell}{t_1}\right)\right)}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+23}:\\ \;\;\;\;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 (* (sqrt 2.0) x))
        (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 (- t_2))))
        (t_5
         (/
          t_3
          (sqrt (fma 4.0 (/ (* t t) x) (* 2.0 (fma t t (* l (/ l x)))))))))
   (if (<= t -2.6e+39)
     t_4
     (if (<= t -1.58e-158)
       t_5
       (if (<= t -2.95e-220)
         t_4
         (if (<= t 4.5e-187)
           (/
            t_3
            (pow
             (pow
              (fma
               4.0
               (* t (/ t x))
               (* 2.0 (pow (hypot t (/ l (sqrt x))) 2.0)))
              0.25)
             2.0))
           (if (<= t 5.8e-165)
             (/
              t_3
              (fma (sqrt 2.0) t (fma 2.0 (/ t t_1) (* (/ l t) (/ l t_1)))))
             (if (<= t 1.35e+23) 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 = sqrt(2.0) * x;
	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 * -t_2);
	double t_5 = t_3 / sqrt(fma(4.0, ((t * t) / x), (2.0 * fma(t, t, (l * (l / x))))));
	double tmp;
	if (t <= -2.6e+39) {
		tmp = t_4;
	} else if (t <= -1.58e-158) {
		tmp = t_5;
	} else if (t <= -2.95e-220) {
		tmp = t_4;
	} else if (t <= 4.5e-187) {
		tmp = t_3 / pow(pow(fma(4.0, (t * (t / x)), (2.0 * pow(hypot(t, (l / sqrt(x))), 2.0))), 0.25), 2.0);
	} else if (t <= 5.8e-165) {
		tmp = t_3 / fma(sqrt(2.0), t, fma(2.0, (t / t_1), ((l / t) * (l / t_1))));
	} else if (t <= 1.35e+23) {
		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(sqrt(2.0) * x)
	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 * Float64(-t_2)))
	t_5 = Float64(t_3 / sqrt(fma(4.0, Float64(Float64(t * t) / x), Float64(2.0 * fma(t, t, Float64(l * Float64(l / x)))))))
	tmp = 0.0
	if (t <= -2.6e+39)
		tmp = t_4;
	elseif (t <= -1.58e-158)
		tmp = t_5;
	elseif (t <= -2.95e-220)
		tmp = t_4;
	elseif (t <= 4.5e-187)
		tmp = Float64(t_3 / ((fma(4.0, Float64(t * Float64(t / x)), Float64(2.0 * (hypot(t, Float64(l / sqrt(x))) ^ 2.0))) ^ 0.25) ^ 2.0));
	elseif (t <= 5.8e-165)
		tmp = Float64(t_3 / fma(sqrt(2.0), t, fma(2.0, Float64(t / t_1), Float64(Float64(l / t) * Float64(l / t_1)))));
	elseif (t <= 1.35e+23)
		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[(N[Sqrt[2.0], $MachinePrecision] * x), $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 * (-t$95$2)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 / N[Sqrt[N[(4.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+39], t$95$4, If[LessEqual[t, -1.58e-158], t$95$5, If[LessEqual[t, -2.95e-220], t$95$4, If[LessEqual[t, 4.5e-187], N[(t$95$3 / N[Power[N[Power[N[(4.0 * N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-165], N[(t$95$3 / N[(N[Sqrt[2.0], $MachinePrecision] * t + N[(2.0 * N[(t / t$95$1), $MachinePrecision] + N[(N[(l / t), $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+23], 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 := \sqrt{2} \cdot x\\
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 \cdot \left(-t_2\right)}\\
t_5 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq -1.58 \cdot 10^{-158}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t \leq -2.95 \cdot 10^{-220}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-187}:\\
\;\;\;\;\frac{t_3}{{\left({\left(\mathsf{fma}\left(4, t \cdot \frac{t}{x}, 2 \cdot {\left(\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)\right)}^{2}\right)\right)}^{0.25}\right)}^{2}}\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-165}:\\
\;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{t_1}, \frac{\ell}{t} \cdot \frac{\ell}{t_1}\right)\right)}\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+23}:\\
\;\;\;\;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 5 regimes
  2. if t < -2.6e39 or -1.57999999999999994e-158 < t < -2.9499999999999998e-220

    1. Initial program 46.9

      \[\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. Simplified46.9

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

      \[\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)}} \]
    4. Simplified8.4

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

    if -2.6e39 < t < -1.57999999999999994e-158 or 5.8e-165 < t < 1.3499999999999999e23

    1. Initial program 30.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. Simplified30.6

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)\right)}}} \]
    5. Applied egg-rr5.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{{\left({\left(\mathsf{fma}\left(4, \frac{t}{x} \cdot t, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{0.25}\right)}^{2}}} \]
    6. Applied egg-rr5.0

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

    if -2.9499999999999998e-220 < t < 4.4999999999999998e-187

    1. Initial program 62.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. Simplified62.8

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{{\left({\left(\mathsf{fma}\left(4, \frac{t}{x} \cdot t, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{0.25}\right)}^{2}}} \]
    6. Applied egg-rr31.9

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

    if 4.4999999999999998e-187 < t < 5.8e-165

    1. Initial program 63.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}} \]
    2. Simplified63.2

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

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

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

      \[\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)}} \]
    6. Simplified17.9

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

    if 1.3499999999999999e23 < t

    1. Initial program 41.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. Simplified41.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+39}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \left(-\sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\right)}\\ \mathbf{elif}\;t \leq -1.58 \cdot 10^{-158}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{-220}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \left(-\sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\right)}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-187}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{{\left({\left(\mathsf{fma}\left(4, t \cdot \frac{t}{x}, 2 \cdot {\left(\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)\right)}^{2}\right)\right)}^{0.25}\right)}^{2}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-165}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{t} \cdot \frac{\ell}{\sqrt{2} \cdot x}\right)\right)}\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+23}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \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 2022160 
(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)))))