Toniolo and Linder, Equation (7)

Percentage Accurate: 33.5% → 83.3%
Time: 24.0s
Alternatives: 14
Speedup: 75.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.5% 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: 83.3% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := 2 \cdot {t}^{2}\\ t_2 := 2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\\ t_3 := t_1 + {\ell}^{2}\\ t_4 := \frac{t_3}{x}\\ \mathbf{if}\;t \leq -3.2 \cdot 10^{+64}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-125}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(\frac{t_3 + t_3}{{x}^{2}} + t_2\right) + t_4}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.62 \cdot 10^{-198}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+35}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{t_2 + t_4}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \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 (+ (* 2.0 (/ (pow t 2.0) x)) (+ t_1 (/ (pow l 2.0) x))))
        (t_3 (+ t_1 (pow l 2.0)))
        (t_4 (/ t_3 x)))
   (if (<= t -3.2e+64)
     (+ (/ 1.0 x) (- -1.0 (/ 0.5 (pow x 2.0))))
     (if (<= t -5e-125)
       (/ t (/ (sqrt (+ (+ (/ (+ t_3 t_3) (pow x 2.0)) t_2) t_4)) (sqrt 2.0)))
       (if (<= t 1.62e-198)
         (* (/ 1.0 l) (/ t (pow x -0.5)))
         (if (<= t 4.6e+35)
           (/ t (/ (sqrt (+ t_2 t_4)) (sqrt 2.0)))
           (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = 2.0 * pow(t, 2.0);
	double t_2 = (2.0 * (pow(t, 2.0) / x)) + (t_1 + (pow(l, 2.0) / x));
	double t_3 = t_1 + pow(l, 2.0);
	double t_4 = t_3 / x;
	double tmp;
	if (t <= -3.2e+64) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / pow(x, 2.0)));
	} else if (t <= -5e-125) {
		tmp = t / (sqrt(((((t_3 + t_3) / pow(x, 2.0)) + t_2) + t_4)) / sqrt(2.0));
	} else if (t <= 1.62e-198) {
		tmp = (1.0 / l) * (t / pow(x, -0.5));
	} else if (t <= 4.6e+35) {
		tmp = t / (sqrt((t_2 + t_4)) / sqrt(2.0));
	} else {
		tmp = sqrt(((x + -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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = 2.0d0 * (t ** 2.0d0)
    t_2 = (2.0d0 * ((t ** 2.0d0) / x)) + (t_1 + ((l ** 2.0d0) / x))
    t_3 = t_1 + (l ** 2.0d0)
    t_4 = t_3 / x
    if (t <= (-3.2d+64)) then
        tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x ** 2.0d0)))
    else if (t <= (-5d-125)) then
        tmp = t / (sqrt(((((t_3 + t_3) / (x ** 2.0d0)) + t_2) + t_4)) / sqrt(2.0d0))
    else if (t <= 1.62d-198) then
        tmp = (1.0d0 / l) * (t / (x ** (-0.5d0)))
    else if (t <= 4.6d+35) then
        tmp = t / (sqrt((t_2 + t_4)) / sqrt(2.0d0))
    else
        tmp = sqrt(((x + (-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 t_1 = 2.0 * Math.pow(t, 2.0);
	double t_2 = (2.0 * (Math.pow(t, 2.0) / x)) + (t_1 + (Math.pow(l, 2.0) / x));
	double t_3 = t_1 + Math.pow(l, 2.0);
	double t_4 = t_3 / x;
	double tmp;
	if (t <= -3.2e+64) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / Math.pow(x, 2.0)));
	} else if (t <= -5e-125) {
		tmp = t / (Math.sqrt(((((t_3 + t_3) / Math.pow(x, 2.0)) + t_2) + t_4)) / Math.sqrt(2.0));
	} else if (t <= 1.62e-198) {
		tmp = (1.0 / l) * (t / Math.pow(x, -0.5));
	} else if (t <= 4.6e+35) {
		tmp = t / (Math.sqrt((t_2 + t_4)) / Math.sqrt(2.0));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = 2.0 * math.pow(t, 2.0)
	t_2 = (2.0 * (math.pow(t, 2.0) / x)) + (t_1 + (math.pow(l, 2.0) / x))
	t_3 = t_1 + math.pow(l, 2.0)
	t_4 = t_3 / x
	tmp = 0
	if t <= -3.2e+64:
		tmp = (1.0 / x) + (-1.0 - (0.5 / math.pow(x, 2.0)))
	elif t <= -5e-125:
		tmp = t / (math.sqrt(((((t_3 + t_3) / math.pow(x, 2.0)) + t_2) + t_4)) / math.sqrt(2.0))
	elif t <= 1.62e-198:
		tmp = (1.0 / l) * (t / math.pow(x, -0.5))
	elif t <= 4.6e+35:
		tmp = t / (math.sqrt((t_2 + t_4)) / math.sqrt(2.0))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(2.0 * (t ^ 2.0))
	t_2 = Float64(Float64(2.0 * Float64((t ^ 2.0) / x)) + Float64(t_1 + Float64((l ^ 2.0) / x)))
	t_3 = Float64(t_1 + (l ^ 2.0))
	t_4 = Float64(t_3 / x)
	tmp = 0.0
	if (t <= -3.2e+64)
		tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / (x ^ 2.0))));
	elseif (t <= -5e-125)
		tmp = Float64(t / Float64(sqrt(Float64(Float64(Float64(Float64(t_3 + t_3) / (x ^ 2.0)) + t_2) + t_4)) / sqrt(2.0)));
	elseif (t <= 1.62e-198)
		tmp = Float64(Float64(1.0 / l) * Float64(t / (x ^ -0.5)));
	elseif (t <= 4.6e+35)
		tmp = Float64(t / Float64(sqrt(Float64(t_2 + t_4)) / sqrt(2.0)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = 2.0 * (t ^ 2.0);
	t_2 = (2.0 * ((t ^ 2.0) / x)) + (t_1 + ((l ^ 2.0) / x));
	t_3 = t_1 + (l ^ 2.0);
	t_4 = t_3 / x;
	tmp = 0.0;
	if (t <= -3.2e+64)
		tmp = (1.0 / x) + (-1.0 - (0.5 / (x ^ 2.0)));
	elseif (t <= -5e-125)
		tmp = t / (sqrt(((((t_3 + t_3) / (x ^ 2.0)) + t_2) + t_4)) / sqrt(2.0));
	elseif (t <= 1.62e-198)
		tmp = (1.0 / l) * (t / (x ^ -0.5));
	elseif (t <= 4.6e+35)
		tmp = t / (sqrt((t_2 + t_4)) / sqrt(2.0));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = 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[(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]}, Block[{t$95$3 = N[(t$95$1 + N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / x), $MachinePrecision]}, If[LessEqual[t, -3.2e+64], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5e-125], N[(t / N[(N[Sqrt[N[(N[(N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.62e-198], N[(N[(1.0 / l), $MachinePrecision] * N[(t / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+35], N[(t / N[(N[Sqrt[N[(t$95$2 + t$95$4), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot {t}^{2}\\
t_2 := 2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + \frac{{\ell}^{2}}{x}\right)\\
t_3 := t_1 + {\ell}^{2}\\
t_4 := \frac{t_3}{x}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+64}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\

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

\mathbf{elif}\;t \leq 1.62 \cdot 10^{-198}:\\
\;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{t_2 + t_4}}{\sqrt{2}}}\\

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


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

    1. Initial program 27.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. Simplified27.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 t around -inf 89.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \frac{\color{blue}{0.5}}{{x}^{2}}\right) \]
    8. Simplified89.4%

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

    if -3.20000000000000019e64 < t < -4.99999999999999967e-125

    1. Initial program 48.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. Simplified48.4%

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

      \[\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.99999999999999967e-125 < t < 1.62e-198

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity47.9%

        \[\leadsto \frac{\color{blue}{1 \cdot t}}{\ell \cdot \sqrt{\frac{1}{x}}} \]
      2. inv-pow47.9%

        \[\leadsto \frac{1 \cdot t}{\ell \cdot \sqrt{\color{blue}{{x}^{-1}}}} \]
      3. sqrt-pow147.9%

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

        \[\leadsto \frac{1 \cdot t}{\ell \cdot {x}^{\color{blue}{-0.5}}} \]
      5. times-frac48.1%

        \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]
    7. Applied egg-rr48.1%

      \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]

    if 1.62e-198 < t < 4.5999999999999996e35

    1. Initial program 50.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. Simplified50.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.4%

      \[\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 4.5999999999999996e35 < t

    1. Initial program 41.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. Simplified40.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 t around inf 92.9%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.2 \cdot 10^{+64}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-125}:\\ \;\;\;\;\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 {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.62 \cdot 10^{-198}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+35}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 2: 83.4% accurate, 0.3× speedup?

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

\mathbf{elif}\;t \leq -5 \cdot 10^{-125}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(t_2 + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\

\mathbf{elif}\;t \leq 1.62 \cdot 10^{-198}:\\
\;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\

\mathbf{elif}\;t \leq 2.9 \cdot 10^{+35}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(t_1 + t_2\right)\right) + \frac{t_1 + {\ell}^{2}}{x}}}{\sqrt{2}}}\\

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


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

    1. Initial program 27.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. Simplified27.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 t around -inf 89.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \frac{\color{blue}{0.5}}{{x}^{2}}\right) \]
    8. Simplified89.4%

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

    if -1.8599999999999999e65 < t < -4.99999999999999967e-125

    1. Initial program 48.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. Simplified48.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, {t}^{2} \cdot \frac{x + 1}{-1 + x}, \color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/89.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{t}^{2}}{\frac{x + -1}{x + 1}} + 2 \cdot \frac{{\ell}^{2}}{x}}}} \]
      4. distribute-lft-out89.4%

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

        \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\color{blue}{\frac{{t}^{2} \cdot \left(x + 1\right)}{x + -1}} + \frac{{\ell}^{2}}{x}\right)}} \]
      6. associate-*r/89.4%

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

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

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

    if -4.99999999999999967e-125 < t < 1.62e-198

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity47.9%

        \[\leadsto \frac{\color{blue}{1 \cdot t}}{\ell \cdot \sqrt{\frac{1}{x}}} \]
      2. inv-pow47.9%

        \[\leadsto \frac{1 \cdot t}{\ell \cdot \sqrt{\color{blue}{{x}^{-1}}}} \]
      3. sqrt-pow147.9%

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

        \[\leadsto \frac{1 \cdot t}{\ell \cdot {x}^{\color{blue}{-0.5}}} \]
      5. times-frac48.1%

        \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]
    7. Applied egg-rr48.1%

      \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]

    if 1.62e-198 < t < 2.89999999999999995e35

    1. Initial program 50.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. Simplified50.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.4%

      \[\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 2.89999999999999995e35 < t

    1. Initial program 41.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. Simplified40.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 t around inf 92.9%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.86 \cdot 10^{+65}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-125}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\ \mathbf{elif}\;t \leq 1.62 \cdot 10^{-198}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{+35}:\\ \;\;\;\;\frac{t}{\frac{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}{\sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 3: 83.5% accurate, 0.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{+63}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-125}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-188}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+35}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (let* ((t_1
         (/
          (* t (sqrt 2.0))
          (sqrt
           (*
            2.0
            (+ (/ (pow l 2.0) x) (* (pow t 2.0) (/ (+ 1.0 x) (+ x -1.0)))))))))
   (if (<= t -1.35e+63)
     (+ (/ 1.0 x) (- -1.0 (/ 0.5 (pow x 2.0))))
     (if (<= t -4.5e-125)
       t_1
       (if (<= t 3e-188)
         (* (/ 1.0 l) (/ t (pow x -0.5)))
         (if (<= t 4e+35) t_1 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l = abs(l);
double code(double x, double l, double t) {
	double t_1 = (t * sqrt(2.0)) / sqrt((2.0 * ((pow(l, 2.0) / x) + (pow(t, 2.0) * ((1.0 + x) / (x + -1.0))))));
	double tmp;
	if (t <= -1.35e+63) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / pow(x, 2.0)));
	} else if (t <= -4.5e-125) {
		tmp = t_1;
	} else if (t <= 3e-188) {
		tmp = (1.0 / l) * (t / pow(x, -0.5));
	} else if (t <= 4e+35) {
		tmp = t_1;
	} else {
		tmp = sqrt(((x + -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) :: t_1
    real(8) :: tmp
    t_1 = (t * sqrt(2.0d0)) / sqrt((2.0d0 * (((l ** 2.0d0) / x) + ((t ** 2.0d0) * ((1.0d0 + x) / (x + (-1.0d0)))))))
    if (t <= (-1.35d+63)) then
        tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x ** 2.0d0)))
    else if (t <= (-4.5d-125)) then
        tmp = t_1
    else if (t <= 3d-188) then
        tmp = (1.0d0 / l) * (t / (x ** (-0.5d0)))
    else if (t <= 4d+35) then
        tmp = t_1
    else
        tmp = sqrt(((x + (-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 t_1 = (t * Math.sqrt(2.0)) / Math.sqrt((2.0 * ((Math.pow(l, 2.0) / x) + (Math.pow(t, 2.0) * ((1.0 + x) / (x + -1.0))))));
	double tmp;
	if (t <= -1.35e+63) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / Math.pow(x, 2.0)));
	} else if (t <= -4.5e-125) {
		tmp = t_1;
	} else if (t <= 3e-188) {
		tmp = (1.0 / l) * (t / Math.pow(x, -0.5));
	} else if (t <= 4e+35) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	t_1 = (t * math.sqrt(2.0)) / math.sqrt((2.0 * ((math.pow(l, 2.0) / x) + (math.pow(t, 2.0) * ((1.0 + x) / (x + -1.0))))))
	tmp = 0
	if t <= -1.35e+63:
		tmp = (1.0 / x) + (-1.0 - (0.5 / math.pow(x, 2.0)))
	elif t <= -4.5e-125:
		tmp = t_1
	elif t <= 3e-188:
		tmp = (1.0 / l) * (t / math.pow(x, -0.5))
	elif t <= 4e+35:
		tmp = t_1
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	t_1 = Float64(Float64(t * sqrt(2.0)) / sqrt(Float64(2.0 * Float64(Float64((l ^ 2.0) / x) + Float64((t ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0)))))))
	tmp = 0.0
	if (t <= -1.35e+63)
		tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / (x ^ 2.0))));
	elseif (t <= -4.5e-125)
		tmp = t_1;
	elseif (t <= 3e-188)
		tmp = Float64(Float64(1.0 / l) * Float64(t / (x ^ -0.5)));
	elseif (t <= 4e+35)
		tmp = t_1;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(x, l, t)
	t_1 = (t * sqrt(2.0)) / sqrt((2.0 * (((l ^ 2.0) / x) + ((t ^ 2.0) * ((1.0 + x) / (x + -1.0))))));
	tmp = 0.0;
	if (t <= -1.35e+63)
		tmp = (1.0 / x) + (-1.0 - (0.5 / (x ^ 2.0)));
	elseif (t <= -4.5e-125)
		tmp = t_1;
	elseif (t <= 3e-188)
		tmp = (1.0 / l) * (t / (x ^ -0.5));
	elseif (t <= 4e+35)
		tmp = t_1;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(N[Power[t, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e+63], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.5e-125], t$95$1, If[LessEqual[t, 3e-188], N[(N[(1.0 / l), $MachinePrecision] * N[(t / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+35], t$95$1, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+63}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\

\mathbf{elif}\;t \leq -4.5 \cdot 10^{-125}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3 \cdot 10^{-188}:\\
\;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\

\mathbf{elif}\;t \leq 4 \cdot 10^{+35}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 27.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. Simplified27.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 t around -inf 89.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval89.4%

        \[\leadsto \frac{1}{x} - \left(1 + \frac{\color{blue}{0.5}}{{x}^{2}}\right) \]
    8. Simplified89.4%

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

    if -1.35000000000000009e63 < t < -4.50000000000000012e-125 or 3.00000000000000017e-188 < t < 3.9999999999999999e35

    1. Initial program 50.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. Simplified50.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 0 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, {t}^{2} \cdot \frac{x + 1}{-1 + x}, \color{blue}{2 \cdot \frac{{\ell}^{2}}{x}}\right)}} \]
    7. Step-by-step derivation
      1. associate-*r/88.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{{t}^{2}}{\frac{x + -1}{x + 1}} + 2 \cdot \frac{{\ell}^{2}}{x}}}} \]
      4. distribute-lft-out88.6%

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

        \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\color{blue}{\frac{{t}^{2} \cdot \left(x + 1\right)}{x + -1}} + \frac{{\ell}^{2}}{x}\right)}} \]
      6. associate-*r/88.6%

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

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

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

    if -4.50000000000000012e-125 < t < 3.00000000000000017e-188

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity48.9%

        \[\leadsto \frac{\color{blue}{1 \cdot t}}{\ell \cdot \sqrt{\frac{1}{x}}} \]
      2. inv-pow48.9%

        \[\leadsto \frac{1 \cdot t}{\ell \cdot \sqrt{\color{blue}{{x}^{-1}}}} \]
      3. sqrt-pow148.9%

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

        \[\leadsto \frac{1 \cdot t}{\ell \cdot {x}^{\color{blue}{-0.5}}} \]
      5. times-frac49.0%

        \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]
    7. Applied egg-rr49.0%

      \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]

    if 3.9999999999999999e35 < t

    1. Initial program 41.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. Simplified40.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 t around inf 92.9%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{+63}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-188}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+35}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\frac{{\ell}^{2}}{x} + {t}^{2} \cdot \frac{1 + x}{x + -1}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 4: 79.8% accurate, 2.0× speedup?

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

\mathbf{elif}\;t \leq 5 \cdot 10^{-168}:\\
\;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.3999999999999995e-125 < t < 5.00000000000000001e-168

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity49.0%

        \[\leadsto \frac{\color{blue}{1 \cdot t}}{\ell \cdot \sqrt{\frac{1}{x}}} \]
      2. inv-pow49.0%

        \[\leadsto \frac{1 \cdot t}{\ell \cdot \sqrt{\color{blue}{{x}^{-1}}}} \]
      3. sqrt-pow149.0%

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

        \[\leadsto \frac{1 \cdot t}{\ell \cdot {x}^{\color{blue}{-0.5}}} \]
      5. times-frac49.1%

        \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]
    7. Applied egg-rr49.1%

      \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]

    if 5.00000000000000001e-168 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 84.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{-125}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-168}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 5: 79.7% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\ \mathbf{elif}\;t \leq 5.7 \cdot 10^{-165}:\\ \;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (x l t)
 :precision binary64
 (if (<= t -4.5e-125)
   (+ (/ 1.0 x) (- -1.0 (/ 0.5 (pow x 2.0))))
   (if (<= t 5.7e-165)
     (* (/ 1.0 l) (/ t (pow x -0.5)))
     (sqrt (/ (+ x -1.0) (+ 1.0 x))))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -4.5e-125) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / pow(x, 2.0)));
	} else if (t <= 5.7e-165) {
		tmp = (1.0 / l) * (t / pow(x, -0.5));
	} else {
		tmp = sqrt(((x + -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 <= (-4.5d-125)) then
        tmp = (1.0d0 / x) + ((-1.0d0) - (0.5d0 / (x ** 2.0d0)))
    else if (t <= 5.7d-165) then
        tmp = (1.0d0 / l) * (t / (x ** (-0.5d0)))
    else
        tmp = sqrt(((x + (-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 <= -4.5e-125) {
		tmp = (1.0 / x) + (-1.0 - (0.5 / Math.pow(x, 2.0)));
	} else if (t <= 5.7e-165) {
		tmp = (1.0 / l) * (t / Math.pow(x, -0.5));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -4.5e-125:
		tmp = (1.0 / x) + (-1.0 - (0.5 / math.pow(x, 2.0)))
	elif t <= 5.7e-165:
		tmp = (1.0 / l) * (t / math.pow(x, -0.5))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -4.5e-125)
		tmp = Float64(Float64(1.0 / x) + Float64(-1.0 - Float64(0.5 / (x ^ 2.0))));
	elseif (t <= 5.7e-165)
		tmp = Float64(Float64(1.0 / l) * Float64(t / (x ^ -0.5)));
	else
		tmp = sqrt(Float64(Float64(x + -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 <= -4.5e-125)
		tmp = (1.0 / x) + (-1.0 - (0.5 / (x ^ 2.0)));
	elseif (t <= 5.7e-165)
		tmp = (1.0 / l) * (t / (x ^ -0.5));
	else
		tmp = sqrt(((x + -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, -4.5e-125], N[(N[(1.0 / x), $MachinePrecision] + N[(-1.0 - N[(0.5 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.7e-165], N[(N[(1.0 / l), $MachinePrecision] * N[(t / N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{1}{x} + \left(-1 - \frac{0.5}{{x}^{2}}\right)\\

\mathbf{elif}\;t \leq 5.7 \cdot 10^{-165}:\\
\;\;\;\;\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x} - \left(1 + 0.5 \cdot \frac{1}{{x}^{2}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/79.9%

        \[\leadsto \frac{1}{x} - \left(1 + \color{blue}{\frac{0.5 \cdot 1}{{x}^{2}}}\right) \]
      2. metadata-eval79.9%

        \[\leadsto \frac{1}{x} - \left(1 + \frac{\color{blue}{0.5}}{{x}^{2}}\right) \]
    8. Simplified79.9%

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

    if -4.50000000000000012e-125 < t < 5.70000000000000003e-165

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity49.0%

        \[\leadsto \frac{\color{blue}{1 \cdot t}}{\ell \cdot \sqrt{\frac{1}{x}}} \]
      2. inv-pow49.0%

        \[\leadsto \frac{1 \cdot t}{\ell \cdot \sqrt{\color{blue}{{x}^{-1}}}} \]
      3. sqrt-pow149.0%

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

        \[\leadsto \frac{1 \cdot t}{\ell \cdot {x}^{\color{blue}{-0.5}}} \]
      5. times-frac49.1%

        \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]
    7. Applied egg-rr49.1%

      \[\leadsto \color{blue}{\frac{1}{\ell} \cdot \frac{t}{{x}^{-0.5}}} \]

    if 5.70000000000000003e-165 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 84.4%

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

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

Alternative 6: 79.5% accurate, 2.0× speedup?

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

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

    if -5.8000000000000004e-125 < t < 9.49999999999999955e-167

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{\sqrt{\color{blue}{{x}^{-1}}}}}} \]
      4. sqrt-pow148.8%

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{\color{blue}{-0.5}}}}} \]
    6. Applied egg-rr48.8%

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

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

        \[\leadsto \frac{\color{blue}{t}}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{-0.5}}}} \]
      3. associate-/r/48.9%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell \cdot \sqrt{2}}{\sqrt{2}} \cdot {x}^{-0.5}}} \]
      4. associate-/l*49.0%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot {x}^{-0.5}} \]
      5. *-inverses49.0%

        \[\leadsto \frac{t}{\frac{\ell}{\color{blue}{1}} \cdot {x}^{-0.5}} \]
      6. /-rgt-identity49.0%

        \[\leadsto \frac{t}{\color{blue}{\ell} \cdot {x}^{-0.5}} \]
    8. Simplified49.0%

      \[\leadsto \color{blue}{\frac{t}{\ell \cdot {x}^{-0.5}}} \]

    if 9.49999999999999955e-167 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 84.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 7: 79.8% accurate, 2.0× speedup?

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

\mathbf{elif}\;t \leq 1.06 \cdot 10^{-172}:\\
\;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000002e-124 < t < 1.05999999999999993e-172

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{\sqrt{\color{blue}{{x}^{-1}}}}}} \]
      4. sqrt-pow148.8%

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{\color{blue}{-0.5}}}}} \]
    6. Applied egg-rr48.8%

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

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

        \[\leadsto \frac{\color{blue}{t}}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{-0.5}}}} \]
      3. associate-/r/48.9%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell \cdot \sqrt{2}}{\sqrt{2}} \cdot {x}^{-0.5}}} \]
      4. associate-/l*49.0%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot {x}^{-0.5}} \]
      5. *-inverses49.0%

        \[\leadsto \frac{t}{\frac{\ell}{\color{blue}{1}} \cdot {x}^{-0.5}} \]
      6. /-rgt-identity49.0%

        \[\leadsto \frac{t}{\color{blue}{\ell} \cdot {x}^{-0.5}} \]
    8. Simplified49.0%

      \[\leadsto \color{blue}{\frac{t}{\ell \cdot {x}^{-0.5}}} \]

    if 1.05999999999999993e-172 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in t around 0 84.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-124}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{1 + x}}\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{-172}:\\ \;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternative 8: 79.2% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.26 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{-165}:\\ \;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\ \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 -1.26e-124)
   (+ (/ 1.0 x) -1.0)
   (if (<= t 1.36e-165) (/ t (* l (pow x -0.5))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.26e-124) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= 1.36e-165) {
		tmp = t / (l * pow(x, -0.5));
	} 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 <= (-1.26d-124)) then
        tmp = (1.0d0 / x) + (-1.0d0)
    else if (t <= 1.36d-165) then
        tmp = t / (l * (x ** (-0.5d0)))
    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 <= -1.26e-124) {
		tmp = (1.0 / x) + -1.0;
	} else if (t <= 1.36e-165) {
		tmp = t / (l * Math.pow(x, -0.5));
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -1.26e-124:
		tmp = (1.0 / x) + -1.0
	elif t <= 1.36e-165:
		tmp = t / (l * math.pow(x, -0.5))
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
l = abs(l)
function code(x, l, t)
	tmp = 0.0
	if (t <= -1.26e-124)
		tmp = Float64(Float64(1.0 / x) + -1.0);
	elseif (t <= 1.36e-165)
		tmp = Float64(t / Float64(l * (x ^ -0.5)));
	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 <= -1.26e-124)
		tmp = (1.0 / x) + -1.0;
	elseif (t <= 1.36e-165)
		tmp = t / (l * (x ^ -0.5));
	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, -1.26e-124], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[t, 1.36e-165], N[(t / N[(l * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{-124}:\\
\;\;\;\;\frac{1}{x} + -1\\

\mathbf{elif}\;t \leq 1.36 \cdot 10^{-165}:\\
\;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

    if -1.2600000000000001e-124 < t < 1.3599999999999999e-165

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{\sqrt{\color{blue}{{x}^{-1}}}}}} \]
      4. sqrt-pow148.8%

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

        \[\leadsto t \cdot \frac{1}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{\color{blue}{-0.5}}}}} \]
    6. Applied egg-rr48.8%

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

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

        \[\leadsto \frac{\color{blue}{t}}{\frac{\ell \cdot \sqrt{2}}{\frac{\sqrt{2}}{{x}^{-0.5}}}} \]
      3. associate-/r/48.9%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell \cdot \sqrt{2}}{\sqrt{2}} \cdot {x}^{-0.5}}} \]
      4. associate-/l*49.0%

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell}{\frac{\sqrt{2}}{\sqrt{2}}}} \cdot {x}^{-0.5}} \]
      5. *-inverses49.0%

        \[\leadsto \frac{t}{\frac{\ell}{\color{blue}{1}} \cdot {x}^{-0.5}} \]
      6. /-rgt-identity49.0%

        \[\leadsto \frac{t}{\color{blue}{\ell} \cdot {x}^{-0.5}} \]
    8. Simplified49.0%

      \[\leadsto \color{blue}{\frac{t}{\ell \cdot {x}^{-0.5}}} \]

    if 1.3599999999999999e-165 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.26 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{-165}:\\ \;\;\;\;\frac{t}{\ell \cdot {x}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 9: 79.1% accurate, 2.1× speedup?

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

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

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

    if -6.10000000000000003e-125 < t < 2.5000000000000001e-167

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Taylor expanded in t around 0 43.8%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{\ell}{\sqrt{x}}}} \]
      3. *-rgt-identity48.9%

        \[\leadsto \frac{\color{blue}{t \cdot 1}}{\frac{\ell}{\sqrt{x}}} \]
      4. associate-*r/48.9%

        \[\leadsto \color{blue}{t \cdot \frac{1}{\frac{\ell}{\sqrt{x}}}} \]
      5. associate-/r/48.9%

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

        \[\leadsto t \cdot \color{blue}{\frac{1 \cdot \sqrt{x}}{\ell}} \]
      7. *-lft-identity48.9%

        \[\leadsto t \cdot \frac{\color{blue}{\sqrt{x}}}{\ell} \]
    8. Simplified48.9%

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

    if 2.5000000000000001e-167 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.1 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-167}:\\ \;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 10: 79.2% accurate, 2.1× speedup?

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

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

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


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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(-t \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}} \]
      3. distribute-rgt-neg-out79.8%

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

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

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

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

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

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

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

    if -5.8000000000000004e-125 < t < 1.29999999999999998e-161

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{\ell \cdot \sqrt{\frac{1}{x}}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u30.3%

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

        \[\leadsto \frac{t}{\color{blue}{e^{\mathsf{log1p}\left(\ell \cdot \sqrt{\frac{1}{x}}\right)} - 1}} \]
      3. add-sqr-sqrt16.4%

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

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

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

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

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

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\color{blue}{\frac{\sqrt{{\ell}^{2}}}{\sqrt{x}}}\right)} - 1} \]
      9. unpow237.2%

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{x}}\right)} - 1} \]
      10. sqrt-prod16.4%

        \[\leadsto \frac{t}{e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{x}}\right)} - 1} \]
      11. add-sqr-sqrt17.1%

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

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

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

        \[\leadsto \frac{t}{\color{blue}{\frac{\ell}{\sqrt{x}}}} \]
    9. Simplified48.9%

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

    if 1.29999999999999998e-161 < t

    1. Initial program 46.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. Simplified46.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 84.4%

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-161}:\\ \;\;\;\;\frac{t}{\frac{\ell}{\sqrt{x}}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 11: 75.3% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-t}\\ \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) (/ t (- t)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = t / -t;
	} 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 = t / -t
    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 = t / -t;
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
l = abs(l)
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = t / -t
	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(t / Float64(-t));
	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 = t / -t;
	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[(t / (-t)), $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}:\\
\;\;\;\;\frac{t}{-t}\\

\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 26.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. Simplified26.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot {\left(\sqrt{-1}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative0.0%

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

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t} \]
      3. rem-square-sqrt64.7%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t} \]
      4. mul-1-neg64.7%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    8. Simplified64.7%

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

    if -4.999999999999985e-310 < t

    1. Initial program 40.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 76.1%

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

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

Alternative 12: 75.6% accurate, 31.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{1}{x} + -1\\ \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 x) -1.0) (+ 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 / x) + -1.0;
	} 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 / x) + (-1.0d0)
    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 / x) + -1.0;
	} 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 / x) + -1.0
	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(Float64(1.0 / x) + -1.0);
	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 / x) + -1.0;
	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[(N[(1.0 / x), $MachinePrecision] + -1.0), $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}:\\
\;\;\;\;\frac{1}{x} + -1\\

\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 26.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. Simplified26.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 t around -inf 65.3%

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < t

    1. Initial program 40.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot \sqrt{\frac{x + 1}{-1 + x}}}} \]
    6. Taylor expanded in x around inf 76.1%

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

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

Alternative 13: 74.9% accurate, 37.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{t \cdot {\left(\sqrt{-1}\right)}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative0.0%

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

        \[\leadsto \frac{t}{\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot t} \]
      3. rem-square-sqrt64.7%

        \[\leadsto \frac{t}{\color{blue}{-1} \cdot t} \]
      4. mul-1-neg64.7%

        \[\leadsto \frac{t}{\color{blue}{-t}} \]
    8. Simplified64.7%

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

    if -4.999999999999985e-310 < t

    1. Initial program 40.2%

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

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

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

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

Alternative 14: 38.6% accurate, 75.0× speedup?

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

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

    \[\leadsto \frac{t}{\color{blue}{t}} \]
  4. Final simplification40.0%

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

Reproduce

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