Toniolo and Linder, Equation (7)

Percentage Accurate: 33.3% → 82.3%
Time: 32.3s
Alternatives: 25
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 25 alternatives:

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

Initial Program: 33.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (/
  (* (sqrt 2.0) t)
  (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
	return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
	return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t):
	return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t)
	return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l))))
end
function tmp = code(x, l, t)
	tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}

Alternative 1: 82.3% accurate, 0.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 \cdot {t}^{2}\\ t_2 := t_1 + {\ell}^{2}\\ t_3 := \frac{{\ell}^{2}}{x}\\ t_4 := \frac{x + 1}{x + -1}\\ t_5 := \frac{t_2}{x}\\ t_6 := \sqrt{2} \cdot t\\ t_7 := \frac{t_6}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_4 - \ell \cdot \ell}}\\ t_8 := 2 \cdot \frac{{t}^{2}}{x}\\ \mathbf{if}\;t_7 \leq -5 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_2 + t_2}{{x}^{2}} + \left(t_8 + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_1 + \left(t_3 + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(t_5 + \frac{t_2}{{x}^{3}}\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;t_7 \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_6}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_6\right) \cdot \sqrt{t_4}, \ell\right)}\right)\right)\\ \mathbf{elif}\;t_7 \leq \infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{t_5 + \left(t_8 + \left(t_1 + t_3\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (* 2.0 (pow t 2.0)))
        (t_2 (+ t_1 (pow l 2.0)))
        (t_3 (/ (pow l 2.0) x))
        (t_4 (/ (+ x 1.0) (+ x -1.0)))
        (t_5 (/ t_2 x))
        (t_6 (* (sqrt 2.0) t))
        (t_7 (/ t_6 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_4) (* l l)))))
        (t_8 (* 2.0 (/ (pow t 2.0) x))))
   (if (<= t_7 -5e-226)
     (/
      t
      (/
       (sqrt
        (+
         (+
          (/ (+ t_2 t_2) (pow x 2.0))
          (+
           t_8
           (+
            (* 2.0 (/ (pow t 2.0) (pow x 3.0)))
            (+ t_1 (+ t_3 (/ (pow l 2.0) (pow x 3.0)))))))
         (+ t_5 (/ t_2 (pow x 3.0)))))
       (sqrt 2.0)))
     (if (<= t_7 0.99999)
       (log1p (expm1 (/ t_6 (hypot (* (hypot l t_6) (sqrt t_4)) l))))
       (if (<= t_7 INFINITY)
         (/ t (/ (sqrt (+ t_5 (+ t_8 (+ t_1 t_3)))) (sqrt 2.0)))
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 * pow(t, 2.0);
	double t_2 = t_1 + pow(l, 2.0);
	double t_3 = pow(l, 2.0) / x;
	double t_4 = (x + 1.0) / (x + -1.0);
	double t_5 = t_2 / x;
	double t_6 = sqrt(2.0) * t;
	double t_7 = t_6 / sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l)));
	double t_8 = 2.0 * (pow(t, 2.0) / x);
	double tmp;
	if (t_7 <= -5e-226) {
		tmp = t / (sqrt(((((t_2 + t_2) / pow(x, 2.0)) + (t_8 + ((2.0 * (pow(t, 2.0) / pow(x, 3.0))) + (t_1 + (t_3 + (pow(l, 2.0) / pow(x, 3.0))))))) + (t_5 + (t_2 / pow(x, 3.0))))) / sqrt(2.0));
	} else if (t_7 <= 0.99999) {
		tmp = log1p(expm1((t_6 / hypot((hypot(l, t_6) * sqrt(t_4)), l))));
	} else if (t_7 <= ((double) INFINITY)) {
		tmp = t / (sqrt((t_5 + (t_8 + (t_1 + t_3)))) / sqrt(2.0));
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = 2.0 * Math.pow(t, 2.0);
	double t_2 = t_1 + Math.pow(l, 2.0);
	double t_3 = Math.pow(l, 2.0) / x;
	double t_4 = (x + 1.0) / (x + -1.0);
	double t_5 = t_2 / x;
	double t_6 = Math.sqrt(2.0) * t;
	double t_7 = t_6 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l)));
	double t_8 = 2.0 * (Math.pow(t, 2.0) / x);
	double tmp;
	if (t_7 <= -5e-226) {
		tmp = t / (Math.sqrt(((((t_2 + t_2) / Math.pow(x, 2.0)) + (t_8 + ((2.0 * (Math.pow(t, 2.0) / Math.pow(x, 3.0))) + (t_1 + (t_3 + (Math.pow(l, 2.0) / Math.pow(x, 3.0))))))) + (t_5 + (t_2 / Math.pow(x, 3.0))))) / Math.sqrt(2.0));
	} else if (t_7 <= 0.99999) {
		tmp = Math.log1p(Math.expm1((t_6 / Math.hypot((Math.hypot(l, t_6) * Math.sqrt(t_4)), l))));
	} else if (t_7 <= Double.POSITIVE_INFINITY) {
		tmp = t / (Math.sqrt((t_5 + (t_8 + (t_1 + t_3)))) / Math.sqrt(2.0));
	} else {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = 2.0 * math.pow(t, 2.0)
	t_2 = t_1 + math.pow(l, 2.0)
	t_3 = math.pow(l, 2.0) / x
	t_4 = (x + 1.0) / (x + -1.0)
	t_5 = t_2 / x
	t_6 = math.sqrt(2.0) * t
	t_7 = t_6 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_4) - (l * l)))
	t_8 = 2.0 * (math.pow(t, 2.0) / x)
	tmp = 0
	if t_7 <= -5e-226:
		tmp = t / (math.sqrt(((((t_2 + t_2) / math.pow(x, 2.0)) + (t_8 + ((2.0 * (math.pow(t, 2.0) / math.pow(x, 3.0))) + (t_1 + (t_3 + (math.pow(l, 2.0) / math.pow(x, 3.0))))))) + (t_5 + (t_2 / math.pow(x, 3.0))))) / math.sqrt(2.0))
	elif t_7 <= 0.99999:
		tmp = math.log1p(math.expm1((t_6 / math.hypot((math.hypot(l, t_6) * math.sqrt(t_4)), l))))
	elif t_7 <= math.inf:
		tmp = t / (math.sqrt((t_5 + (t_8 + (t_1 + t_3)))) / math.sqrt(2.0))
	else:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0)))))))))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 * (t ^ 2.0))
	t_2 = Float64(t_1 + (l ^ 2.0))
	t_3 = Float64((l ^ 2.0) / x)
	t_4 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_5 = Float64(t_2 / x)
	t_6 = Float64(sqrt(2.0) * t)
	t_7 = Float64(t_6 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_4) - Float64(l * l))))
	t_8 = Float64(2.0 * Float64((t ^ 2.0) / x))
	tmp = 0.0
	if (t_7 <= -5e-226)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_2 + t_2) / (x ^ 2.0)) + Float64(t_8 + Float64(Float64(2.0 * Float64((t ^ 2.0) / (x ^ 3.0))) + Float64(t_1 + Float64(t_3 + Float64((l ^ 2.0) / (x ^ 3.0))))))) + Float64(t_5 + Float64(t_2 / (x ^ 3.0))))) / sqrt(2.0)));
	elseif (t_7 <= 0.99999)
		tmp = log1p(expm1(Float64(t_6 / hypot(Float64(hypot(l, t_6) * sqrt(t_4)), l))));
	elseif (t_7 <= Inf)
		tmp = Float64(t / Float64(sqrt(Float64(t_5 + Float64(t_8 + Float64(t_1 + t_3)))) / sqrt(2.0)));
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / x), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, -5e-226], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$2 + t$95$2), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$8 + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$3 + N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + N[(t$95$2 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 0.99999], N[Log[1 + N[(Exp[N[(t$95$6 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$6 ^ 2], $MachinePrecision] * N[Sqrt[t$95$4], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$7, Infinity], N[(t / N[(N[Sqrt[N[(t$95$5 + N[(t$95$8 + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
t_2 := t_1 + {\ell}^{2}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \frac{x + 1}{x + -1}\\
t_5 := \frac{t_2}{x}\\
t_6 := \sqrt{2} \cdot t\\
t_7 := \frac{t_6}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_4 - \ell \cdot \ell}}\\
t_8 := 2 \cdot \frac{{t}^{2}}{x}\\
\mathbf{if}\;t_7 \leq -5 \cdot 10^{-226}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_2 + t_2}{{x}^{2}} + \left(t_8 + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(t_1 + \left(t_3 + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(t_5 + \frac{t_2}{{x}^{3}}\right)}}{\sqrt{2}}}\\

\mathbf{elif}\;t_7 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_6}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_6\right) \cdot \sqrt{t_4}, \ell\right)}\right)\right)\\

\mathbf{elif}\;t_7 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_5 + \left(t_8 + \left(t_1 + t_3\right)\right)}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -4.9999999999999998e-226

    1. Initial program 54.5%

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

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

    if -4.9999999999999998e-226 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

    1. Initial program 8.4%

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

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

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}\right)\right)} \]

    if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 60.9%

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

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -5 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{\left(2 \cdot {t}^{2} + {\ell}^{2}\right) + \left(2 \cdot {t}^{2} + {\ell}^{2}\right)}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{{x}^{3}} + \left(2 \cdot {t}^{2} + \left(\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{{x}^{3}}\right)\right)\right)\right)\right) + \left(\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{{x}^{3}}\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sqrt{2} \cdot t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)}\right)\right)\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 2: 82.3% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{x + 1}{x + -1}\\ t_2 := 2 \cdot {t}^{2}\\ t_3 := t_2 + {\ell}^{2}\\ t_4 := \frac{t_3}{x}\\ t_5 := \sqrt{2} \cdot t\\ t_6 := \frac{t_5}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\ t_7 := 2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\\ \mathbf{if}\;t_6 \leq -5 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{t_4 + \left(\frac{t_3 + t_3}{{x}^{2}} + t_7\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;t_6 \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_5}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_5\right) \cdot \sqrt{t_1}, \ell\right)}\right)\right)\\ \mathbf{elif}\;t_6 \leq \infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{t_4 + t_7}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
        (t_2 (* 2.0 (pow t 2.0)))
        (t_3 (+ t_2 (pow l 2.0)))
        (t_4 (/ t_3 x))
        (t_5 (* (sqrt 2.0) t))
        (t_6 (/ t_5 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
        (t_7 (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_2 (/ (pow l 2.0) x)))))
   (if (<= t_6 -5e-226)
     (/ t (/ (sqrt (+ t_4 (+ (/ (+ t_3 t_3) (pow x 2.0)) t_7))) (sqrt 2.0)))
     (if (<= t_6 0.99999)
       (log1p (expm1 (/ t_5 (hypot (* (hypot l t_5) (sqrt t_1)) l))))
       (if (<= t_6 INFINITY)
         (/ t (/ (sqrt (+ t_4 t_7)) (sqrt 2.0)))
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = 2.0 * pow(t, 2.0);
	double t_3 = t_2 + pow(l, 2.0);
	double t_4 = t_3 / x;
	double t_5 = sqrt(2.0) * t;
	double t_6 = t_5 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_7 = (2.0 * (pow(t, 2.0) / x)) + (t_2 + (pow(l, 2.0) / x));
	double tmp;
	if (t_6 <= -5e-226) {
		tmp = t / (sqrt((t_4 + (((t_3 + t_3) / pow(x, 2.0)) + t_7))) / sqrt(2.0));
	} else if (t_6 <= 0.99999) {
		tmp = log1p(expm1((t_5 / hypot((hypot(l, t_5) * sqrt(t_1)), l))));
	} else if (t_6 <= ((double) INFINITY)) {
		tmp = t / (sqrt((t_4 + t_7)) / sqrt(2.0));
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = 2.0 * Math.pow(t, 2.0);
	double t_3 = t_2 + Math.pow(l, 2.0);
	double t_4 = t_3 / x;
	double t_5 = Math.sqrt(2.0) * t;
	double t_6 = t_5 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_7 = (2.0 * (Math.pow(t, 2.0) / x)) + (t_2 + (Math.pow(l, 2.0) / x));
	double tmp;
	if (t_6 <= -5e-226) {
		tmp = t / (Math.sqrt((t_4 + (((t_3 + t_3) / Math.pow(x, 2.0)) + t_7))) / Math.sqrt(2.0));
	} else if (t_6 <= 0.99999) {
		tmp = Math.log1p(Math.expm1((t_5 / Math.hypot((Math.hypot(l, t_5) * Math.sqrt(t_1)), l))));
	} else if (t_6 <= Double.POSITIVE_INFINITY) {
		tmp = t / (Math.sqrt((t_4 + t_7)) / Math.sqrt(2.0));
	} else {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (x + 1.0) / (x + -1.0)
	t_2 = 2.0 * math.pow(t, 2.0)
	t_3 = t_2 + math.pow(l, 2.0)
	t_4 = t_3 / x
	t_5 = math.sqrt(2.0) * t
	t_6 = t_5 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)))
	t_7 = (2.0 * (math.pow(t, 2.0) / x)) + (t_2 + (math.pow(l, 2.0) / x))
	tmp = 0
	if t_6 <= -5e-226:
		tmp = t / (math.sqrt((t_4 + (((t_3 + t_3) / math.pow(x, 2.0)) + t_7))) / math.sqrt(2.0))
	elif t_6 <= 0.99999:
		tmp = math.log1p(math.expm1((t_5 / math.hypot((math.hypot(l, t_5) * math.sqrt(t_1)), l))))
	elif t_6 <= math.inf:
		tmp = t / (math.sqrt((t_4 + t_7)) / math.sqrt(2.0))
	else:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0)))))))))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_2 = Float64(2.0 * (t ^ 2.0))
	t_3 = Float64(t_2 + (l ^ 2.0))
	t_4 = Float64(t_3 / x)
	t_5 = Float64(sqrt(2.0) * t)
	t_6 = Float64(t_5 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l))))
	t_7 = Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_2 + Float64((l ^ 2.0) / x)))
	tmp = 0.0
	if (t_6 <= -5e-226)
		tmp = Float64(t / Float64(sqrt(Float64(t_4 + Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + t_7))) / sqrt(2.0)));
	elseif (t_6 <= 0.99999)
		tmp = log1p(expm1(Float64(t_5 / hypot(Float64(hypot(l, t_5) * sqrt(t_1)), l))));
	elseif (t_6 <= Inf)
		tmp = Float64(t / Float64(sqrt(Float64(t_4 + t_7)) / sqrt(2.0)));
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / x), $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -5e-226], N[(t / N[(N[Sqrt[N[(t$95$4 + N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 0.99999], N[Log[1 + N[(Exp[N[(t$95$5 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$5 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$6, Infinity], N[(t / N[(N[Sqrt[N[(t$95$4 + t$95$7), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := 2 \cdot {t}^{2}\\
t_3 := t_2 + {\ell}^{2}\\
t_4 := \frac{t_3}{x}\\
t_5 := \sqrt{2} \cdot t\\
t_6 := \frac{t_5}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_7 := 2 \cdot \frac{{t}^{2}}{x} + \left(t_2 + \frac{{\ell}^{2}}{x}\right)\\
\mathbf{if}\;t_6 \leq -5 \cdot 10^{-226}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_4 + \left(\frac{t_3 + t_3}{{x}^{2}} + t_7\right)}}{\sqrt{2}}}\\

\mathbf{elif}\;t_6 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_5}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_5\right) \cdot \sqrt{t_1}, \ell\right)}\right)\right)\\

\mathbf{elif}\;t_6 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_4 + t_7}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -4.9999999999999998e-226

    1. Initial program 54.5%

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

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

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

    if -4.9999999999999998e-226 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

    1. Initial program 8.4%

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

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

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}\right)\right)} \]

    if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 60.9%

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

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -5 \cdot 10^{-226}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(\frac{\left(2 \cdot {t}^{2} + {\ell}^{2}\right) + \left(2 \cdot {t}^{2} + {\ell}^{2}\right)}{{x}^{2}} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sqrt{2} \cdot t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)}\right)\right)\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 3: 82.0% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 \cdot {t}^{2}\\ t_2 := \frac{x + 1}{x + -1}\\ t_3 := \sqrt{2} \cdot t\\ t_4 := \frac{t_3}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_2 - \ell \cdot \ell}}\\ t_5 := \frac{t}{\frac{\sqrt{\frac{t_1 + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_4 \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot \sqrt{t_2}, \ell\right)}\right)\right)\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (* 2.0 (pow t 2.0)))
        (t_2 (/ (+ x 1.0) (+ x -1.0)))
        (t_3 (* (sqrt 2.0) t))
        (t_4 (/ t_3 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_2) (* l l)))))
        (t_5
         (/
          t
          (/
           (sqrt
            (+
             (/ (+ t_1 (pow l 2.0)) x)
             (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 (/ (pow l 2.0) x)))))
           (sqrt 2.0)))))
   (if (<= t_4 (- INFINITY))
     t_5
     (if (<= t_4 0.99999)
       (log1p (expm1 (/ t_3 (hypot (* (hypot l t_3) (sqrt t_2)) l))))
       (if (<= t_4 INFINITY)
         t_5
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 * pow(t, 2.0);
	double t_2 = (x + 1.0) / (x + -1.0);
	double t_3 = sqrt(2.0) * t;
	double t_4 = t_3 / sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)));
	double t_5 = t / (sqrt((((t_1 + pow(l, 2.0)) / x) + ((2.0 * (pow(t, 2.0) / x)) + (t_1 + (pow(l, 2.0) / x))))) / sqrt(2.0));
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = t_5;
	} else if (t_4 <= 0.99999) {
		tmp = log1p(expm1((t_3 / hypot((hypot(l, t_3) * sqrt(t_2)), l))));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = t_5;
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = 2.0 * Math.pow(t, 2.0);
	double t_2 = (x + 1.0) / (x + -1.0);
	double t_3 = Math.sqrt(2.0) * t;
	double t_4 = t_3 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)));
	double t_5 = t / (Math.sqrt((((t_1 + Math.pow(l, 2.0)) / x) + ((2.0 * (Math.pow(t, 2.0) / x)) + (t_1 + (Math.pow(l, 2.0) / x))))) / Math.sqrt(2.0));
	double tmp;
	if (t_4 <= -Double.POSITIVE_INFINITY) {
		tmp = t_5;
	} else if (t_4 <= 0.99999) {
		tmp = Math.log1p(Math.expm1((t_3 / Math.hypot((Math.hypot(l, t_3) * Math.sqrt(t_2)), l))));
	} else if (t_4 <= Double.POSITIVE_INFINITY) {
		tmp = t_5;
	} else {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = 2.0 * math.pow(t, 2.0)
	t_2 = (x + 1.0) / (x + -1.0)
	t_3 = math.sqrt(2.0) * t
	t_4 = t_3 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_2) - (l * l)))
	t_5 = t / (math.sqrt((((t_1 + math.pow(l, 2.0)) / x) + ((2.0 * (math.pow(t, 2.0) / x)) + (t_1 + (math.pow(l, 2.0) / x))))) / math.sqrt(2.0))
	tmp = 0
	if t_4 <= -math.inf:
		tmp = t_5
	elif t_4 <= 0.99999:
		tmp = math.log1p(math.expm1((t_3 / math.hypot((math.hypot(l, t_3) * math.sqrt(t_2)), l))))
	elif t_4 <= math.inf:
		tmp = t_5
	else:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0)))))))))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 * (t ^ 2.0))
	t_2 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_3 = Float64(sqrt(2.0) * t)
	t_4 = Float64(t_3 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_2) - Float64(l * l))))
	t_5 = Float64(t / Float64(sqrt(Float64(Float64(Float64(t_1 + (l ^ 2.0)) / x) + Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + Float64((l ^ 2.0) / x))))) / sqrt(2.0)))
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = t_5;
	elseif (t_4 <= 0.99999)
		tmp = log1p(expm1(Float64(t_3 / hypot(Float64(hypot(l, t_3) * sqrt(t_2)), l))));
	elseif (t_4 <= Inf)
		tmp = t_5;
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t / N[(N[Sqrt[N[(N[(N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, 0.99999], N[Log[1 + N[(Exp[N[(t$95$3 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
t_2 := \frac{x + 1}{x + -1}\\
t_3 := \sqrt{2} \cdot t\\
t_4 := \frac{t_3}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_2 - \ell \cdot \ell}}\\
t_5 := \frac{t}{\frac{\sqrt{\frac{t_1 + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t_4 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot \sqrt{t_2}, \ell\right)}\right)\right)\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -inf.0 or 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 44.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. Simplified44.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 81.0%

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

    if -inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

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

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}\right)\right)} \]

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -\infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sqrt{2} \cdot t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)}\right)\right)\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\frac{2 \cdot {t}^{2} + {\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 4: 80.4% accurate, 0.2× speedup?

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

\mathbf{elif}\;t_4 \leq 0.99999:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot t_5, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{t}{t + 0.5 \cdot \frac{t_1 + t_1}{t \cdot \left(2 \cdot x\right)}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

    if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

    1. Initial program 10.4%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified10.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. Applied egg-rr95.0%

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

    if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -0.5:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{t + 0.5 \cdot \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right) + \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{t \cdot \left(2 \cdot x\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 5: 80.7% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{x + 1}{x + -1}\\ t_2 := \sqrt{2} \cdot t\\ t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\ t_4 := \sqrt{t_1}\\ t_5 := \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)\\ \mathbf{if}\;t_3 \leq -1:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\ \mathbf{elif}\;t_3 \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)}\right)\right)\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{t}{t + 0.5 \cdot \frac{t_5 + t_5}{t \cdot \left(2 \cdot x\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
        (t_2 (* (sqrt 2.0) t))
        (t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
        (t_4 (sqrt t_1))
        (t_5 (fma 2.0 (pow t 2.0) (pow l 2.0))))
   (if (<= t_3 -1.0)
     (/ t (* (- t) t_4))
     (if (<= t_3 0.99999)
       (log1p (expm1 (/ t_2 (hypot (* (hypot l t_2) t_4) l))))
       (if (<= t_3 INFINITY)
         (/ t (+ t (* 0.5 (/ (+ t_5 t_5) (* t (* 2.0 x))))))
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = sqrt(2.0) * t;
	double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_4 = sqrt(t_1);
	double t_5 = fma(2.0, pow(t, 2.0), pow(l, 2.0));
	double tmp;
	if (t_3 <= -1.0) {
		tmp = t / (-t * t_4);
	} else if (t_3 <= 0.99999) {
		tmp = log1p(expm1((t_2 / hypot((hypot(l, t_2) * t_4), l))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t / (t + (0.5 * ((t_5 + t_5) / (t * (2.0 * x)))));
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_2 = Float64(sqrt(2.0) * t)
	t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l))))
	t_4 = sqrt(t_1)
	t_5 = fma(2.0, (t ^ 2.0), (l ^ 2.0))
	tmp = 0.0
	if (t_3 <= -1.0)
		tmp = Float64(t / Float64(Float64(-t) * t_4));
	elseif (t_3 <= 0.99999)
		tmp = log1p(expm1(Float64(t_2 / hypot(Float64(hypot(l, t_2) * t_4), l))));
	elseif (t_3 <= Inf)
		tmp = Float64(t / Float64(t + Float64(0.5 * Float64(Float64(t_5 + t_5) / Float64(t * Float64(2.0 * x))))));
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * N[Power[t, 2.0], $MachinePrecision] + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1.0], N[(t / N[((-t) * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.99999], N[Log[1 + N[(Exp[N[(t$95$2 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * t$95$4), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t / N[(t + N[(0.5 * N[(N[(t$95$5 + t$95$5), $MachinePrecision] / N[(t * N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \sqrt{t_1}\\
t_5 := \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)\\
\mathbf{if}\;t_3 \leq -1:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\

\mathbf{elif}\;t_3 \leq 0.99999:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)}\right)\right)\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{t}{t + 0.5 \cdot \frac{t_5 + t_5}{t \cdot \left(2 \cdot x\right)}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1

    1. Initial program 52.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. Simplified52.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 t around -inf 79.7%

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

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

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

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

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

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

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

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

    if -1 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

    1. Initial program 11.5%

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

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

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{t \cdot \sqrt{2}}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)}\right)\right)} \]

    if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -1:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\sqrt{2} \cdot t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)}\right)\right)\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{t + 0.5 \cdot \frac{\mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right) + \mathsf{fma}\left(2, {t}^{2}, {\ell}^{2}\right)}{t \cdot \left(2 \cdot x\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 6: 80.4% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{x + 1}{x + -1}\\ t_2 := \sqrt{t_1}\\ t_3 := \frac{{\ell}^{2}}{x}\\ t_4 := \sqrt{2} \cdot t\\ t_5 := \frac{t_4}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\ t_6 := 2 + \frac{1}{x} \cdot 4\\ \mathbf{if}\;t_5 \leq -0.5:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\ \mathbf{elif}\;t_5 \leq 0.99999:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_4\right) \cdot t_2, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\ \mathbf{elif}\;t_5 \leq \infty:\\ \;\;\;\;\frac{t}{\frac{0.5 \cdot \left(\frac{t_3 + t_3}{t} \cdot \sqrt{\frac{1}{t_6}}\right) + t \cdot \sqrt{t_6}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
        (t_2 (sqrt t_1))
        (t_3 (/ (pow l 2.0) x))
        (t_4 (* (sqrt 2.0) t))
        (t_5 (/ t_4 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
        (t_6 (+ 2.0 (* (/ 1.0 x) 4.0))))
   (if (<= t_5 -0.5)
     (/ t (* (- t) t_2))
     (if (<= t_5 0.99999)
       (* (/ 1.0 (hypot (* (hypot l t_4) t_2) l)) (/ t (pow 2.0 -0.5)))
       (if (<= t_5 INFINITY)
         (/
          t
          (/
           (+
            (* 0.5 (* (/ (+ t_3 t_3) t) (sqrt (/ 1.0 t_6))))
            (* t (sqrt t_6)))
           (sqrt 2.0)))
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = sqrt(t_1);
	double t_3 = pow(l, 2.0) / x;
	double t_4 = sqrt(2.0) * t;
	double t_5 = t_4 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_6 = 2.0 + ((1.0 / x) * 4.0);
	double tmp;
	if (t_5 <= -0.5) {
		tmp = t / (-t * t_2);
	} else if (t_5 <= 0.99999) {
		tmp = (1.0 / hypot((hypot(l, t_4) * t_2), l)) * (t / pow(2.0, -0.5));
	} else if (t_5 <= ((double) INFINITY)) {
		tmp = t / (((0.5 * (((t_3 + t_3) / t) * sqrt((1.0 / t_6)))) + (t * sqrt(t_6))) / sqrt(2.0));
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = Math.sqrt(t_1);
	double t_3 = Math.pow(l, 2.0) / x;
	double t_4 = Math.sqrt(2.0) * t;
	double t_5 = t_4 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_6 = 2.0 + ((1.0 / x) * 4.0);
	double tmp;
	if (t_5 <= -0.5) {
		tmp = t / (-t * t_2);
	} else if (t_5 <= 0.99999) {
		tmp = (1.0 / Math.hypot((Math.hypot(l, t_4) * t_2), l)) * (t / Math.pow(2.0, -0.5));
	} else if (t_5 <= Double.POSITIVE_INFINITY) {
		tmp = t / (((0.5 * (((t_3 + t_3) / t) * Math.sqrt((1.0 / t_6)))) + (t * Math.sqrt(t_6))) / Math.sqrt(2.0));
	} else {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (x + 1.0) / (x + -1.0)
	t_2 = math.sqrt(t_1)
	t_3 = math.pow(l, 2.0) / x
	t_4 = math.sqrt(2.0) * t
	t_5 = t_4 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)))
	t_6 = 2.0 + ((1.0 / x) * 4.0)
	tmp = 0
	if t_5 <= -0.5:
		tmp = t / (-t * t_2)
	elif t_5 <= 0.99999:
		tmp = (1.0 / math.hypot((math.hypot(l, t_4) * t_2), l)) * (t / math.pow(2.0, -0.5))
	elif t_5 <= math.inf:
		tmp = t / (((0.5 * (((t_3 + t_3) / t) * math.sqrt((1.0 / t_6)))) + (t * math.sqrt(t_6))) / math.sqrt(2.0))
	else:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0)))))))))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_2 = sqrt(t_1)
	t_3 = Float64((l ^ 2.0) / x)
	t_4 = Float64(sqrt(2.0) * t)
	t_5 = Float64(t_4 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l))))
	t_6 = Float64(2.0 + Float64(Float64(1.0 / x) * 4.0))
	tmp = 0.0
	if (t_5 <= -0.5)
		tmp = Float64(t / Float64(Float64(-t) * t_2));
	elseif (t_5 <= 0.99999)
		tmp = Float64(Float64(1.0 / hypot(Float64(hypot(l, t_4) * t_2), l)) * Float64(t / (2.0 ^ -0.5)));
	elseif (t_5 <= Inf)
		tmp = Float64(t / Float64(Float64(Float64(0.5 * Float64(Float64(Float64(t_3 + t_3) / t) * sqrt(Float64(1.0 / t_6)))) + Float64(t * sqrt(t_6))) / sqrt(2.0)));
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (x + 1.0) / (x + -1.0);
	t_2 = sqrt(t_1);
	t_3 = (l ^ 2.0) / x;
	t_4 = sqrt(2.0) * t;
	t_5 = t_4 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	t_6 = 2.0 + ((1.0 / x) * 4.0);
	tmp = 0.0;
	if (t_5 <= -0.5)
		tmp = t / (-t * t_2);
	elseif (t_5 <= 0.99999)
		tmp = (1.0 / hypot((hypot(l, t_4) * t_2), l)) * (t / (2.0 ^ -0.5));
	elseif (t_5 <= Inf)
		tmp = t / (((0.5 * (((t_3 + t_3) / t) * sqrt((1.0 / t_6)))) + (t * sqrt(t_6))) / sqrt(2.0));
	else
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / (x ^ 3.0)) + (1.0 / (x ^ 4.0)))))))));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(2.0 + N[(N[(1.0 / x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -0.5], N[(t / N[((-t) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.99999], N[(N[(1.0 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$4 ^ 2], $MachinePrecision] * t$95$2), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t / N[(N[(N[(0.5 * N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / t), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[t$95$6], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{t_1}\\
t_3 := \frac{{\ell}^{2}}{x}\\
t_4 := \sqrt{2} \cdot t\\
t_5 := \frac{t_4}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_6 := 2 + \frac{1}{x} \cdot 4\\
\mathbf{if}\;t_5 \leq -0.5:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_2}\\

\mathbf{elif}\;t_5 \leq 0.99999:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_4\right) \cdot t_2, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\

\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{t}{\frac{0.5 \cdot \left(\frac{t_3 + t_3}{t} \cdot \sqrt{\frac{1}{t_6}}\right) + t \cdot \sqrt{t_6}}{\sqrt{2}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

    if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.999990000000000046

    1. Initial program 10.4%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified10.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. Applied egg-rr95.0%

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

    if 0.999990000000000046 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 60.9%

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

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

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -0.5:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 0.99999:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\frac{t}{\frac{0.5 \cdot \left(\frac{\frac{{\ell}^{2}}{x} + \frac{{\ell}^{2}}{x}}{t} \cdot \sqrt{\frac{1}{2 + \frac{1}{x} \cdot 4}}\right) + t \cdot \sqrt{2 + \frac{1}{x} \cdot 4}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 7: 80.4% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{x + 1}{x + -1}\\ t_2 := \sqrt{2} \cdot t\\ t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\ t_4 := \sqrt{t_1}\\ \mathbf{if}\;t_3 \leq -0.5:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{-271}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
        (t_2 (* (sqrt 2.0) t))
        (t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
        (t_4 (sqrt t_1)))
   (if (<= t_3 -0.5)
     (/ t (* (- t) t_4))
     (if (<= t_3 5e-271)
       (* (/ 1.0 (hypot (* (hypot l t_2) t_4) l)) (/ t (pow 2.0 -0.5)))
       (if (<= t_3 INFINITY)
         (sqrt (/ (+ x -1.0) (+ x 1.0)))
         (*
          (sqrt 2.0)
          (/
           t
           (*
            l
            (sqrt
             (+
              (/ 1.0 (+ x -1.0))
              (+
               (/ 1.0 x)
               (+
                (* (/ 1.0 x) (/ 1.0 x))
                (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 4.0)))))))))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = sqrt(2.0) * t;
	double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_4 = sqrt(t_1);
	double tmp;
	if (t_3 <= -0.5) {
		tmp = t / (-t * t_4);
	} else if (t_3 <= 5e-271) {
		tmp = (1.0 / hypot((hypot(l, t_2) * t_4), l)) * (t / pow(2.0, -0.5));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 4.0)))))))));
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = (x + 1.0) / (x + -1.0);
	double t_2 = Math.sqrt(2.0) * t;
	double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	double t_4 = Math.sqrt(t_1);
	double tmp;
	if (t_3 <= -0.5) {
		tmp = t / (-t * t_4);
	} else if (t_3 <= 5e-271) {
		tmp = (1.0 / Math.hypot((Math.hypot(l, t_2) * t_4), l)) * (t / Math.pow(2.0, -0.5));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 4.0)))))))));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (x + 1.0) / (x + -1.0)
	t_2 = math.sqrt(2.0) * t
	t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)))
	t_4 = math.sqrt(t_1)
	tmp = 0
	if t_3 <= -0.5:
		tmp = t / (-t * t_4)
	elif t_3 <= 5e-271:
		tmp = (1.0 / math.hypot((math.hypot(l, t_2) * t_4), l)) * (t / math.pow(2.0, -0.5))
	elif t_3 <= math.inf:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	else:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 4.0)))))))))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0))
	t_2 = Float64(sqrt(2.0) * t)
	t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l))))
	t_4 = sqrt(t_1)
	tmp = 0.0
	if (t_3 <= -0.5)
		tmp = Float64(t / Float64(Float64(-t) * t_4));
	elseif (t_3 <= 5e-271)
		tmp = Float64(Float64(1.0 / hypot(Float64(hypot(l, t_2) * t_4), l)) * Float64(t / (2.0 ^ -0.5)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	else
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 / x) * Float64(1.0 / x)) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 4.0))))))))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (x + 1.0) / (x + -1.0);
	t_2 = sqrt(2.0) * t;
	t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
	t_4 = sqrt(t_1);
	tmp = 0.0;
	if (t_3 <= -0.5)
		tmp = t / (-t * t_4);
	elseif (t_3 <= 5e-271)
		tmp = (1.0 / hypot((hypot(l, t_2) * t_4), l)) * (t / (2.0 ^ -0.5));
	elseif (t_3 <= Inf)
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	else
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (((1.0 / x) * (1.0 / x)) + ((1.0 / (x ^ 3.0)) + (1.0 / (x ^ 4.0)))))))));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], N[(t / N[((-t) * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e-271], N[(N[(1.0 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * t$95$4), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \sqrt{t_1}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot t_4}\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-271}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot t_4, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

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

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

    if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 5.0000000000000002e-271

    1. Initial program 7.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. Simplified7.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. Applied egg-rr94.9%

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

    if 5.0000000000000002e-271 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0

    1. Initial program 61.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. Simplified61.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. Applied egg-rr67.6%

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

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

    if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \left(\frac{1}{x} + \left(\color{blue}{\frac{1}{x} \cdot \frac{1}{x}} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq -0.5:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq 5 \cdot 10^{-271}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, \sqrt{2} \cdot t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}, \ell\right)} \cdot \frac{t}{{2}^{-0.5}}\\ \mathbf{elif}\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x + -1} - \ell \cdot \ell}} \leq \infty:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{x} \cdot \frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{4}}\right)\right)\right)}}\\ \end{array} \]

Alternative 8: 80.3% accurate, 0.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -4 \cdot 10^{-133}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\ \mathbf{elif}\;t \leq -1.7 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-219}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-203}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{2}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -4e-133)
     (log1p (expm1 (- t_1)))
     (if (<= t -1.7e-169)
       (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
       (if (<= t -1e-219)
         (+ -1.0 (/ 1.0 x))
         (if (<= t 2.35e-203)
           (*
            (sqrt 2.0)
            (/
             t
             (*
              l
              (sqrt
               (+
                (/ 1.0 (+ x -1.0))
                (+ (/ 1.0 x) (+ (/ 1.0 (pow x 3.0)) (/ 1.0 (pow x 2.0)))))))))
           t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4e-133) {
		tmp = log1p(expm1(-t_1));
	} else if (t <= -1.7e-169) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= -1e-219) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.35e-203) {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / pow(x, 3.0)) + (1.0 / pow(x, 2.0))))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4e-133) {
		tmp = Math.log1p(Math.expm1(-t_1));
	} else if (t <= -1.7e-169) {
		tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
	} else if (t <= -1e-219) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.35e-203) {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / Math.pow(x, 3.0)) + (1.0 / Math.pow(x, 2.0))))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -4e-133:
		tmp = math.log1p(math.expm1(-t_1))
	elif t <= -1.7e-169:
		tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0))
	elif t <= -1e-219:
		tmp = -1.0 + (1.0 / x)
	elif t <= 2.35e-203:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + ((1.0 / math.pow(x, 3.0)) + (1.0 / math.pow(x, 2.0))))))))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -4e-133)
		tmp = log1p(expm1(Float64(-t_1)));
	elseif (t <= -1.7e-169)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= -1e-219)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 2.35e-203)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(Float64(1.0 / (x ^ 3.0)) + Float64(1.0 / (x ^ 2.0)))))))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4e-133], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -1.7e-169], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1e-219], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-203], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\

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

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

\mathbf{elif}\;t \leq 2.35 \cdot 10^{-203}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{2}}\right)\right)}}\\

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


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

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}\right)\right) \]
      3. sub-neg83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)\right) \]
      4. metadata-eval83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)\right) \]
    6. Simplified83.6%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{1 + x}}\right)}\right) \]

    if -4.0000000000000003e-133 < t < -1.7e-169

    1. Initial program 1.5%

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

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

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(\sqrt{2} \cdot \ell\right)} \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}} \]
    6. Simplified31.7%

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

    if -1.7e-169 < t < -1e-219

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -1e-219 < t < 2.35000000000000003e-203

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.35000000000000003e-203 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-133}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{x + 1}}\right)\right)\\ \mathbf{elif}\;t \leq -1.7 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-219}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-203}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \left(\frac{1}{{x}^{3}} + \frac{1}{{x}^{2}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 9: 80.1% accurate, 0.7× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -4.4 \cdot 10^{-136}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-220}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 7.1 \cdot 10^{-193}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -4.4e-136)
     (log1p (expm1 (- t_1)))
     (if (<= t -3.1e-169)
       (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
       (if (<= t -3.4e-220)
         (+ -1.0 (/ 1.0 x))
         (if (<= t 7.1e-193)
           (*
            (sqrt 2.0)
            (/
             t
             (*
              l
              (sqrt
               (+ (/ 1.0 (+ x -1.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 2.0))))))))
           t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4.4e-136) {
		tmp = log1p(expm1(-t_1));
	} else if (t <= -3.1e-169) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= -3.4e-220) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 7.1e-193) {
		tmp = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / pow(x, 2.0)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4.4e-136) {
		tmp = Math.log1p(Math.expm1(-t_1));
	} else if (t <= -3.1e-169) {
		tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
	} else if (t <= -3.4e-220) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 7.1e-193) {
		tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 2.0)))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -4.4e-136:
		tmp = math.log1p(math.expm1(-t_1))
	elif t <= -3.1e-169:
		tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0))
	elif t <= -3.4e-220:
		tmp = -1.0 + (1.0 / x)
	elif t <= 7.1e-193:
		tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / x) + (1.0 / math.pow(x, 2.0)))))))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -4.4e-136)
		tmp = log1p(expm1(Float64(-t_1)));
	elseif (t <= -3.1e-169)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= -3.4e-220)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 7.1e-193)
		tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0))))))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.4e-136], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -3.1e-169], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.4e-220], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.1e-193], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-136}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\

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

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

\mathbf{elif}\;t \leq 7.1 \cdot 10^{-193}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}}\\

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


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

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}\right)\right) \]
      3. sub-neg83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)\right) \]
      4. metadata-eval83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)\right) \]
    6. Simplified83.6%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{1 + x}}\right)}\right) \]

    if -4.4000000000000002e-136 < t < -3.1000000000000002e-169

    1. Initial program 1.5%

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

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

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(\sqrt{2} \cdot \ell\right)} \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}} \]
    6. Simplified31.7%

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

    if -3.1000000000000002e-169 < t < -3.39999999999999993e-220

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -3.39999999999999993e-220 < t < 7.1000000000000004e-193

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.1000000000000004e-193 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.4 \cdot 10^{-136}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{x + 1}}\right)\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-220}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 7.1 \cdot 10^{-193}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 10: 80.0% accurate, 0.7× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{-144}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-170}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-219}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-194}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -3.8e-144)
     (log1p (expm1 (- t_1)))
     (if (<= t -2.2e-170)
       (/ t (/ (* (* (sqrt 2.0) l) (sqrt (/ 1.0 x))) (sqrt 2.0)))
       (if (<= t -1.05e-219)
         (+ -1.0 (/ 1.0 x))
         (if (<= t 1.3e-194)
           (*
            (sqrt 2.0)
            (* t (/ 1.0 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x)))))))
           t_1))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.8e-144) {
		tmp = log1p(expm1(-t_1));
	} else if (t <= -2.2e-170) {
		tmp = t / (((sqrt(2.0) * l) * sqrt((1.0 / x))) / sqrt(2.0));
	} else if (t <= -1.05e-219) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 1.3e-194) {
		tmp = sqrt(2.0) * (t * (1.0 / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.8e-144) {
		tmp = Math.log1p(Math.expm1(-t_1));
	} else if (t <= -2.2e-170) {
		tmp = t / (((Math.sqrt(2.0) * l) * Math.sqrt((1.0 / x))) / Math.sqrt(2.0));
	} else if (t <= -1.05e-219) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 1.3e-194) {
		tmp = Math.sqrt(2.0) * (t * (1.0 / (l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -3.8e-144:
		tmp = math.log1p(math.expm1(-t_1))
	elif t <= -2.2e-170:
		tmp = t / (((math.sqrt(2.0) * l) * math.sqrt((1.0 / x))) / math.sqrt(2.0))
	elif t <= -1.05e-219:
		tmp = -1.0 + (1.0 / x)
	elif t <= 1.3e-194:
		tmp = math.sqrt(2.0) * (t * (1.0 / (l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x))))))
	else:
		tmp = t_1
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -3.8e-144)
		tmp = log1p(expm1(Float64(-t_1)));
	elseif (t <= -2.2e-170)
		tmp = Float64(t / Float64(Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(1.0 / x))) / sqrt(2.0)));
	elseif (t <= -1.05e-219)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 1.3e-194)
		tmp = Float64(sqrt(2.0) * Float64(t * Float64(1.0 / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))))));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.8e-144], N[Log[1 + N[(Exp[(-t$95$1)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -2.2e-170], N[(t / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.05e-219], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-194], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(1.0 / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_1\right)\right)\\

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

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

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-194}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\

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


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

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}\right)\right) \]
      3. sub-neg83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)\right) \]
      4. metadata-eval83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)\right) \]
    6. Simplified83.6%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{1 + x}}\right)}\right) \]

    if -3.79999999999999993e-144 < t < -2.20000000000000015e-170

    1. Initial program 1.5%

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

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

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

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

        \[\leadsto \frac{t}{\frac{\color{blue}{\left(\sqrt{2} \cdot \ell\right)} \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}} \]
    6. Simplified31.7%

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

    if -2.20000000000000015e-170 < t < -1.05e-219

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -1.05e-219 < t < 1.30000000000000001e-194

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000001e-194 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-144}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{x + 1}}\right)\right)\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-170}:\\ \;\;\;\;\frac{t}{\frac{\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\frac{1}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-219}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-194}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 11: 80.1% accurate, 0.7× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}\\ t_2 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.3 \cdot 10^{-136}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_2\right)\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-168}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-221}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-191}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{t_1}\right)\\ \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 (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x)))))
        (t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -3.3e-136)
     (log1p (expm1 (- t_2)))
     (if (<= t -3.1e-168)
       (* (sqrt 2.0) (/ t t_1))
       (if (<= t -8.2e-221)
         (+ -1.0 (/ 1.0 x))
         (if (<= t 1.4e-191) (* (sqrt 2.0) (* t (/ 1.0 t_1))) t_2))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
	double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.3e-136) {
		tmp = log1p(expm1(-t_2));
	} else if (t <= -3.1e-168) {
		tmp = sqrt(2.0) * (t / t_1);
	} else if (t <= -8.2e-221) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 1.4e-191) {
		tmp = sqrt(2.0) * (t * (1.0 / t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
	double t_1 = l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)));
	double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.3e-136) {
		tmp = Math.log1p(Math.expm1(-t_2));
	} else if (t <= -3.1e-168) {
		tmp = Math.sqrt(2.0) * (t / t_1);
	} else if (t <= -8.2e-221) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 1.4e-191) {
		tmp = Math.sqrt(2.0) * (t * (1.0 / t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))
	t_2 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -3.3e-136:
		tmp = math.log1p(math.expm1(-t_2))
	elif t <= -3.1e-168:
		tmp = math.sqrt(2.0) * (t / t_1)
	elif t <= -8.2e-221:
		tmp = -1.0 + (1.0 / x)
	elif t <= 1.4e-191:
		tmp = math.sqrt(2.0) * (t * (1.0 / t_1))
	else:
		tmp = t_2
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x))))
	t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -3.3e-136)
		tmp = log1p(expm1(Float64(-t_2)));
	elseif (t <= -3.1e-168)
		tmp = Float64(sqrt(2.0) * Float64(t / t_1));
	elseif (t <= -8.2e-221)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 1.4e-191)
		tmp = Float64(sqrt(2.0) * Float64(t * Float64(1.0 / t_1)));
	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[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + 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, -3.3e-136], N[Log[1 + N[(Exp[(-t$95$2)] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -3.1e-168], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.2e-221], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-191], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-136}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-t_2\right)\right)\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-168}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\

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

\mathbf{elif}\;t \leq 1.4 \cdot 10^{-191}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{t_1}\right)\\

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


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

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

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

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

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

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

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}\right)\right) \]
      3. sub-neg83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}\right)\right) \]
      4. metadata-eval83.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}\right)\right) \]
    6. Simplified83.6%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{1 + x}}\right)}\right) \]

    if -3.30000000000000018e-136 < t < -3.1e-168

    1. Initial program 1.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1e-168 < t < -8.19999999999999962e-221

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -8.19999999999999962e-221 < t < 1.40000000000000006e-191

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000006e-191 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-136}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(-\sqrt{\frac{x + -1}{x + 1}}\right)\right)\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-168}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{elif}\;t \leq -8.2 \cdot 10^{-221}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-191}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 12: 80.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq -3.4 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\

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

\mathbf{elif}\;t \leq 1.24 \cdot 10^{-200}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{t_1}\right)\\

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


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

    1. Initial program 38.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. Simplified38.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 t around -inf 83.6%

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

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

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

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

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

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

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

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

    if -8.00000000000000024e-139 < t < -3.4e-169

    1. Initial program 1.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e-169 < t < -9.50000000000000062e-220

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -9.50000000000000062e-220 < t < 1.24e-200

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.24e-200 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{-139}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{-169}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-220}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 1.24 \cdot 10^{-200}:\\ \;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{1}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 13: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{-144}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-168}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-220}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-191}:\\ \;\;\;\;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
         (* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x))))))))
   (if (<= t -3.5e-144)
     (/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
     (if (<= t -1.4e-168)
       t_1
       (if (<= t -9.2e-220)
         (+ -1.0 (/ 1.0 x))
         (if (<= t 2.25e-191) t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
	double tmp;
	if (t <= -3.5e-144) {
		tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
	} else if (t <= -1.4e-168) {
		tmp = t_1;
	} else if (t <= -9.2e-220) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.25e-191) {
		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 = sqrt(2.0d0) * (t / (l * sqrt(((1.0d0 / (x + (-1.0d0))) + (1.0d0 / x)))))
    if (t <= (-3.5d-144)) then
        tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
    else if (t <= (-1.4d-168)) then
        tmp = t_1
    else if (t <= (-9.2d-220)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 2.25d-191) 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 = Math.sqrt(2.0) * (t / (l * Math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
	double tmp;
	if (t <= -3.5e-144) {
		tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
	} else if (t <= -1.4e-168) {
		tmp = t_1;
	} else if (t <= -9.2e-220) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 2.25e-191) {
		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 = math.sqrt(2.0) * (t / (l * math.sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))))
	tmp = 0
	if t <= -3.5e-144:
		tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0))))
	elif t <= -1.4e-168:
		tmp = t_1
	elif t <= -9.2e-220:
		tmp = -1.0 + (1.0 / x)
	elif t <= 2.25e-191:
		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(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x))))))
	tmp = 0.0
	if (t <= -3.5e-144)
		tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))));
	elseif (t <= -1.4e-168)
		tmp = t_1;
	elseif (t <= -9.2e-220)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 2.25e-191)
		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 = sqrt(2.0) * (t / (l * sqrt(((1.0 / (x + -1.0)) + (1.0 / x)))));
	tmp = 0.0;
	if (t <= -3.5e-144)
		tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
	elseif (t <= -1.4e-168)
		tmp = t_1;
	elseif (t <= -9.2e-220)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 2.25e-191)
		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[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-144], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.4e-168], t$95$1, If[LessEqual[t, -9.2e-220], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e-191], 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 := \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-144}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\

\mathbf{elif}\;t \leq -1.4 \cdot 10^{-168}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 2.25 \cdot 10^{-191}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 38.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. Simplified38.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 t around -inf 83.6%

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

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

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

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

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

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

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

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

    if -3.4999999999999998e-144 < t < -1.4000000000000001e-168 or -9.19999999999999922e-220 < t < 2.25000000000000004e-191

    1. Initial program 8.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. Simplified8.0%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Taylor expanded in l around inf 9.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+37.1%

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e-168 < t < -9.19999999999999922e-220

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if 2.25000000000000004e-191 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-144}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-168}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-220}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-191}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 14: 80.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq -8 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{t_1}\\

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

\mathbf{elif}\;t \leq 7.2 \cdot 10^{-204}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{t_1}\\

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


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

    1. Initial program 38.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. Simplified38.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 t around -inf 83.6%

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

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

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

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

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

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

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

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

    if -4.9000000000000003e-142 < t < -8.00000000000000016e-169

    1. Initial program 1.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000016e-169 < t < -4.4000000000000001e-228

    1. Initial program 11.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
    4. Taylor expanded in l around 0 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-sqrt76.4%

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

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

    if -4.4000000000000001e-228 < t < 7.1999999999999993e-204

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{1}{\color{blue}{x + -1}} + \frac{1}{x}}} \]
    8. Applied egg-rr65.2%

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

    if 7.1999999999999993e-204 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.9 \cdot 10^{-142}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-169}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-228}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-204}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 15: 79.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;t \leq 1.16 \cdot 10^{-200}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x \cdot 0.5 - 0.25}\\

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -4.90000000000000012e-240 < t < 1.1600000000000001e-200

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \]
    7. Taylor expanded in t around 0 67.1%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x - 1}}}} \]
    8. Taylor expanded in x around inf 67.1%

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

    if 1.1600000000000001e-200 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.9 \cdot 10^{-240}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{-200}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x \cdot 0.5 - 0.25}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 16: 79.1% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -3.54999999999999976e-240 < t < 7.8000000000000002e-199

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \]
    7. Taylor expanded in t around 0 67.1%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x - 1}}}} \]
    8. Taylor expanded in x around inf 67.0%

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

        \[\leadsto \frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\color{blue}{x \cdot 0.5}} \]
    10. Simplified67.0%

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

    if 7.8000000000000002e-199 < t

    1. Initial program 35.1%

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

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

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

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

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

Alternative 17: 76.8% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -3.35 \cdot 10^{-242}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-205}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{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 -3.35e-242)
   (/ t (* (- t) (sqrt (/ (+ x 1.0) (+ x -1.0)))))
   (if (<= t 1.55e-205)
     (* (/ (* (sqrt 2.0) t) l) (sqrt x))
     (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -3.35e-242) {
		tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
	} else if (t <= 1.55e-205) {
		tmp = ((sqrt(2.0) * t) / l) * sqrt(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 <= (-3.35d-242)) then
        tmp = t / (-t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
    else if (t <= 1.55d-205) then
        tmp = ((sqrt(2.0d0) * t) / l) * sqrt(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 <= -3.35e-242) {
		tmp = t / (-t * Math.sqrt(((x + 1.0) / (x + -1.0))));
	} else if (t <= 1.55e-205) {
		tmp = ((Math.sqrt(2.0) * t) / l) * Math.sqrt(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 <= -3.35e-242:
		tmp = t / (-t * math.sqrt(((x + 1.0) / (x + -1.0))))
	elif t <= 1.55e-205:
		tmp = ((math.sqrt(2.0) * t) / l) * math.sqrt(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 <= -3.35e-242)
		tmp = Float64(t / Float64(Float64(-t) * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))));
	elseif (t <= 1.55e-205)
		tmp = Float64(Float64(Float64(sqrt(2.0) * t) / l) * sqrt(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 <= -3.35e-242)
		tmp = t / (-t * sqrt(((x + 1.0) / (x + -1.0))));
	elseif (t <= 1.55e-205)
		tmp = ((sqrt(2.0) * t) / l) * sqrt(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, -3.35e-242], N[(t / N[((-t) * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-205], N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[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 -3.35 \cdot 10^{-242}:\\
\;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\

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

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


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

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

    if -3.35000000000000015e-242 < t < 1.54999999999999991e-205

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{1}{-1 + x} + \color{blue}{\frac{1}{x}}}} \]
    7. Taylor expanded in t around 0 67.1%

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x - 1}}}} \]
    8. Taylor expanded in x around 0 45.7%

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

    if 1.54999999999999991e-205 < t

    1. Initial program 35.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.35 \cdot 10^{-242}:\\ \;\;\;\;\frac{t}{\left(-t\right) \cdot \sqrt{\frac{x + 1}{x + -1}}}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-205}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 18: 76.9% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000023e-304 < t

    1. Initial program 34.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. Simplified34.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. Applied egg-rr68.6%

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

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

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

Alternative 19: 77.0% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000023e-304 < t

    1. Initial program 34.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. Simplified34.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. Applied egg-rr68.6%

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

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

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

Alternative 20: 76.7% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-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-310) (+ -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-310) {
		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-310)) 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-310) {
		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-310:
		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-310)
		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-310)
		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-310], 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^{-310}:\\
\;\;\;\;-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 < -4.999999999999985e-310

    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.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. Applied egg-rr66.1%

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

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

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

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

    if -4.999999999999985e-310 < t

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

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

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

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

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

Alternative 21: 76.3% accurate, 24.8× speedup?

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

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


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

    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.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. Applied egg-rr66.1%

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

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

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

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

    if -4.999999999999985e-310 < t

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 77.6%

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

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

Alternative 22: 75.9% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-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-310) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		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-310)) 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-310) {
		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-310:
		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-310)
		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-310)
		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-310], 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^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\

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


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

    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.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. Applied egg-rr66.1%

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

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

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

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

    if -4.999999999999985e-310 < t

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 77.0%

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

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

Alternative 23: 76.3% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-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-310) (+ -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-310) {
		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-310)) 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-310) {
		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-310:
		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-310)
		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-310)
		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-310], 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^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\

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


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

    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.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. Applied egg-rr66.1%

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

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

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

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

    if -4.999999999999985e-310 < t

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 77.6%

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

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

Alternative 24: 75.6% accurate, 73.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-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-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		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-310)) 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-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		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-310)
		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-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\

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


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

    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.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. Applied egg-rr66.1%

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

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

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

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

    if -4.999999999999985e-310 < t

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 77.0%

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

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

Alternative 25: 38.8% 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 32.8%

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Simplified32.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. Applied egg-rr67.7%

    \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(\sqrt{\frac{x + 1}{x + -1}} \cdot \mathsf{hypot}\left(\ell, t \cdot \sqrt{2}\right), \ell\right)} \cdot \frac{t}{{2}^{-0.5}}} \]
  4. Taylor expanded in l around 0 44.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-sqrt32.5%

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

    \[\leadsto \color{blue}{-1} \]
  8. Final simplification32.5%

    \[\leadsto -1 \]

Reproduce

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