Toniolo and Linder, Equation (7)

Percentage Accurate: 32.8% → 84.4%
Time: 21.1s
Alternatives: 9
Speedup: 75.0×

Specification

?
\[\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} \]
(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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 32.8% accurate, 1.0× speedup?

\[\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} \]
(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}

Alternative 1: 84.4% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 + \frac{4}{x}\\ t_2 := \sqrt{\frac{x + 1}{x + -1}}\\ t_3 := 2 \cdot {t}^{2}\\ t_4 := {\ell}^{2} + t_3\\ t_5 := \frac{{\ell}^{2}}{x}\\ \mathbf{if}\;t \leq -1.62 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_5\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-258}:\\ \;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_5\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_5 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot t_2}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (+ 2.0 (/ 4.0 x)))
        (t_2 (sqrt (/ (+ x 1.0) (+ x -1.0))))
        (t_3 (* 2.0 (pow t 2.0)))
        (t_4 (+ (pow l 2.0) t_3))
        (t_5 (/ (pow l 2.0) x)))
   (if (<= t -1.62e+44)
     (/ t (* (- t) t_2))
     (if (<= t -1.4e-157)
       (/
        t
        (/
         (sqrt
          (+
           (+ (* 2.0 (* t (+ t (/ t x)))) t_5)
           (/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
         (sqrt 2.0)))
       (if (<= t -3.5e-258)
         (/
          t
          (/
           (-
            (* (/ (* -0.5 (* 2.0 t_5)) t) (sqrt (/ 1.0 t_1)))
            (* t (sqrt t_1)))
           (sqrt 2.0)))
         (if (<= t 2.1e-227)
           (/ (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) (/ 1.0 t)) l)
           (if (<= t 1.4e+38)
             (/
              t
              (/
               (sqrt
                (+
                 (+
                  (/ (+ t_4 t_4) (pow x 2.0))
                  (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_5 t_3)))
                 (/ t_4 x)))
               (sqrt 2.0)))
             (/ t (* t t_2)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 + (4.0 / x);
	double t_2 = sqrt(((x + 1.0) / (x + -1.0)));
	double t_3 = 2.0 * pow(t, 2.0);
	double t_4 = pow(l, 2.0) + t_3;
	double t_5 = pow(l, 2.0) / x;
	double tmp;
	if (t <= -1.62e+44) {
		tmp = t / (-t * t_2);
	} else if (t <= -1.4e-157) {
		tmp = t / (sqrt((((2.0 * (t * (t + (t / x)))) + t_5) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
	} else if (t <= -3.5e-258) {
		tmp = t / (((((-0.5 * (2.0 * t_5)) / t) * sqrt((1.0 / t_1))) - (t * sqrt(t_1))) / sqrt(2.0));
	} else if (t <= 2.1e-227) {
		tmp = (sqrt((2.0 * fma(0.5, x, -0.5))) / (1.0 / t)) / l;
	} else if (t <= 1.4e+38) {
		tmp = t / (sqrt(((((t_4 + t_4) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_5 + t_3))) + (t_4 / x))) / sqrt(2.0));
	} else {
		tmp = t / (t * t_2);
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 + Float64(4.0 / x))
	t_2 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))
	t_3 = Float64(2.0 * (t ^ 2.0))
	t_4 = Float64((l ^ 2.0) + t_3)
	t_5 = Float64((l ^ 2.0) / x)
	tmp = 0.0
	if (t <= -1.62e+44)
		tmp = Float64(t / Float64(Float64(-t) * t_2));
	elseif (t <= -1.4e-157)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + t_5) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0)));
	elseif (t <= -3.5e-258)
		tmp = Float64(t / Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(2.0 * t_5)) / t) * sqrt(Float64(1.0 / t_1))) - Float64(t * sqrt(t_1))) / sqrt(2.0)));
	elseif (t <= 2.1e-227)
		tmp = Float64(Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / Float64(1.0 / t)) / l);
	elseif (t <= 1.4e+38)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_4 + t_4) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_5 + t_3))) + Float64(t_4 / x))) / sqrt(2.0)));
	else
		tmp = Float64(t / Float64(t * t_2));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[l, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.62e+44], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.4e-157], N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.5e-258], N[(t / N[(N[(N[(N[(N[(-0.5 * N[(2.0 * t$95$5), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-227], N[(N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.4e+38], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$4 + t$95$4), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \frac{4}{x}\\
t_2 := \sqrt{\frac{x + 1}{x + -1}}\\
t_3 := 2 \cdot {t}^{2}\\
t_4 := {\ell}^{2} + t_3\\
t_5 := \frac{{\ell}^{2}}{x}\\
\mathbf{if}\;t \leq -1.62 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\

\mathbf{elif}\;t \leq -1.4 \cdot 10^{-157}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_5\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq -3.5 \cdot 10^{-258}:\\
\;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_5\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\
\;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_5 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -1.6199999999999999e44

    1. Initial program 36.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. Simplified36.0%

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*96.4%

        \[\leadsto \frac{t}{\color{blue}{\left(-1 \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
      2. neg-mul-196.4%

        \[\leadsto \frac{t}{\color{blue}{\left(-t\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. +-commutative96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      4. sub-neg96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      5. metadata-eval96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      6. +-commutative96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified96.4%

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

    if -1.6199999999999999e44 < t < -1.40000000000000005e-157

    1. Initial program 51.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. Simplified51.9%

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

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u83.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}\right)\right)}}{\sqrt{2}}} \]
      2. expm1-udef36.3%

        \[\leadsto \frac{t}{\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}\right)} - 1}}{\sqrt{2}}} \]
    5. Applied egg-rr36.3%

      \[\leadsto \frac{t}{\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}\right)} - 1}}{\sqrt{2}}} \]
    6. Step-by-step derivation
      1. expm1-def83.2%

        \[\leadsto \frac{t}{\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}\right)\right)}}{\sqrt{2}}} \]
      2. expm1-log1p84.8%

        \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}}{\sqrt{2}}} \]
      3. fma-udef84.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \color{blue}{\left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      5. associate-+r+84.8%

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \frac{{\ell}^{2}}{x}\right)} + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      6. distribute-lft-out84.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      8. associate-*r/84.8%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \frac{t}{x} + \color{blue}{t \cdot t}\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      10. distribute-lft-out84.8%

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

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

    if -1.40000000000000005e-157 < t < -3.50000000000000001e-258

    1. Initial program 2.4%

      \[\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. Simplified2.4%

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

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    4. Taylor expanded in t around -inf 65.2%

      \[\leadsto \frac{t}{\frac{\color{blue}{-1 \cdot \left(t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}\right) + -0.5 \cdot \left(\frac{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}{t} \cdot \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}}\right)}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. +-commutative65.2%

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

        \[\leadsto \frac{t}{\frac{-0.5 \cdot \left(\frac{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}{t} \cdot \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}}\right) + \color{blue}{\left(-t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}\right)}}{\sqrt{2}}} \]
      3. unsub-neg65.2%

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

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

    if -3.50000000000000001e-258 < t < 2.1e-227

    1. Initial program 1.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. Simplified1.7%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 0.8%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \]
    4. Step-by-step derivation
      1. *-commutative0.8%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t}{\ell}\right)} \]
      2. associate--l+36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t}{\ell}\right) \]
      3. sub-neg36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      4. metadata-eval36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      5. +-commutative36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      6. sub-neg36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      7. metadata-eval36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      8. +-commutative36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
    5. Simplified36.5%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\ell}\right)} \]
    6. Taylor expanded in x around 0 47.3%

      \[\leadsto \sqrt{2} \cdot \left(\sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\ell}\right) \]
    7. Step-by-step derivation
      1. associate-*r*47.3%

        \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{\ell}} \]
      2. /-rgt-identity47.3%

        \[\leadsto \left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{\color{blue}{\frac{t}{1}}}{\ell} \]
      3. associate-*r/53.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{1}}{\ell}} \]
      4. sqrt-unprod53.5%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \left(0.5 \cdot x - 0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      5. fma-neg53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(0.5, x, -0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      6. metadata-eval53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, \color{blue}{-0.5}\right)} \cdot \frac{t}{1}}{\ell} \]
      7. /-rgt-identity53.5%

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

      \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)} \cdot t}{\ell}} \]
    9. Step-by-step derivation
      1. remove-double-div53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)} \cdot \color{blue}{\frac{1}{\frac{1}{t}}}}{\ell} \]
      2. un-div-inv53.5%

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

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

    if 2.1e-227 < t < 1.4e38

    1. Initial program 36.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. Simplified36.0%

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

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

    if 1.4e38 < t

    1. Initial program 40.3%

      \[\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. Simplified40.3%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative98.6%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg98.6%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative98.6%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-258}:\\ \;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot \frac{{\ell}^{2}}{x}\right)}{t} \cdot \sqrt{\frac{1}{2 + \frac{4}{x}}} - t \cdot \sqrt{2 + \frac{4}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{\left({\ell}^{2} + 2 \cdot {t}^{2}\right) + \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + 2 \cdot {t}^{2}\right)\right)\right) + \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 2: 84.6% accurate, 0.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 + \frac{4}{x}\\ t_2 := \sqrt{\frac{x + 1}{x + -1}}\\ t_3 := \frac{{\ell}^{2}}{x}\\ t_4 := \frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_3\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{if}\;t \leq -7 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-158}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_3\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+39}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot t_2}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (+ 2.0 (/ 4.0 x)))
        (t_2 (sqrt (/ (+ x 1.0) (+ x -1.0))))
        (t_3 (/ (pow l 2.0) x))
        (t_4
         (/
          t
          (/
           (sqrt
            (+
             (+ (* 2.0 (* t (+ t (/ t x)))) t_3)
             (/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
           (sqrt 2.0)))))
   (if (<= t -7e+44)
     (/ t (* (- t) t_2))
     (if (<= t -3.4e-158)
       t_4
       (if (<= t -1.05e-254)
         (/
          t
          (/
           (-
            (* (/ (* -0.5 (* 2.0 t_3)) t) (sqrt (/ 1.0 t_1)))
            (* t (sqrt t_1)))
           (sqrt 2.0)))
         (if (<= t 2.1e-227)
           (/ (/ (sqrt (* 2.0 (fma 0.5 x -0.5))) (/ 1.0 t)) l)
           (if (<= t 1.1e+39) t_4 (/ t (* t t_2)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 + (4.0 / x);
	double t_2 = sqrt(((x + 1.0) / (x + -1.0)));
	double t_3 = pow(l, 2.0) / x;
	double t_4 = t / (sqrt((((2.0 * (t * (t + (t / x)))) + t_3) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
	double tmp;
	if (t <= -7e+44) {
		tmp = t / (-t * t_2);
	} else if (t <= -3.4e-158) {
		tmp = t_4;
	} else if (t <= -1.05e-254) {
		tmp = t / (((((-0.5 * (2.0 * t_3)) / t) * sqrt((1.0 / t_1))) - (t * sqrt(t_1))) / sqrt(2.0));
	} else if (t <= 2.1e-227) {
		tmp = (sqrt((2.0 * fma(0.5, x, -0.5))) / (1.0 / t)) / l;
	} else if (t <= 1.1e+39) {
		tmp = t_4;
	} else {
		tmp = t / (t * t_2);
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 + Float64(4.0 / x))
	t_2 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))
	t_3 = Float64((l ^ 2.0) / x)
	t_4 = Float64(t / Float64(sqrt(Float64(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + t_3) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0)))
	tmp = 0.0
	if (t <= -7e+44)
		tmp = Float64(t / Float64(Float64(-t) * t_2));
	elseif (t <= -3.4e-158)
		tmp = t_4;
	elseif (t <= -1.05e-254)
		tmp = Float64(t / Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(2.0 * t_3)) / t) * sqrt(Float64(1.0 / t_1))) - Float64(t * sqrt(t_1))) / sqrt(2.0)));
	elseif (t <= 2.1e-227)
		tmp = Float64(Float64(sqrt(Float64(2.0 * fma(0.5, x, -0.5))) / Float64(1.0 / t)) / l);
	elseif (t <= 1.1e+39)
		tmp = t_4;
	else
		tmp = Float64(t / Float64(t * t_2));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(t / N[(N[Sqrt[N[(N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+44], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.4e-158], t$95$4, If[LessEqual[t, -1.05e-254], N[(t / N[(N[(N[(N[(N[(-0.5 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-227], N[(N[(N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t, 1.1e+39], t$95$4, N[(t / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \frac{4}{x}\\
t_2 := \sqrt{\frac{x + 1}{x + -1}}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + t_3\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\

\mathbf{elif}\;t \leq -3.4 \cdot 10^{-158}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot t_3\right)}{t} \cdot \sqrt{\frac{1}{t_1}} - t \cdot \sqrt{t_1}}{\sqrt{2}}}\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\
\;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+39}:\\
\;\;\;\;t_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -6.9999999999999998e44

    1. Initial program 36.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. Simplified36.0%

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*96.4%

        \[\leadsto \frac{t}{\color{blue}{\left(-1 \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
      2. neg-mul-196.4%

        \[\leadsto \frac{t}{\color{blue}{\left(-t\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. +-commutative96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      4. sub-neg96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      5. metadata-eval96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      6. +-commutative96.4%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified96.4%

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

    if -6.9999999999999998e44 < t < -3.3999999999999999e-158 or 2.1e-227 < t < 1.1000000000000001e39

    1. Initial program 43.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. Simplified43.7%

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

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u78.9%

        \[\leadsto \frac{t}{\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}\right)\right)}}{\sqrt{2}}} \]
      2. expm1-udef30.7%

        \[\leadsto \frac{t}{\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}\right)} - 1}}{\sqrt{2}}} \]
    5. Applied egg-rr30.7%

      \[\leadsto \frac{t}{\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}\right)} - 1}}{\sqrt{2}}} \]
    6. Step-by-step derivation
      1. expm1-def78.9%

        \[\leadsto \frac{t}{\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}\right)\right)}}{\sqrt{2}}} \]
      2. expm1-log1p80.0%

        \[\leadsto \frac{t}{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{x}, \mathsf{fma}\left(2, {t}^{2}, \frac{{\ell}^{2}}{x}\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}}{\sqrt{2}}} \]
      3. fma-udef80.0%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \color{blue}{\left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      5. associate-+r+80.0%

        \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \frac{{\ell}^{2}}{x}\right)} + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      6. distribute-lft-out80.0%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      8. associate-*r/80.0%

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

        \[\leadsto \frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \frac{t}{x} + \color{blue}{t \cdot t}\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}} \]
      10. distribute-lft-out80.0%

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

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

    if -3.3999999999999999e-158 < t < -1.04999999999999998e-254

    1. Initial program 2.4%

      \[\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. Simplified2.4%

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

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) - -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}}{\sqrt{2}}} \]
    4. Taylor expanded in t around -inf 65.2%

      \[\leadsto \frac{t}{\frac{\color{blue}{-1 \cdot \left(t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}\right) + -0.5 \cdot \left(\frac{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}{t} \cdot \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}}\right)}}{\sqrt{2}}} \]
    5. Step-by-step derivation
      1. +-commutative65.2%

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

        \[\leadsto \frac{t}{\frac{-0.5 \cdot \left(\frac{\frac{{\ell}^{2}}{x} - -1 \cdot \frac{{\ell}^{2}}{x}}{t} \cdot \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}}\right) + \color{blue}{\left(-t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}}\right)}}{\sqrt{2}}} \]
      3. unsub-neg65.2%

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

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

    if -1.04999999999999998e-254 < t < 2.1e-227

    1. Initial program 1.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. Simplified1.7%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 0.8%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \]
    4. Step-by-step derivation
      1. *-commutative0.8%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t}{\ell}\right)} \]
      2. associate--l+36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t}{\ell}\right) \]
      3. sub-neg36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      4. metadata-eval36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      5. +-commutative36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      6. sub-neg36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      7. metadata-eval36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      8. +-commutative36.5%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
    5. Simplified36.5%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\ell}\right)} \]
    6. Taylor expanded in x around 0 47.3%

      \[\leadsto \sqrt{2} \cdot \left(\sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\ell}\right) \]
    7. Step-by-step derivation
      1. associate-*r*47.3%

        \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{\ell}} \]
      2. /-rgt-identity47.3%

        \[\leadsto \left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{\color{blue}{\frac{t}{1}}}{\ell} \]
      3. associate-*r/53.5%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{1}}{\ell}} \]
      4. sqrt-unprod53.5%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \left(0.5 \cdot x - 0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      5. fma-neg53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(0.5, x, -0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      6. metadata-eval53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, \color{blue}{-0.5}\right)} \cdot \frac{t}{1}}{\ell} \]
      7. /-rgt-identity53.5%

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

      \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)} \cdot t}{\ell}} \]
    9. Step-by-step derivation
      1. remove-double-div53.5%

        \[\leadsto \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)} \cdot \color{blue}{\frac{1}{\frac{1}{t}}}}{\ell} \]
      2. un-div-inv53.5%

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

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

    if 1.1000000000000001e39 < t

    1. Initial program 40.3%

      \[\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. Simplified40.3%

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative98.6%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      2. sub-neg98.6%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative98.6%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+44}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-158}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\frac{\frac{-0.5 \cdot \left(2 \cdot \frac{{\ell}^{2}}{x}\right)}{t} \cdot \sqrt{\frac{1}{2 + \frac{4}{x}}} - t \cdot \sqrt{2 + \frac{4}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\frac{1}{t}}}{\ell}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+39}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{{\ell}^{2}}{x}\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 3: 79.9% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + 1}{x + -1}}\\ \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-147}:\\ \;\;\;\;t \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot t_1}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x 1.0) (+ x -1.0)))))
   (if (<= t -4.3e-254)
     (/ t (* (- t) t_1))
     (if (<= t 6.8e-147)
       (* t (/ (sqrt (* 2.0 (fma x 0.5 -0.5))) l))
       (/ t (* t t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + 1.0) / (x + -1.0)));
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / (-t * t_1);
	} else if (t <= 6.8e-147) {
		tmp = t * (sqrt((2.0 * fma(x, 0.5, -0.5))) / l);
	} else {
		tmp = t / (t * t_1);
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))
	tmp = 0.0
	if (t <= -4.3e-254)
		tmp = Float64(t / Float64(Float64(-t) * t_1));
	elseif (t <= 6.8e-147)
		tmp = Float64(t * Float64(sqrt(Float64(2.0 * fma(x, 0.5, -0.5))) / l));
	else
		tmp = Float64(t / Float64(t * t_1));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.3e-254], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-147], N[(t * N[(N[Sqrt[N[(2.0 * N[(x * 0.5 + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-147}:\\
\;\;\;\;t \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}}{\ell}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.2999999999999997e-254

    1. Initial program 35.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. Simplified35.1%

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*81.1%

        \[\leadsto \frac{t}{\color{blue}{\left(-1 \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
      2. neg-mul-181.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      4. sub-neg81.1%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      5. metadata-eval81.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified81.1%

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

    if -4.2999999999999997e-254 < t < 6.79999999999999991e-147

    1. Initial program 4.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}} \]
    2. Simplified4.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 0.9%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \]
    4. Step-by-step derivation
      1. *-commutative0.9%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t}{\ell}\right)} \]
      2. associate--l+35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t}{\ell}\right) \]
      3. sub-neg35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      4. metadata-eval35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      5. +-commutative35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      6. sub-neg35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      7. metadata-eval35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      8. +-commutative35.1%

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\ell}\right)} \]
    6. Taylor expanded in x around 0 46.9%

      \[\leadsto \sqrt{2} \cdot \left(\sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\ell}\right) \]
    7. Step-by-step derivation
      1. expm1-log1p-u46.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{0.5 \cdot x - 0.5} \cdot \frac{t}{\ell}\right)\right)\right)} \]
      2. expm1-udef32.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \left(\sqrt{0.5 \cdot x - 0.5} \cdot \frac{t}{\ell}\right)\right)} - 1} \]
      3. associate-*r*32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{\ell}}\right)} - 1 \]
      4. *-commutative32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{t}{\ell} \cdot \left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right)}\right)} - 1 \]
      5. sqrt-unprod32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\ell} \cdot \color{blue}{\sqrt{2 \cdot \left(0.5 \cdot x - 0.5\right)}}\right)} - 1 \]
      6. fma-neg32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\ell} \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(0.5, x, -0.5\right)}}\right)} - 1 \]
      7. metadata-eval32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{t}{\ell} \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, \color{blue}{-0.5}\right)}\right)} - 1 \]
    8. Applied egg-rr32.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{t}{\ell} \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def46.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{\ell} \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}\right)\right)} \]
      2. expm1-log1p47.0%

        \[\leadsto \color{blue}{\frac{t}{\ell} \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}} \]
      3. associate-*l/51.4%

        \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}} \]
      4. *-commutative51.4%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)} \cdot t}}{\ell} \]
      5. associate-*l/51.4%

        \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell} \cdot t} \]
      6. *-commutative51.4%

        \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}} \]
      7. fma-udef51.4%

        \[\leadsto t \cdot \frac{\sqrt{2 \cdot \color{blue}{\left(0.5 \cdot x + -0.5\right)}}}{\ell} \]
      8. *-commutative51.4%

        \[\leadsto t \cdot \frac{\sqrt{2 \cdot \left(\color{blue}{x \cdot 0.5} + -0.5\right)}}{\ell} \]
      9. fma-def51.4%

        \[\leadsto t \cdot \frac{\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(x, 0.5, -0.5\right)}}}{\ell} \]
    10. Simplified51.4%

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

    if 6.79999999999999991e-147 < 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{t}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}}{\sqrt{2}}}} \]
    3. Taylor expanded in t around inf 87.1%

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-147}:\\ \;\;\;\;t \cdot \frac{\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 4: 79.9% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + 1}{x + -1}}\\ \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-145}:\\ \;\;\;\;\frac{t \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot t_1}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x 1.0) (+ x -1.0)))))
   (if (<= t -4.3e-254)
     (/ t (* (- t) t_1))
     (if (<= t 1.4e-145)
       (/ (* t (sqrt (* 2.0 (fma 0.5 x -0.5)))) l)
       (/ t (* t t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + 1.0) / (x + -1.0)));
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / (-t * t_1);
	} else if (t <= 1.4e-145) {
		tmp = (t * sqrt((2.0 * fma(0.5, x, -0.5)))) / l;
	} else {
		tmp = t / (t * t_1);
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))
	tmp = 0.0
	if (t <= -4.3e-254)
		tmp = Float64(t / Float64(Float64(-t) * t_1));
	elseif (t <= 1.4e-145)
		tmp = Float64(Float64(t * sqrt(Float64(2.0 * fma(0.5, x, -0.5)))) / l);
	else
		tmp = Float64(t / Float64(t * t_1));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.3e-254], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-145], N[(N[(t * N[Sqrt[N[(2.0 * N[(0.5 * x + -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\

\mathbf{elif}\;t \leq 1.4 \cdot 10^{-145}:\\
\;\;\;\;\frac{t \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.2999999999999997e-254

    1. Initial program 35.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. Simplified35.1%

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*81.1%

        \[\leadsto \frac{t}{\color{blue}{\left(-1 \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
      2. neg-mul-181.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      4. sub-neg81.1%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      5. metadata-eval81.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified81.1%

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

    if -4.2999999999999997e-254 < t < 1.4000000000000001e-145

    1. Initial program 4.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}} \]
    2. Simplified4.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 0.9%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \]
    4. Step-by-step derivation
      1. *-commutative0.9%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}} \cdot \frac{t}{\ell}\right)} \]
      2. associate--l+35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\color{blue}{\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)}}} \cdot \frac{t}{\ell}\right) \]
      3. sub-neg35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      4. metadata-eval35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      5. +-commutative35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      6. sub-neg35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      7. metadata-eval35.1%

        \[\leadsto \sqrt{2} \cdot \left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)}} \cdot \frac{t}{\ell}\right) \]
      8. +-commutative35.1%

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

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)}} \cdot \frac{t}{\ell}\right)} \]
    6. Taylor expanded in x around 0 46.9%

      \[\leadsto \sqrt{2} \cdot \left(\sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\ell}\right) \]
    7. Step-by-step derivation
      1. associate-*r*46.9%

        \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{\ell}} \]
      2. /-rgt-identity46.9%

        \[\leadsto \left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{\color{blue}{\frac{t}{1}}}{\ell} \]
      3. associate-*r/51.4%

        \[\leadsto \color{blue}{\frac{\left(\sqrt{2} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \frac{t}{1}}{\ell}} \]
      4. sqrt-unprod51.4%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \left(0.5 \cdot x - 0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      5. fma-neg51.4%

        \[\leadsto \frac{\sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(0.5, x, -0.5\right)}} \cdot \frac{t}{1}}{\ell} \]
      6. metadata-eval51.4%

        \[\leadsto \frac{\sqrt{2 \cdot \mathsf{fma}\left(0.5, x, \color{blue}{-0.5}\right)} \cdot \frac{t}{1}}{\ell} \]
      7. /-rgt-identity51.4%

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

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

    if 1.4000000000000001e-145 < 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{t}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}}{\sqrt{2}}}} \]
    3. Taylor expanded in t around inf 87.1%

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-145}:\\ \;\;\;\;\frac{t \cdot \sqrt{2 \cdot \mathsf{fma}\left(0.5, x, -0.5\right)}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 5: 77.6% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left|t\right|}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-145}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4.3e-254)
   (/ t (fabs t))
   (if (<= t 7.2e-145)
     (* (/ t l) (sqrt x))
     (/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0))))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / fabs(t);
	} else if (t <= 7.2e-145) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0))));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4.3d-254)) then
        tmp = t / abs(t)
    else if (t <= 7.2d-145) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / Math.abs(t);
	} else if (t <= 7.2e-145) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4.3e-254:
		tmp = t / math.fabs(t)
	elif t <= 7.2e-145:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0))))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4.3e-254)
		tmp = Float64(t / abs(t));
	elseif (t <= 7.2e-145)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4.3e-254)
		tmp = t / abs(t);
	elseif (t <= 7.2e-145)
		tmp = (t / l) * sqrt(x);
	else
		tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0))));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4.3e-254], N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-145], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left|t\right|}\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.2999999999999997e-254

    1. Initial program 35.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. Simplified35.1%

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

      \[\leadsto \frac{t}{\frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{2}}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}} \cdot \sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
      2. sqrt-unprod42.1%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
      3. associate-/l*42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}} \]
      4. sqrt-undiv42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}}}} \]
      5. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\sqrt{\color{blue}{1}}}}} \]
      6. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{1}}}} \]
      7. associate-/l*42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot \frac{t}{1}}} \]
      8. sqrt-undiv42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}} \cdot \frac{t}{1}}} \]
      9. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\sqrt{\color{blue}{1}}} \cdot \frac{t}{1}}} \]
      10. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{1}} \cdot \frac{t}{1}}} \]
      11. frac-times42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t \cdot t}{1 \cdot 1}}}} \]
      12. pow242.2%

        \[\leadsto \frac{t}{\sqrt{\frac{\color{blue}{{t}^{2}}}{1 \cdot 1}}} \]
      13. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{{t}^{2}}{\color{blue}{1}}}} \]
    5. Applied egg-rr42.2%

      \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{{t}^{2}}{1}}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{{t}^{2}}}} \]
      2. unpow242.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{t \cdot t}}} \]
      3. rem-sqrt-square78.7%

        \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]
    7. Simplified78.7%

      \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]

    if -4.2999999999999997e-254 < t < 7.2000000000000001e-145

    1. Initial program 4.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}} \]
    2. Simplified4.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 1.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)}}} \]
    4. Step-by-step derivation
      1. associate--l+37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \color{blue}{\left(\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)\right)}}} \]
      2. sub-neg37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)}} \]
      3. metadata-eval37.3%

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)}} \]
      7. +-commutative37.3%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)\right)}}} \]
    6. Taylor expanded in x around inf 60.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}}} \]
    7. Taylor expanded in t around 0 47.0%

      \[\leadsto \color{blue}{\frac{t}{\ell} \cdot \sqrt{x}} \]

    if 7.2000000000000001e-145 < 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{t}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}}{\sqrt{2}}}} \]
    3. Taylor expanded in t around inf 87.1%

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left|t\right|}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-145}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 6: 78.3% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + 1}{x + -1}}\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{-257}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{-148}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot t_1}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x 1.0) (+ x -1.0)))))
   (if (<= t -2.3e-257)
     (/ t (* (- t) t_1))
     (if (<= t 8.8e-148) (* (/ t l) (sqrt x)) (/ t (* t t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + 1.0) / (x + -1.0)));
	double tmp;
	if (t <= -2.3e-257) {
		tmp = t / (-t * t_1);
	} else if (t <= 8.8e-148) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = t / (t * t_1);
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + 1.0d0) / (x + (-1.0d0))))
    if (t <= (-2.3d-257)) then
        tmp = t / (-t * t_1)
    else if (t <= 8.8d-148) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = t / (t * t_1)
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + 1.0) / (x + -1.0)));
	double tmp;
	if (t <= -2.3e-257) {
		tmp = t / (-t * t_1);
	} else if (t <= 8.8e-148) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = t / (t * t_1);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + 1.0) / (x + -1.0)))
	tmp = 0
	if t <= -2.3e-257:
		tmp = t / (-t * t_1)
	elif t <= 8.8e-148:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = t / (t * t_1)
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))
	tmp = 0.0
	if (t <= -2.3e-257)
		tmp = Float64(t / Float64(Float64(-t) * t_1));
	elseif (t <= 8.8e-148)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = Float64(t / Float64(t * t_1));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + 1.0) / (x + -1.0)));
	tmp = 0.0;
	if (t <= -2.3e-257)
		tmp = t / (-t * t_1);
	elseif (t <= 8.8e-148)
		tmp = (t / l) * sqrt(x);
	else
		tmp = t / (t * t_1);
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.3e-257], N[(t / N[((-t) * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-148], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + 1}{x + -1}}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-257}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_1}\\

\mathbf{elif}\;t \leq 8.8 \cdot 10^{-148}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3e-257

    1. Initial program 35.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. Simplified35.1%

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \left(t \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*81.1%

        \[\leadsto \frac{t}{\color{blue}{\left(-1 \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
      2. neg-mul-181.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      4. sub-neg81.1%

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      5. metadata-eval81.1%

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

        \[\leadsto \frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified81.1%

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

    if -2.3e-257 < t < 8.80000000000000068e-148

    1. Initial program 4.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}} \]
    2. Simplified4.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 1.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)}}} \]
    4. Step-by-step derivation
      1. associate--l+37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \color{blue}{\left(\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)\right)}}} \]
      2. sub-neg37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)}} \]
      3. metadata-eval37.3%

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)}} \]
      7. +-commutative37.3%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)\right)}}} \]
    6. Taylor expanded in x around inf 60.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}}} \]
    7. Taylor expanded in t around 0 47.0%

      \[\leadsto \color{blue}{\frac{t}{\ell} \cdot \sqrt{x}} \]

    if 8.80000000000000068e-148 < 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{t}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}}{\sqrt{2}}}} \]
    3. Taylor expanded in t around inf 87.1%

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{1 + x}{x - 1}}}} \]
    4. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}} \]
      3. metadata-eval87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
      4. +-commutative87.1%

        \[\leadsto \frac{t}{t \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}} \]
    5. Simplified87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{-257}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{-148}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 7: 76.9% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left|t\right|}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-146}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4.3e-254)
   (/ t (fabs t))
   (if (<= t 1.55e-146) (* (/ t l) (sqrt x)) (/ t t))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / fabs(t);
	} else if (t <= 1.55e-146) {
		tmp = (t / l) * sqrt(x);
	} else {
		tmp = t / t;
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-4.3d-254)) then
        tmp = t / abs(t)
    else if (t <= 1.55d-146) then
        tmp = (t / l) * sqrt(x)
    else
        tmp = t / t
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.3e-254) {
		tmp = t / Math.abs(t);
	} else if (t <= 1.55e-146) {
		tmp = (t / l) * Math.sqrt(x);
	} else {
		tmp = t / t;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4.3e-254:
		tmp = t / math.fabs(t)
	elif t <= 1.55e-146:
		tmp = (t / l) * math.sqrt(x)
	else:
		tmp = t / t
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4.3e-254)
		tmp = Float64(t / abs(t));
	elseif (t <= 1.55e-146)
		tmp = Float64(Float64(t / l) * sqrt(x));
	else
		tmp = Float64(t / t);
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -4.3e-254)
		tmp = t / abs(t);
	elseif (t <= 1.55e-146)
		tmp = (t / l) * sqrt(x);
	else
		tmp = t / t;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -4.3e-254], N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-146], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / t), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\
\;\;\;\;\frac{t}{\left|t\right|}\\

\mathbf{elif}\;t \leq 1.55 \cdot 10^{-146}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.2999999999999997e-254

    1. Initial program 35.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. Simplified35.1%

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

      \[\leadsto \frac{t}{\frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{2}}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}} \cdot \sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
      2. sqrt-unprod42.1%

        \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
      3. associate-/l*42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}} \]
      4. sqrt-undiv42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}}}} \]
      5. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\sqrt{\color{blue}{1}}}}} \]
      6. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{1}}}} \]
      7. associate-/l*42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot \frac{t}{1}}} \]
      8. sqrt-undiv42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}} \cdot \frac{t}{1}}} \]
      9. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\sqrt{\color{blue}{1}}} \cdot \frac{t}{1}}} \]
      10. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{1}} \cdot \frac{t}{1}}} \]
      11. frac-times42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t \cdot t}{1 \cdot 1}}}} \]
      12. pow242.2%

        \[\leadsto \frac{t}{\sqrt{\frac{\color{blue}{{t}^{2}}}{1 \cdot 1}}} \]
      13. metadata-eval42.2%

        \[\leadsto \frac{t}{\sqrt{\frac{{t}^{2}}{\color{blue}{1}}}} \]
    5. Applied egg-rr42.2%

      \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{{t}^{2}}{1}}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity42.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{{t}^{2}}}} \]
      2. unpow242.2%

        \[\leadsto \frac{t}{\sqrt{\color{blue}{t \cdot t}}} \]
      3. rem-sqrt-square78.7%

        \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]
    7. Simplified78.7%

      \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]

    if -4.2999999999999997e-254 < t < 1.5499999999999999e-146

    1. Initial program 4.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}} \]
    2. Simplified4.2%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{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 l around inf 1.8%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)}}} \]
    4. Step-by-step derivation
      1. associate--l+37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \color{blue}{\left(\frac{1}{x - 1} + \left(\frac{x}{x - 1} - 1\right)\right)}}} \]
      2. sub-neg37.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)}} \]
      3. metadata-eval37.3%

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)}} \]
      7. +-commutative37.3%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{{\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \left(\frac{x}{-1 + x} - 1\right)\right)}}} \]
    6. Taylor expanded in x around inf 60.9%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}}} \]
    7. Taylor expanded in t around 0 47.0%

      \[\leadsto \color{blue}{\frac{t}{\ell} \cdot \sqrt{x}} \]

    if 1.5499999999999999e-146 < 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{t}{\frac{\sqrt{\frac{x + 1}{x + -1} \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) - \ell \cdot \ell}}{\sqrt{2}}}} \]
    3. Taylor expanded in x around inf 86.2%

      \[\leadsto \frac{t}{\color{blue}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-254}:\\ \;\;\;\;\frac{t}{\left|t\right|}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-146}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t}\\ \end{array} \]

Alternative 8: 75.4% accurate, 2.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \frac{t}{\left|t\right|} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (/ t (fabs t)))
l = abs(l);
double code(double x, double l, double t) {
	return t / fabs(t);
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = t / abs(t)
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	return t / Math.abs(t);
}
l = abs(l)
def code(x, l, t):
	return t / math.fabs(t)
l = abs(l)
function code(x, l, t)
	return Float64(t / abs(t))
end
l = abs(l)
function tmp = code(x, l, t)
	tmp = t / abs(t);
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := N[(t / N[Abs[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{t}{\left|t\right|}
\end{array}
Derivation
  1. Initial program 32.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. Simplified32.7%

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

    \[\leadsto \frac{t}{\frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{2}}} \]
  4. Step-by-step derivation
    1. add-sqr-sqrt35.0%

      \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}} \cdot \sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
    2. sqrt-unprod40.7%

      \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t \cdot \sqrt{2}}{\sqrt{2}}}}} \]
    3. associate-/l*40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}} \]
    4. sqrt-undiv40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}}}} \]
    5. metadata-eval40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\sqrt{\color{blue}{1}}}}} \]
    6. metadata-eval40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t \cdot \sqrt{2}}{\sqrt{2}} \cdot \frac{t}{\color{blue}{1}}}} \]
    7. associate-/l*40.8%

      \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot \frac{t}{1}}} \]
    8. sqrt-undiv40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{\sqrt{\frac{2}{2}}}} \cdot \frac{t}{1}}} \]
    9. metadata-eval40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t}{\sqrt{\color{blue}{1}}} \cdot \frac{t}{1}}} \]
    10. metadata-eval40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{t}{\color{blue}{1}} \cdot \frac{t}{1}}} \]
    11. frac-times40.8%

      \[\leadsto \frac{t}{\sqrt{\color{blue}{\frac{t \cdot t}{1 \cdot 1}}}} \]
    12. pow240.8%

      \[\leadsto \frac{t}{\sqrt{\frac{\color{blue}{{t}^{2}}}{1 \cdot 1}}} \]
    13. metadata-eval40.8%

      \[\leadsto \frac{t}{\sqrt{\frac{{t}^{2}}{\color{blue}{1}}}} \]
  5. Applied egg-rr40.8%

    \[\leadsto \frac{t}{\color{blue}{\sqrt{\frac{{t}^{2}}{1}}}} \]
  6. Step-by-step derivation
    1. /-rgt-identity40.8%

      \[\leadsto \frac{t}{\sqrt{\color{blue}{{t}^{2}}}} \]
    2. unpow240.8%

      \[\leadsto \frac{t}{\sqrt{\color{blue}{t \cdot t}}} \]
    3. rem-sqrt-square73.5%

      \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]
  7. Simplified73.5%

    \[\leadsto \frac{t}{\color{blue}{\left|t\right|}} \]
  8. Final simplification73.5%

    \[\leadsto \frac{t}{\left|t\right|} \]

Alternative 9: 38.5% accurate, 75.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \frac{t}{t} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (/ t t))
l = abs(l);
double code(double x, double l, double t) {
	return t / t;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = t / t
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	return t / t;
}
l = abs(l)
def code(x, l, t):
	return t / t
l = abs(l)
function code(x, l, t)
	return Float64(t / t)
end
l = abs(l)
function tmp = code(x, l, t)
	tmp = t / t;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := N[(t / t), $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\frac{t}{t}
\end{array}
Derivation
  1. Initial program 32.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. Simplified32.7%

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

    \[\leadsto \frac{t}{\color{blue}{t}} \]
  4. Final simplification36.2%

    \[\leadsto \frac{t}{t} \]

Reproduce

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