Toniolo and Linder, Equation (7)

Percentage Accurate: 33.6% → 82.8%
Time: 23.6s
Alternatives: 11
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 11 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: 33.6% 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: 82.8% accurate, 0.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ t_2 := 2 \cdot {t}^{2}\\ t_3 := t_2 + {\ell}^{2}\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{+19}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_2 + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(\frac{t_3}{x} + \frac{t_3}{{x}^{3}}\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0))))
        (t_2 (* 2.0 (pow t 2.0)))
        (t_3 (+ t_2 (pow l 2.0))))
   (if (<= t -5.5e+19)
     (- t_1)
     (if (<= t -2.85e-213)
       (/
        t
        (/
         (sqrt
          (+
           (+
            (/ (+ t_3 t_3) (pow x 2.0))
            (+
             (* 2.0 (/ (pow t 2.0) x))
             (+
              (* 2.0 (/ (pow t 2.0) (pow x 3.0)))
              (+ t_2 (+ (/ (pow l 2.0) x) (/ (pow l 2.0) (pow x 3.0)))))))
           (+ (/ t_3 x) (/ t_3 (pow x 3.0)))))
         (sqrt 2.0)))
       (if (<= t 8.6e-206)
         (/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
         t_1)))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double t_2 = 2.0 * pow(t, 2.0);
	double t_3 = t_2 + pow(l, 2.0);
	double tmp;
	if (t <= -5.5e+19) {
		tmp = -t_1;
	} else if (t <= -2.85e-213) {
		tmp = t / (sqrt(((((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + ((2.0 * (pow(t, 2.0) / pow(x, 3.0))) + (t_2 + ((pow(l, 2.0) / x) + (pow(l, 2.0) / pow(x, 3.0))))))) + ((t_3 / x) + (t_3 / pow(x, 3.0))))) / sqrt(2.0));
	} else if (t <= 8.6e-206) {
		tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	t_2 = Float64(2.0 * (t ^ 2.0))
	t_3 = Float64(t_2 + (l ^ 2.0))
	tmp = 0.0
	if (t <= -5.5e+19)
		tmp = Float64(-t_1);
	elseif (t <= -2.85e-213)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / (x ^ 3.0))) + Float64(t_2 + Float64(Float64((l ^ 2.0) / x) + Float64((l ^ 2.0) / (x ^ 3.0))))))) + Float64(Float64(t_3 / x) + Float64(t_3 / (x ^ 3.0))))) / sqrt(2.0)));
	elseif (t <= 8.6e-206)
		tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(2.0)));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+19], (-t$95$1), If[LessEqual[t, -2.85e-213], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 / x), $MachinePrecision] + N[(t$95$3 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+19}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_2 + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(\frac{t_3}{x} + \frac{t_3}{{x}^{3}}\right)}}{\sqrt{2}}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.5e19

    1. Initial program 45.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. Simplified45.9%

      \[\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. Applied egg-rr80.3%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg97.4%

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

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

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

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

    if -5.5e19 < t < -2.84999999999999997e-213

    1. Initial program 42.6%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified42.6%

      \[\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 79.6%

      \[\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 \frac{{t}^{2}}{{x}^{3}} + \left(2 \cdot {t}^{2} + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) - \left(-1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + -1 \cdot \frac{2 \cdot {t}^{2} + {\ell}^{2}}{{x}^{3}}\right)}}}{\sqrt{2}}} \]

    if -2.84999999999999997e-213 < t < 8.6000000000000005e-206

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

      \[\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 7.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5 \cdot x - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-commutative49.6%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot 0.5} - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}} \]
      3. fma-neg49.6%

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

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

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

    if 8.6000000000000005e-206 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{+19}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{\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 \frac{{t}^{2}}{{x}^{3}} + \left(2 \cdot {t}^{2} + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{{x}^{3}}\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 2: 82.9% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ t_2 := 2 \cdot {t}^{2}\\ t_3 := t_2 + {\ell}^{2}\\ \mathbf{if}\;t \leq -6.8 \cdot 10^{+18}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{t_3}{x} + \left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right)\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0))))
        (t_2 (* 2.0 (pow t 2.0)))
        (t_3 (+ t_2 (pow l 2.0))))
   (if (<= t -6.8e+18)
     (- t_1)
     (if (<= t -2.85e-213)
       (/
        t
        (/
         (sqrt
          (+
           (/ t_3 x)
           (+
            (/ (+ t_3 t_3) (pow x 2.0))
            (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x))))))
         (sqrt 2.0)))
       (if (<= t 8e-206)
         (/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
         t_1)))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double t_2 = 2.0 * pow(t, 2.0);
	double t_3 = t_2 + pow(l, 2.0);
	double tmp;
	if (t <= -6.8e+18) {
		tmp = -t_1;
	} else if (t <= -2.85e-213) {
		tmp = t / (sqrt(((t_3 / x) + (((t_3 + t_3) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x)))))) / sqrt(2.0));
	} else if (t <= 8e-206) {
		tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	t_2 = Float64(2.0 * (t ^ 2.0))
	t_3 = Float64(t_2 + (l ^ 2.0))
	tmp = 0.0
	if (t <= -6.8e+18)
		tmp = Float64(-t_1);
	elseif (t <= -2.85e-213)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(t_3 / x) + Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x)))))) / sqrt(2.0)));
	elseif (t <= 8e-206)
		tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(2.0)));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+18], (-t$95$1), If[LessEqual[t, -2.85e-213], N[(t / N[(N[Sqrt[N[(N[(t$95$3 / x), $MachinePrecision] + N[(N[(N[(t$95$3 + t$95$3), $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$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+18}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\frac{t_3}{x} + \left(\frac{t_3 + t_3}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\right)\right)}}{\sqrt{2}}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.8e18

    1. Initial program 45.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. Simplified45.9%

      \[\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. Applied egg-rr80.3%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg97.4%

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

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

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

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

    if -6.8e18 < t < -2.84999999999999997e-213

    1. Initial program 42.6%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified42.6%

      \[\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 79.4%

      \[\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 -2.84999999999999997e-213 < t < 8.00000000000000023e-206

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

      \[\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 7.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5 \cdot x - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-commutative49.6%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot 0.5} - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}} \]
      3. fma-neg49.6%

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

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

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

    if 8.00000000000000023e-206 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{+18}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq -2.85 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(\frac{\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)}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 3: 83.2% accurate, 0.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -8.8 \cdot 10^{+18}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq -2.75 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{{\ell}^{2}}{x} + 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -8.8e+18)
     (- t_1)
     (if (<= t -2.75e-213)
       (/
        t
        (/
         (sqrt
          (+
           (+ (/ (pow l 2.0) x) (* 2.0 (* t (+ t (/ t x)))))
           (/ (fma 2.0 (pow t 2.0) (pow l 2.0)) x)))
         (sqrt 2.0)))
       (if (<= t 2.1e-206)
         (/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
         t_1)))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -8.8e+18) {
		tmp = -t_1;
	} else if (t <= -2.75e-213) {
		tmp = t / (sqrt((((pow(l, 2.0) / x) + (2.0 * (t * (t + (t / x))))) + (fma(2.0, pow(t, 2.0), pow(l, 2.0)) / x))) / sqrt(2.0));
	} else if (t <= 2.1e-206) {
		tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -8.8e+18)
		tmp = Float64(-t_1);
	elseif (t <= -2.75e-213)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64((l ^ 2.0) / x) + Float64(2.0 * Float64(t * Float64(t + Float64(t / x))))) + Float64(fma(2.0, (t ^ 2.0), (l ^ 2.0)) / x))) / sqrt(2.0)));
	elseif (t <= 2.1e-206)
		tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(2.0)));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -8.8e+18], (-t$95$1), If[LessEqual[t, -2.75e-213], N[(t / N[(N[Sqrt[N[(N[(N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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, 2.1e-206], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;-t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -8.8e18

    1. Initial program 45.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. Simplified45.9%

      \[\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. Applied egg-rr80.3%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg97.4%

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

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

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

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

    if -8.8e18 < t < -2.75000000000000004e-213

    1. Initial program 42.6%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified42.6%

      \[\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 79.1%

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

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

      \[\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-def77.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-log1p79.1%

        \[\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-udef79.1%

        \[\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-udef79.1%

        \[\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+79.1%

        \[\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-out79.1%

        \[\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. unpow279.1%

        \[\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/79.1%

        \[\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. unpow279.1%

        \[\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-out79.1%

        \[\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. Simplified79.1%

      \[\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 -2.75000000000000004e-213 < t < 2.1000000000000001e-206

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

      \[\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 7.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5 \cdot x - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-commutative49.6%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot 0.5} - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}} \]
      3. fma-neg49.6%

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

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

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

    if 2.1000000000000001e-206 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.8 \cdot 10^{+18}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq -2.75 \cdot 10^{-213}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{{\ell}^{2}}{x} + 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right)\right) + \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 4: 81.0% accurate, 0.7× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -7 \cdot 10^{-211}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-205}:\\ \;\;\;\;\frac{t \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -7e-211)
     (- t_1)
     (if (<= t 1.3e-205)
       (/ (* t (sqrt (fma x 0.5 -0.5))) (/ l (sqrt 2.0)))
       t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -7e-211) {
		tmp = -t_1;
	} else if (t <= 1.3e-205) {
		tmp = (t * sqrt(fma(x, 0.5, -0.5))) / (l / sqrt(2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -7e-211)
		tmp = Float64(-t_1);
	elseif (t <= 1.3e-205)
		tmp = Float64(Float64(t * sqrt(fma(x, 0.5, -0.5))) / Float64(l / sqrt(2.0)));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7e-211], (-t$95$1), If[LessEqual[t, 1.3e-205], N[(N[(t * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -7 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 45.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. Simplified45.0%

      \[\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. Applied egg-rr66.5%

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.2%

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

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

        \[\leadsto -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \]
      4. +-commutative83.2%

        \[\leadsto -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \]
    6. Simplified83.2%

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

    if -7e-211 < t < 1.2999999999999999e-205

    1. Initial program 3.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. Simplified3.0%

      \[\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 6.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5 \cdot x - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-commutative49.8%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot 0.5} - 0.5} \cdot t}{\frac{\ell}{\sqrt{2}}} \]
      3. fma-neg49.8%

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

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

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

    if 1.2999999999999999e-205 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

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

Alternative 5: 80.0% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -6.1 \cdot 10^{-211}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(t \cdot \frac{1}{\frac{\ell}{\sqrt{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -6.1e-211)
     (- t_1)
     (if (<= t 2.05e-206)
       (* (sqrt (- (* x 0.5) 0.5)) (* t (/ 1.0 (/ l (sqrt 2.0)))))
       t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -6.1e-211) {
		tmp = -t_1;
	} else if (t <= 2.05e-206) {
		tmp = sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / sqrt(2.0))));
	} else {
		tmp = 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((((-1.0d0) + x) / (x + 1.0d0)))
    if (t <= (-6.1d-211)) then
        tmp = -t_1
    else if (t <= 2.05d-206) then
        tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (t * (1.0d0 / (l / sqrt(2.0d0))))
    else
        tmp = 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(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -6.1e-211) {
		tmp = -t_1;
	} else if (t <= 2.05e-206) {
		tmp = Math.sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / Math.sqrt(2.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((-1.0 + x) / (x + 1.0)))
	tmp = 0
	if t <= -6.1e-211:
		tmp = -t_1
	elif t <= 2.05e-206:
		tmp = math.sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / math.sqrt(2.0))))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -6.1e-211)
		tmp = Float64(-t_1);
	elseif (t <= 2.05e-206)
		tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(t * Float64(1.0 / Float64(l / sqrt(2.0)))));
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -6.1e-211)
		tmp = -t_1;
	elseif (t <= 2.05e-206)
		tmp = sqrt(((x * 0.5) - 0.5)) * (t * (1.0 / (l / sqrt(2.0))));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6.1e-211], (-t$95$1), If[LessEqual[t, 2.05e-206], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(t * N[(1.0 / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(t \cdot \frac{1}{\frac{\ell}{\sqrt{2}}}\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 45.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. Simplified45.0%

      \[\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. Applied egg-rr66.5%

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.2%

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

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

        \[\leadsto -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \]
      4. +-commutative83.2%

        \[\leadsto -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \]
    6. Simplified83.2%

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

    if -6.1e-211 < t < 2.05000000000000008e-206

    1. Initial program 3.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. Simplified3.0%

      \[\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 6.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    7. Step-by-step derivation
      1. div-inv49.3%

        \[\leadsto \sqrt{0.5 \cdot x - 0.5} \cdot \color{blue}{\left(t \cdot \frac{1}{\frac{\ell}{\sqrt{2}}}\right)} \]
    8. Applied egg-rr49.3%

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

    if 2.05000000000000008e-206 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.1 \cdot 10^{-211}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(t \cdot \frac{1}{\frac{\ell}{\sqrt{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 6: 80.0% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -5.8 \cdot 10^{-211}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(\sqrt{2} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -5.8e-211)
     (- t_1)
     (if (<= t 3.4e-206)
       (* (sqrt (- (* x 0.5) 0.5)) (* (sqrt 2.0) (/ t l)))
       t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -5.8e-211) {
		tmp = -t_1;
	} else if (t <= 3.4e-206) {
		tmp = sqrt(((x * 0.5) - 0.5)) * (sqrt(2.0) * (t / l));
	} else {
		tmp = 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((((-1.0d0) + x) / (x + 1.0d0)))
    if (t <= (-5.8d-211)) then
        tmp = -t_1
    else if (t <= 3.4d-206) then
        tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (sqrt(2.0d0) * (t / l))
    else
        tmp = 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(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -5.8e-211) {
		tmp = -t_1;
	} else if (t <= 3.4e-206) {
		tmp = Math.sqrt(((x * 0.5) - 0.5)) * (Math.sqrt(2.0) * (t / l));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((-1.0 + x) / (x + 1.0)))
	tmp = 0
	if t <= -5.8e-211:
		tmp = -t_1
	elif t <= 3.4e-206:
		tmp = math.sqrt(((x * 0.5) - 0.5)) * (math.sqrt(2.0) * (t / l))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -5.8e-211)
		tmp = Float64(-t_1);
	elseif (t <= 3.4e-206)
		tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(sqrt(2.0) * Float64(t / l)));
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -5.8e-211)
		tmp = -t_1;
	elseif (t <= 3.4e-206)
		tmp = sqrt(((x * 0.5) - 0.5)) * (sqrt(2.0) * (t / l));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -5.8e-211], (-t$95$1), If[LessEqual[t, 3.4e-206], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{-206}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(\sqrt{2} \cdot \frac{t}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 45.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. Simplified45.0%

      \[\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. Applied egg-rr66.5%

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.2%

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

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

        \[\leadsto -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \]
      4. +-commutative83.2%

        \[\leadsto -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \]
    6. Simplified83.2%

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

    if -5.80000000000000029e-211 < t < 3.39999999999999985e-206

    1. Initial program 3.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. Simplified3.0%

      \[\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 6.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x - 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    7. Step-by-step derivation
      1. associate-/r/49.3%

        \[\leadsto \sqrt{0.5 \cdot x - 0.5} \cdot \color{blue}{\left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
    8. Applied egg-rr49.3%

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

    if 3.39999999999999985e-206 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-211}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(\sqrt{2} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 7: 79.9% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -3.7 \cdot 10^{-211}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-205}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -3.7e-211)
     (- t_1)
     (if (<= t 1.25e-205) (* (sqrt (* x 0.5)) (/ t (/ l (sqrt 2.0)))) t_1))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -3.7e-211) {
		tmp = -t_1;
	} else if (t <= 1.25e-205) {
		tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0)));
	} else {
		tmp = 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((((-1.0d0) + x) / (x + 1.0d0)))
    if (t <= (-3.7d-211)) then
        tmp = -t_1
    else if (t <= 1.25d-205) then
        tmp = sqrt((x * 0.5d0)) * (t / (l / sqrt(2.0d0)))
    else
        tmp = 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(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -3.7e-211) {
		tmp = -t_1;
	} else if (t <= 1.25e-205) {
		tmp = Math.sqrt((x * 0.5)) * (t / (l / Math.sqrt(2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((-1.0 + x) / (x + 1.0)))
	tmp = 0
	if t <= -3.7e-211:
		tmp = -t_1
	elif t <= 1.25e-205:
		tmp = math.sqrt((x * 0.5)) * (t / (l / math.sqrt(2.0)))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -3.7e-211)
		tmp = Float64(-t_1);
	elseif (t <= 1.25e-205)
		tmp = Float64(sqrt(Float64(x * 0.5)) * Float64(t / Float64(l / sqrt(2.0))));
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -3.7e-211)
		tmp = -t_1;
	elseif (t <= 1.25e-205)
		tmp = sqrt((x * 0.5)) * (t / (l / sqrt(2.0)));
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.7e-211], (-t$95$1), If[LessEqual[t, 1.25e-205], N[(N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{-211}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 1.25 \cdot 10^{-205}:\\
\;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 45.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. Simplified45.0%

      \[\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. Applied egg-rr66.5%

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. mul-1-neg83.2%

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

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

        \[\leadsto -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \]
      4. +-commutative83.2%

        \[\leadsto -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \]
    6. Simplified83.2%

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

    if -3.6999999999999998e-211 < t < 1.25e-205

    1. Initial program 3.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. Simplified3.0%

      \[\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 6.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot x}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    7. Step-by-step derivation
      1. *-commutative45.2%

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}} \]
    8. Simplified45.2%

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

    if 1.25e-205 < t

    1. Initial program 28.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. Simplified28.6%

      \[\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. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-211}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-205}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \frac{t}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 8: 76.9% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{if}\;t \leq -2 \cdot 10^{-311}:\\ \;\;\;\;-t_1\\ \mathbf{else}:\\ \;\;\;\;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 (/ (+ -1.0 x) (+ x 1.0)))))
   (if (<= t -2e-311) (- t_1) t_1)))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -2e-311) {
		tmp = -t_1;
	} else {
		tmp = 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((((-1.0d0) + x) / (x + 1.0d0)))
    if (t <= (-2d-311)) then
        tmp = -t_1
    else
        tmp = 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(((-1.0 + x) / (x + 1.0)));
	double tmp;
	if (t <= -2e-311) {
		tmp = -t_1;
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((-1.0 + x) / (x + 1.0)))
	tmp = 0
	if t <= -2e-311:
		tmp = -t_1
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -2e-311)
		tmp = Float64(-t_1);
	else
		tmp = t_1;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((-1.0 + x) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -2e-311)
		tmp = -t_1;
	else
		tmp = 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[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2e-311], (-t$95$1), t$95$1]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{-311}:\\
\;\;\;\;-t_1\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.9999999999999e-311

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

      \[\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. Applied egg-rr63.4%

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

      \[\leadsto \color{blue}{-1 \cdot \sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. mul-1-neg75.6%

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

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

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

        \[\leadsto -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \]
    6. Simplified75.6%

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

    if -1.9999999999999e-311 < t

    1. Initial program 25.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. Simplified25.3%

      \[\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. Applied egg-rr67.7%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 81.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{-311}:\\ \;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 9: 76.1% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -8.5e-304) (/ t (- t)) (sqrt (/ (+ -1.0 x) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -8.5e-304) {
		tmp = t / -t;
	} else {
		tmp = sqrt(((-1.0 + x) / (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 <= (-8.5d-304)) then
        tmp = t / -t
    else
        tmp = sqrt((((-1.0d0) + x) / (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 <= -8.5e-304) {
		tmp = t / -t;
	} else {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -8.5e-304:
		tmp = t / -t
	else:
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -8.5e-304)
		tmp = Float64(t / Float64(-t));
	else
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -8.5e-304)
		tmp = t / -t;
	else
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -8.5e-304], N[(t / (-t)), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{-t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.5e-304

    1. Initial program 40.6%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified40.6%

      \[\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 49.8%

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2 \cdot {t}^{2}}}}{\sqrt{2}}} \]
    4. Taylor expanded in t around -inf 75.1%

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot t}} \]
    5. Step-by-step derivation
      1. neg-mul-175.1%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    6. Simplified75.1%

      \[\leadsto \frac{t}{\color{blue}{-t}} \]

    if -8.5e-304 < t

    1. Initial program 25.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. Simplified25.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. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}{t}}} \]
    4. Taylor expanded in l around 0 80.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]

Alternative 10: 75.5% accurate, 37.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{-t}\\ \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 -8.5e-304) (/ t (- t)) (/ t t)))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -8.5e-304) {
		tmp = t / -t;
	} 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 <= (-8.5d-304)) then
        tmp = t / -t
    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 <= -8.5e-304) {
		tmp = t / -t;
	} else {
		tmp = t / t;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -8.5e-304:
		tmp = t / -t
	else:
		tmp = t / t
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -8.5e-304)
		tmp = Float64(t / Float64(-t));
	else
		tmp = Float64(t / t);
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -8.5e-304)
		tmp = t / -t;
	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, -8.5e-304], N[(t / (-t)), $MachinePrecision], N[(t / t), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{-t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.5e-304

    1. Initial program 40.6%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified40.6%

      \[\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 49.8%

      \[\leadsto \frac{t}{\frac{\sqrt{\color{blue}{2 \cdot {t}^{2}}}}{\sqrt{2}}} \]
    4. Taylor expanded in t around -inf 75.1%

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot t}} \]
    5. Step-by-step derivation
      1. neg-mul-175.1%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    6. Simplified75.1%

      \[\leadsto \frac{t}{\color{blue}{-t}} \]

    if -8.5e-304 < t

    1. Initial program 25.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. Simplified25.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 x around inf 79.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{t}\\ \end{array} \]

Alternative 11: 38.8% 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.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. Simplified32.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 x around inf 43.5%

    \[\leadsto \frac{t}{\color{blue}{t}} \]
  4. Final simplification43.5%

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

Reproduce

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