Toniolo and Linder, Equation (7)

Percentage Accurate: 32.9% → 84.7%
Time: 21.7s
Alternatives: 13
Speedup: 225.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 13 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.9% 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.7% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{{\ell}^{2}}{x}\\ t_2 := \sqrt{\frac{x + -1}{x + 1}}\\ t_3 := 2 \cdot {t}^{2}\\ t_4 := {\ell}^{2} + t_3\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{+43}:\\ \;\;\;\;-t_2\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-159}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-170}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-160}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+98}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (pow l 2.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)))
   (if (<= t -5.2e+43)
     (- t_2)
     (if (<= t -8.2e-159)
       (/ t (sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0)))
       (if (<= t -1.45e-170)
         -1.0
         (if (<= t 9.5e-304)
           (/ t (* l (sqrt (/ 1.0 x))))
           (if (<= t 4.2e-160)
             (/
              t
              (fma
               0.5
               (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
               t))
             (if (<= t 8.8e+98)
               (/
                t
                (/
                 (sqrt
                  (+
                   (+
                    (/ (+ t_4 t_4) (pow x 2.0))
                    (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 t_3)))
                   (/ t_4 x)))
                 (sqrt 2.0)))
               t_2))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = pow(l, 2.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 tmp;
	if (t <= -5.2e+43) {
		tmp = -t_2;
	} else if (t <= -8.2e-159) {
		tmp = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
	} else if (t <= -1.45e-170) {
		tmp = -1.0;
	} else if (t <= 9.5e-304) {
		tmp = t / (l * sqrt((1.0 / x)));
	} else if (t <= 4.2e-160) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 8.8e+98) {
		tmp = t / (sqrt(((((t_4 + t_4) / pow(x, 2.0)) + ((2.0 * (pow(t, 2.0) / x)) + (t_1 + t_3))) + (t_4 / x))) / sqrt(2.0));
	} else {
		tmp = t_2;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = Float64((l ^ 2.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)
	tmp = 0.0
	if (t <= -5.2e+43)
		tmp = Float64(-t_2);
	elseif (t <= -8.2e-159)
		tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0)));
	elseif (t <= -1.45e-170)
		tmp = -1.0;
	elseif (t <= 9.5e-304)
		tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x))));
	elseif (t <= 4.2e-160)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 8.8e+98)
		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_1 + t_3))) + Float64(t_4 / x))) / sqrt(2.0)));
	else
		tmp = t_2;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $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]}, If[LessEqual[t, -5.2e+43], (-t$95$2), If[LessEqual[t, -8.2e-159], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.45e-170], -1.0, If[LessEqual[t, 9.5e-304], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-160], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+98], 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$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
t_3 := 2 \cdot {t}^{2}\\
t_4 := {\ell}^{2} + t_3\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+43}:\\
\;\;\;\;-t_2\\

\mathbf{elif}\;t \leq -8.2 \cdot 10^{-159}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\

\mathbf{elif}\;t \leq -1.45 \cdot 10^{-170}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

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

\mathbf{elif}\;t \leq 8.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_4 + t_4}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + t_3\right)\right)\right) + \frac{t_4}{x}}}{\sqrt{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if t < -5.20000000000000042e43

    1. Initial program 24.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. Simplified24.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-rr76.6%

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

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

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

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

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

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

    if -5.20000000000000042e43 < t < -8.20000000000000029e-159

    1. Initial program 59.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. Simplified59.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 88.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 0 88.2%

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

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

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

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

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

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

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

    if -8.20000000000000029e-159 < t < -1.45e-170

    1. Initial program 22.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. Simplified22.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-rr67.8%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt100.0%

        \[\leadsto \color{blue}{-1} \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{-1} \]

    if -1.45e-170 < t < 9.50000000000000023e-304

    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}{\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 60.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 0 60.3%

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

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

    if 9.50000000000000023e-304 < t < 4.2000000000000001e-160

    1. Initial program 2.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. Simplified2.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 37.7%

      \[\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 0 37.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg93.2%

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow293.2%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt93.2%

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

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

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

    if 4.2000000000000001e-160 < t < 8.80000000000000034e98

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

      \[\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 8.80000000000000034e98 < t

    1. Initial program 12.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. Simplified12.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-rr84.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+43}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-159}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-170}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-304}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-160}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+98}:\\ \;\;\;\;\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}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 2: 84.8% accurate, 0.4× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{{\ell}^{2}}{x}\\ t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ t_3 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1 \cdot 10^{+43}:\\ \;\;\;\;-t_3\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-159}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-168}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{-302}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-161}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+100}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (pow l 2.0) x))
        (t_2
         (/
          t
          (sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0))))
        (t_3 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1e+43)
     (- t_3)
     (if (<= t -8e-159)
       t_2
       (if (<= t -5.2e-168)
         -1.0
         (if (<= t 7.6e-302)
           (/ t (* l (sqrt (/ 1.0 x))))
           (if (<= t 4.2e-161)
             (/
              t
              (fma
               0.5
               (/ (fma 2.0 (pow t 2.0) (fma l l (pow l 2.0))) (* 2.0 (* t x)))
               t))
             (if (<= t 1.6e+100) t_2 t_3))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = pow(l, 2.0) / x;
	double t_2 = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
	double t_3 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1e+43) {
		tmp = -t_3;
	} else if (t <= -8e-159) {
		tmp = t_2;
	} else if (t <= -5.2e-168) {
		tmp = -1.0;
	} else if (t <= 7.6e-302) {
		tmp = t / (l * sqrt((1.0 / x)));
	} else if (t <= 4.2e-161) {
		tmp = t / fma(0.5, (fma(2.0, pow(t, 2.0), fma(l, l, pow(l, 2.0))) / (2.0 * (t * x))), t);
	} else if (t <= 1.6e+100) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = Float64((l ^ 2.0) / x)
	t_2 = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0)))
	t_3 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1e+43)
		tmp = Float64(-t_3);
	elseif (t <= -8e-159)
		tmp = t_2;
	elseif (t <= -5.2e-168)
		tmp = -1.0;
	elseif (t <= 7.6e-302)
		tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x))));
	elseif (t <= 4.2e-161)
		tmp = Float64(t / fma(0.5, Float64(fma(2.0, (t ^ 2.0), fma(l, l, (l ^ 2.0))) / Float64(2.0 * Float64(t * x))), t));
	elseif (t <= 1.6e+100)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1e+43], (-t$95$3), If[LessEqual[t, -8e-159], t$95$2, If[LessEqual[t, -5.2e-168], -1.0, If[LessEqual[t, 7.6e-302], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-161], N[(t / N[(0.5 * N[(N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[(l * l + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+100], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\
t_3 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+43}:\\
\;\;\;\;-t_3\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-159}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -5.2 \cdot 10^{-168}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 7.6 \cdot 10^{-302}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

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

\mathbf{elif}\;t \leq 1.6 \cdot 10^{+100}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


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

    1. Initial program 24.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. Simplified24.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-rr76.6%

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

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

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

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

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

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

    if -1.00000000000000001e43 < t < -7.99999999999999991e-159 or 4.2000000000000001e-161 < t < 1.5999999999999999e100

    1. Initial program 55.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. Simplified55.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 85.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 0 85.0%

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

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

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

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

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

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

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

    if -7.99999999999999991e-159 < t < -5.2000000000000002e-168

    1. Initial program 22.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. Simplified22.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-rr67.8%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt100.0%

        \[\leadsto \color{blue}{-1} \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{-1} \]

    if -5.2000000000000002e-168 < t < 7.5999999999999999e-302

    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}{\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 60.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 0 60.3%

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

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

    if 7.5999999999999999e-302 < t < 4.2000000000000001e-161

    1. Initial program 2.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. Simplified2.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 37.7%

      \[\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 0 37.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, -\color{blue}{\left(-{\ell}^{2}\right)}\right)\right)}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}, t\right)} \]
      8. remove-double-neg93.2%

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

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

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\color{blue}{\left({\left(\sqrt{2}\right)}^{2} \cdot x\right)} \cdot t}, t\right)} \]
      11. unpow293.2%

        \[\leadsto \frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{\left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot x\right) \cdot t}, t\right)} \]
      12. rem-square-sqrt93.2%

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

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

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

    if 1.5999999999999999e100 < t

    1. Initial program 12.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. Simplified12.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-rr84.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+43}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-159}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-168}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{-302}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-161}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(\ell, \ell, {\ell}^{2}\right)\right)}{2 \cdot \left(t \cdot x\right)}, t\right)}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+100}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 3: 84.6% accurate, 0.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{{\ell}^{2}}{x}\\ t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ t_3 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -1.96 \cdot 10^{+43}:\\ \;\;\;\;-t_3\\ \mathbf{elif}\;t \leq -8.3 \cdot 10^{-159}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5.1 \cdot 10^{-169}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-162}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+99}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (pow l 2.0) x))
        (t_2
         (/
          t
          (sqrt (/ (+ t_1 (+ t_1 (* (pow t 2.0) (+ 2.0 (/ 2.0 x))))) 2.0))))
        (t_3 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -1.96e+43)
     (- t_3)
     (if (<= t -8.3e-159)
       t_2
       (if (<= t -5.1e-169)
         -1.0
         (if (<= t 2.7e-205)
           (/ t (* l (sqrt (/ 1.0 x))))
           (if (<= t 1.75e-162) 1.0 (if (<= t 7.2e+99) t_2 t_3))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = pow(l, 2.0) / x;
	double t_2 = t / sqrt(((t_1 + (t_1 + (pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
	double t_3 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.96e+43) {
		tmp = -t_3;
	} else if (t <= -8.3e-159) {
		tmp = t_2;
	} else if (t <= -5.1e-169) {
		tmp = -1.0;
	} else if (t <= 2.7e-205) {
		tmp = t / (l * sqrt((1.0 / x)));
	} else if (t <= 1.75e-162) {
		tmp = 1.0;
	} else if (t <= 7.2e+99) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (l ** 2.0d0) / x
    t_2 = t / sqrt(((t_1 + (t_1 + ((t ** 2.0d0) * (2.0d0 + (2.0d0 / x))))) / 2.0d0))
    t_3 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-1.96d+43)) then
        tmp = -t_3
    else if (t <= (-8.3d-159)) then
        tmp = t_2
    else if (t <= (-5.1d-169)) then
        tmp = -1.0d0
    else if (t <= 2.7d-205) then
        tmp = t / (l * sqrt((1.0d0 / x)))
    else if (t <= 1.75d-162) then
        tmp = 1.0d0
    else if (t <= 7.2d+99) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.pow(l, 2.0) / x;
	double t_2 = t / Math.sqrt(((t_1 + (t_1 + (Math.pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0));
	double t_3 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -1.96e+43) {
		tmp = -t_3;
	} else if (t <= -8.3e-159) {
		tmp = t_2;
	} else if (t <= -5.1e-169) {
		tmp = -1.0;
	} else if (t <= 2.7e-205) {
		tmp = t / (l * Math.sqrt((1.0 / x)));
	} else if (t <= 1.75e-162) {
		tmp = 1.0;
	} else if (t <= 7.2e+99) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.pow(l, 2.0) / x
	t_2 = t / math.sqrt(((t_1 + (t_1 + (math.pow(t, 2.0) * (2.0 + (2.0 / x))))) / 2.0))
	t_3 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -1.96e+43:
		tmp = -t_3
	elif t <= -8.3e-159:
		tmp = t_2
	elif t <= -5.1e-169:
		tmp = -1.0
	elif t <= 2.7e-205:
		tmp = t / (l * math.sqrt((1.0 / x)))
	elif t <= 1.75e-162:
		tmp = 1.0
	elif t <= 7.2e+99:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64((l ^ 2.0) / x)
	t_2 = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_1 + Float64((t ^ 2.0) * Float64(2.0 + Float64(2.0 / x))))) / 2.0)))
	t_3 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -1.96e+43)
		tmp = Float64(-t_3);
	elseif (t <= -8.3e-159)
		tmp = t_2;
	elseif (t <= -5.1e-169)
		tmp = -1.0;
	elseif (t <= 2.7e-205)
		tmp = Float64(t / Float64(l * sqrt(Float64(1.0 / x))));
	elseif (t <= 1.75e-162)
		tmp = 1.0;
	elseif (t <= 7.2e+99)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (l ^ 2.0) / x;
	t_2 = t / sqrt(((t_1 + (t_1 + ((t ^ 2.0) * (2.0 + (2.0 / x))))) / 2.0));
	t_3 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -1.96e+43)
		tmp = -t_3;
	elseif (t <= -8.3e-159)
		tmp = t_2;
	elseif (t <= -5.1e-169)
		tmp = -1.0;
	elseif (t <= 2.7e-205)
		tmp = t / (l * sqrt((1.0 / x)));
	elseif (t <= 1.75e-162)
		tmp = 1.0;
	elseif (t <= 7.2e+99)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$1 + N[(N[Power[t, 2.0], $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.96e+43], (-t$95$3), If[LessEqual[t, -8.3e-159], t$95$2, If[LessEqual[t, -5.1e-169], -1.0, If[LessEqual[t, 2.7e-205], N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-162], 1.0, If[LessEqual[t, 7.2e+99], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{{\ell}^{2}}{x}\\
t_2 := \frac{t}{\sqrt{\frac{t_1 + \left(t_1 + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\
t_3 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.96 \cdot 10^{+43}:\\
\;\;\;\;-t_3\\

\mathbf{elif}\;t \leq -8.3 \cdot 10^{-159}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -5.1 \cdot 10^{-169}:\\
\;\;\;\;-1\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-205}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

\mathbf{elif}\;t \leq 1.75 \cdot 10^{-162}:\\
\;\;\;\;1\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+99}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


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

    1. Initial program 24.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. Simplified24.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-rr76.6%

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

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

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

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

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

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

    if -1.9600000000000001e43 < t < -8.30000000000000047e-159 or 1.74999999999999995e-162 < t < 7.2000000000000003e99

    1. Initial program 55.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. Simplified55.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 85.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 0 85.0%

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

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

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

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

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

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

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

    if -8.30000000000000047e-159 < t < -5.09999999999999997e-169

    1. Initial program 22.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. Simplified22.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-rr67.8%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt100.0%

        \[\leadsto \color{blue}{-1} \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{-1} \]

    if -5.09999999999999997e-169 < t < 2.7000000000000001e-205

    1. Initial program 1.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. Simplified1.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 63.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. Taylor expanded in t around 0 63.8%

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

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

    if 2.7000000000000001e-205 < t < 1.74999999999999995e-162

    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. Applied egg-rr61.8%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 97.3%

      \[\leadsto \color{blue}{1} \]

    if 7.2000000000000003e99 < t

    1. Initial program 12.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. Simplified12.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-rr84.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.96 \cdot 10^{+43}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq -8.3 \cdot 10^{-159}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{elif}\;t \leq -5.1 \cdot 10^{-169}:\\ \;\;\;\;-1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-162}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+99}:\\ \;\;\;\;\frac{t}{\sqrt{\frac{\frac{{\ell}^{2}}{x} + \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \left(2 + \frac{2}{x}\right)\right)}{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 79.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq 1.5 \cdot 10^{-209}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

\mathbf{elif}\;t \leq 7 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-48}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.00000000000000001e-168

    1. Initial program 38.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. Simplified38.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-rr69.5%

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

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

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

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

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

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

    if -5.00000000000000001e-168 < t < 1.4999999999999999e-209

    1. Initial program 1.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. Simplified1.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 63.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. Taylor expanded in t around 0 63.8%

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

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

    if 1.4999999999999999e-209 < t < 7.0000000000000002e-88

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 74.7%

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

    if 7.0000000000000002e-88 < t < 1.04999999999999994e-48

    1. Initial program 15.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. Simplified15.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 2.3%

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999994e-48 < t

    1. Initial program 31.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. Simplified31.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-rr75.5%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. clear-num89.5%

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{1 + x}{x - 1}}}} \]
      3. metadata-eval89.5%

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    6. Applied egg-rr89.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-168}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-209}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-48}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{x + -1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 5: 79.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq 7 \cdot 10^{-212}:\\
\;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}} \cdot \sqrt{\frac{2}{x}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.39999999999999998e-170

    1. Initial program 38.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. Simplified38.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-rr69.5%

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

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

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

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

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

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

    if -1.39999999999999998e-170 < t < 6.9999999999999995e-212

    1. Initial program 1.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. Simplified1.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 63.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. Taylor expanded in t around 0 63.8%

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

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

    if 6.9999999999999995e-212 < t < 7.1999999999999999e-88

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 74.7%

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

    if 7.1999999999999999e-88 < t < 4.80000000000000004e-50

    1. Initial program 15.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. Simplified15.2%

      \[\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 l around inf 2.3%

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

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

    if 4.80000000000000004e-50 < t

    1. Initial program 31.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. Simplified31.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-rr75.5%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. clear-num89.5%

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{1 + x}{x - 1}}}} \]
      3. metadata-eval89.5%

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    6. Applied egg-rr89.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{-170}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-212}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}} \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 6: 79.4% accurate, 1.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{-167}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-206}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\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
 (let* ((t_1 (/ t (* l (sqrt (/ 1.0 x))))))
   (if (<= t -2.1e-167)
     (- (sqrt (/ (+ x -1.0) (+ x 1.0))))
     (if (<= t 3.8e-206)
       t_1
       (if (<= t 7.5e-88)
         (+ 1.0 (/ -1.0 x))
         (if (<= t 4.8e-50) t_1 (/ 1.0 (sqrt (/ (+ x 1.0) (+ x -1.0))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = t / (l * sqrt((1.0 / x)));
	double tmp;
	if (t <= -2.1e-167) {
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 3.8e-206) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 4.8e-50) {
		tmp = t_1;
	} else {
		tmp = 1.0 / 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) :: t_1
    real(8) :: tmp
    t_1 = t / (l * sqrt((1.0d0 / x)))
    if (t <= (-2.1d-167)) then
        tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    else if (t <= 3.8d-206) then
        tmp = t_1
    else if (t <= 7.5d-88) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t <= 4.8d-50) then
        tmp = t_1
    else
        tmp = 1.0d0 / 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 t_1 = t / (l * Math.sqrt((1.0 / x)));
	double tmp;
	if (t <= -2.1e-167) {
		tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 3.8e-206) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 4.8e-50) {
		tmp = t_1;
	} else {
		tmp = 1.0 / Math.sqrt(((x + 1.0) / (x + -1.0)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = t / (l * math.sqrt((1.0 / x)))
	tmp = 0
	if t <= -2.1e-167:
		tmp = -math.sqrt(((x + -1.0) / (x + 1.0)))
	elif t <= 3.8e-206:
		tmp = t_1
	elif t <= 7.5e-88:
		tmp = 1.0 + (-1.0 / x)
	elif t <= 4.8e-50:
		tmp = t_1
	else:
		tmp = 1.0 / math.sqrt(((x + 1.0) / (x + -1.0)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(t / Float64(l * sqrt(Float64(1.0 / x))))
	tmp = 0.0
	if (t <= -2.1e-167)
		tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))));
	elseif (t <= 3.8e-206)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t <= 4.8e-50)
		tmp = t_1;
	else
		tmp = Float64(1.0 / sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = t / (l * sqrt((1.0 / x)));
	tmp = 0.0;
	if (t <= -2.1e-167)
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	elseif (t <= 3.8e-206)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = 1.0 + (-1.0 / x);
	elseif (t <= 4.8e-50)
		tmp = t_1;
	else
		tmp = 1.0 / 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_] := Block[{t$95$1 = N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e-167], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 3.8e-206], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-50], t$95$1, N[(1.0 / N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-167}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-206}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.10000000000000017e-167

    1. Initial program 38.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. Simplified38.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-rr69.5%

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

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

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

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

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

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

    if -2.10000000000000017e-167 < t < 3.80000000000000003e-206 or 7.50000000000000041e-88 < t < 4.80000000000000004e-50

    1. Initial program 4.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. Simplified4.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 62.6%

      \[\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 0 62.6%

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

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

    if 3.80000000000000003e-206 < t < 7.50000000000000041e-88

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 74.7%

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

    if 4.80000000000000004e-50 < t

    1. Initial program 31.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. Simplified31.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-rr75.5%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Step-by-step derivation
      1. clear-num89.5%

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

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{1 + x}{x - 1}}}} \]
      3. metadata-eval89.5%

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    6. Applied egg-rr89.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-167}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-206}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}\\ \end{array} \]

Alternative 7: 79.1% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{if}\;t \leq -2.4 \cdot 10^{-169}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-49}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\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
 (let* ((t_1 (/ t (* l (sqrt (/ 1.0 x))))))
   (if (<= t -2.4e-169)
     (+ -1.0 (/ 1.0 x))
     (if (<= t 2.7e-207)
       t_1
       (if (<= t 7.5e-88)
         (+ 1.0 (/ -1.0 x))
         (if (<= t 2.3e-49) t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = t / (l * sqrt((1.0 / x)));
	double tmp;
	if (t <= -2.4e-169) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.7e-207) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 2.3e-49) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = t / (l * sqrt((1.0d0 / x)))
    if (t <= (-2.4d-169)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 2.7d-207) then
        tmp = t_1
    else if (t <= 7.5d-88) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t <= 2.3d-49) then
        tmp = t_1
    else
        tmp = 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 t_1 = t / (l * Math.sqrt((1.0 / x)));
	double tmp;
	if (t <= -2.4e-169) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.7e-207) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 2.3e-49) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = t / (l * math.sqrt((1.0 / x)))
	tmp = 0
	if t <= -2.4e-169:
		tmp = -1.0 + (1.0 / x)
	elif t <= 2.7e-207:
		tmp = t_1
	elif t <= 7.5e-88:
		tmp = 1.0 + (-1.0 / x)
	elif t <= 2.3e-49:
		tmp = t_1
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(t / Float64(l * sqrt(Float64(1.0 / x))))
	tmp = 0.0
	if (t <= -2.4e-169)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 2.7e-207)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t <= 2.3e-49)
		tmp = t_1;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = t / (l * sqrt((1.0 / x)));
	tmp = 0.0;
	if (t <= -2.4e-169)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 2.7e-207)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = 1.0 + (-1.0 / x);
	elseif (t <= 2.3e-49)
		tmp = t_1;
	else
		tmp = 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_] := Block[{t$95$1 = N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e-169], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-207], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-49], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-169}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.40000000000000011e-169

    1. Initial program 38.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. Simplified38.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-rr69.5%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{\frac{1}{x} + {\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}} \]
      2. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      3. rem-square-sqrt85.7%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    7. Simplified85.7%

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

    if -2.40000000000000011e-169 < t < 2.7e-207 or 7.50000000000000041e-88 < t < 2.2999999999999999e-49

    1. Initial program 4.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. Simplified4.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 62.6%

      \[\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 0 62.6%

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

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

    if 2.7e-207 < t < 7.50000000000000041e-88

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 74.7%

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

    if 2.2999999999999999e-49 < t

    1. Initial program 31.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. Simplified31.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-rr75.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{-169}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-207}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-49}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 8: 79.4% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ t_2 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -6.5 \cdot 10^{-171}:\\ \;\;\;\;-t_2\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ t (* l (sqrt (/ 1.0 x)))))
        (t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -6.5e-171)
     (- t_2)
     (if (<= t 2.6e-207)
       t_1
       (if (<= t 7.5e-88) (+ 1.0 (/ -1.0 x)) (if (<= t 4.8e-50) t_1 t_2))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = t / (l * sqrt((1.0 / x)));
	double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -6.5e-171) {
		tmp = -t_2;
	} else if (t <= 2.6e-207) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 4.8e-50) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = t / (l * sqrt((1.0d0 / x)))
    t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-6.5d-171)) then
        tmp = -t_2
    else if (t <= 2.6d-207) then
        tmp = t_1
    else if (t <= 7.5d-88) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t <= 4.8d-50) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = t / (l * Math.sqrt((1.0 / x)));
	double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -6.5e-171) {
		tmp = -t_2;
	} else if (t <= 2.6e-207) {
		tmp = t_1;
	} else if (t <= 7.5e-88) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t <= 4.8e-50) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = t / (l * math.sqrt((1.0 / x)))
	t_2 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -6.5e-171:
		tmp = -t_2
	elif t <= 2.6e-207:
		tmp = t_1
	elif t <= 7.5e-88:
		tmp = 1.0 + (-1.0 / x)
	elif t <= 4.8e-50:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(t / Float64(l * sqrt(Float64(1.0 / x))))
	t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -6.5e-171)
		tmp = Float64(-t_2);
	elseif (t <= 2.6e-207)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t <= 4.8e-50)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = t / (l * sqrt((1.0 / x)));
	t_2 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -6.5e-171)
		tmp = -t_2;
	elseif (t <= 2.6e-207)
		tmp = t_1;
	elseif (t <= 7.5e-88)
		tmp = 1.0 + (-1.0 / x);
	elseif (t <= 4.8e-50)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t / N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6.5e-171], (-t$95$2), If[LessEqual[t, 2.6e-207], t$95$1, If[LessEqual[t, 7.5e-88], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-50], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-171}:\\
\;\;\;\;-t_2\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.5000000000000004e-171

    1. Initial program 38.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. Simplified38.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-rr69.5%

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

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

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

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

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

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

    if -6.5000000000000004e-171 < t < 2.5999999999999999e-207 or 7.50000000000000041e-88 < t < 4.80000000000000004e-50

    1. Initial program 4.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. Simplified4.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 62.6%

      \[\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 0 62.6%

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

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

    if 2.5999999999999999e-207 < t < 7.50000000000000041e-88

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 74.7%

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

    if 4.80000000000000004e-50 < t

    1. Initial program 31.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. Simplified31.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-rr75.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{-171}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-207}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-88}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{t}{\ell \cdot \sqrt{\frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 9: 76.8% accurate, 2.1× speedup?

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

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


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

    1. Initial program 33.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. Simplified33.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-rr65.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{\frac{1}{x} + {\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}} \]
      2. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      3. rem-square-sqrt77.9%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    7. Simplified77.9%

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

    if -5.00000000000023e-311 < t

    1. Initial program 29.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. Simplified29.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{\frac{t}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}}{{2}^{-0.5}}} \]
    4. Taylor expanded in t around inf 78.9%

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

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

Alternative 10: 76.1% accurate, 31.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 33.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. Simplified33.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-rr65.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{\frac{1}{x} + {\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}} \]
      2. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      3. rem-square-sqrt77.9%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    7. Simplified77.9%

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

    if -5.00000000000023e-311 < t

    1. Initial program 29.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. Simplified29.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{\frac{t}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}}{{2}^{-0.5}}} \]
    4. Taylor expanded in t around inf 78.9%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 77.9%

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

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

Alternative 11: 76.5% accurate, 31.9× speedup?

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

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


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

    1. Initial program 33.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. Simplified33.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-rr65.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{\frac{1}{x} + {\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}} \]
      2. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      3. rem-square-sqrt77.9%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    7. Simplified77.9%

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

    if -5.00000000000023e-311 < t

    1. Initial program 29.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. Simplified29.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{\frac{t}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}}{{2}^{-0.5}}} \]
    4. Taylor expanded in t around inf 78.9%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 78.5%

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

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

Alternative 12: 75.8% accurate, 73.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 (if (<= t -5e-311) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-311) {
		tmp = -1.0;
	} else {
		tmp = 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 <= (-5d-311)) then
        tmp = -1.0d0
    else
        tmp = 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 <= -5e-311) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-311:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-311)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -5e-311)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := If[LessEqual[t, -5e-311], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-1\\

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 33.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. Simplified33.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-rr65.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around -inf 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    6. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt77.1%

        \[\leadsto \color{blue}{-1} \]
    7. Simplified77.1%

      \[\leadsto \color{blue}{-1} \]

    if -5.00000000000023e-311 < t

    1. Initial program 29.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. Simplified29.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{\frac{t}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}}{{2}^{-0.5}}} \]
    4. Taylor expanded in t around inf 78.9%

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    5. Taylor expanded in x around inf 77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 37.6% accurate, 225.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ -1 \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t) :precision binary64 -1.0)
l = abs(l);
double code(double x, double l, double t) {
	return -1.0;
}
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 = -1.0d0
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
	return -1.0;
}
l = abs(l)
def code(x, l, t):
	return -1.0
l = abs(l)
function code(x, l, t)
	return -1.0
end
l = abs(l)
function tmp = code(x, l, t)
	tmp = -1.0;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := -1.0
\begin{array}{l}
l = |l|\\
\\
-1
\end{array}
Derivation
  1. Initial program 31.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. Simplified31.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-rr66.8%

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

    \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  5. Taylor expanded in x around -inf 0.0%

    \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
  6. Step-by-step derivation
    1. unpow20.0%

      \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
    2. rem-square-sqrt42.6%

      \[\leadsto \color{blue}{-1} \]
  7. Simplified42.6%

    \[\leadsto \color{blue}{-1} \]
  8. Final simplification42.6%

    \[\leadsto -1 \]

Reproduce

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