Toniolo and Linder, Equation (7)

Percentage Accurate: 33.6% → 83.2%
Time: 20.1s
Alternatives: 10
Speedup: 225.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 33.6% accurate, 1.0× speedup?

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

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

Alternative 1: 83.2% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt{\frac{2}{x}}\\ t_3 := 2 \cdot {t\_m}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\ \mathbf{elif}\;t\_m \leq 7.6 \cdot 10^{-246}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 2.35 \cdot 10^{-180}:\\ \;\;\;\;\frac{1}{l\_m \cdot t\_2} \cdot \left(t\_m \cdot \sqrt{2}\right)\\ \mathbf{elif}\;t\_m \leq 1.15 \cdot 10^{-17}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_3 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_3 + {l\_m}^{2}}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (sqrt (/ 2.0 x))) (t_3 (* 2.0 (pow t_m 2.0))))
   (*
    t_s
    (if (<= t_m 9e-273)
      (* (sqrt 2.0) (* (/ 1.0 l_m) (/ t_m t_2)))
      (if (<= t_m 7.6e-246)
        1.0
        (if (<= t_m 2.35e-180)
          (* (/ 1.0 (* l_m t_2)) (* t_m (sqrt 2.0)))
          (if (<= t_m 1.15e-17)
            (*
             (sqrt 2.0)
             (/
              t_m
              (sqrt
               (+
                (+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_3 (/ (pow l_m 2.0) x)))
                (/ (+ t_3 (pow l_m 2.0)) x)))))
            (sqrt (/ (+ x -1.0) (+ 1.0 x))))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = sqrt((2.0 / x));
	double t_3 = 2.0 * pow(t_m, 2.0);
	double tmp;
	if (t_m <= 9e-273) {
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 7.6e-246) {
		tmp = 1.0;
	} else if (t_m <= 2.35e-180) {
		tmp = (1.0 / (l_m * t_2)) * (t_m * sqrt(2.0));
	} else if (t_m <= 1.15e-17) {
		tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_3 + (pow(l_m, 2.0) / x))) + ((t_3 + pow(l_m, 2.0)) / x))));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = sqrt((2.0d0 / x))
    t_3 = 2.0d0 * (t_m ** 2.0d0)
    if (t_m <= 9d-273) then
        tmp = sqrt(2.0d0) * ((1.0d0 / l_m) * (t_m / t_2))
    else if (t_m <= 7.6d-246) then
        tmp = 1.0d0
    else if (t_m <= 2.35d-180) then
        tmp = (1.0d0 / (l_m * t_2)) * (t_m * sqrt(2.0d0))
    else if (t_m <= 1.15d-17) then
        tmp = sqrt(2.0d0) * (t_m / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_3 + ((l_m ** 2.0d0) / x))) + ((t_3 + (l_m ** 2.0d0)) / x))))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = Math.sqrt((2.0 / x));
	double t_3 = 2.0 * Math.pow(t_m, 2.0);
	double tmp;
	if (t_m <= 9e-273) {
		tmp = Math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 7.6e-246) {
		tmp = 1.0;
	} else if (t_m <= 2.35e-180) {
		tmp = (1.0 / (l_m * t_2)) * (t_m * Math.sqrt(2.0));
	} else if (t_m <= 1.15e-17) {
		tmp = Math.sqrt(2.0) * (t_m / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_3 + (Math.pow(l_m, 2.0) / x))) + ((t_3 + Math.pow(l_m, 2.0)) / x))));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = math.sqrt((2.0 / x))
	t_3 = 2.0 * math.pow(t_m, 2.0)
	tmp = 0
	if t_m <= 9e-273:
		tmp = math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2))
	elif t_m <= 7.6e-246:
		tmp = 1.0
	elif t_m <= 2.35e-180:
		tmp = (1.0 / (l_m * t_2)) * (t_m * math.sqrt(2.0))
	elif t_m <= 1.15e-17:
		tmp = math.sqrt(2.0) * (t_m / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_3 + (math.pow(l_m, 2.0) / x))) + ((t_3 + math.pow(l_m, 2.0)) / x))))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = sqrt(Float64(2.0 / x))
	t_3 = Float64(2.0 * (t_m ^ 2.0))
	tmp = 0.0
	if (t_m <= 9e-273)
		tmp = Float64(sqrt(2.0) * Float64(Float64(1.0 / l_m) * Float64(t_m / t_2)));
	elseif (t_m <= 7.6e-246)
		tmp = 1.0;
	elseif (t_m <= 2.35e-180)
		tmp = Float64(Float64(1.0 / Float64(l_m * t_2)) * Float64(t_m * sqrt(2.0)));
	elseif (t_m <= 1.15e-17)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_3 + Float64((l_m ^ 2.0) / x))) + Float64(Float64(t_3 + (l_m ^ 2.0)) / x)))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = sqrt((2.0 / x));
	t_3 = 2.0 * (t_m ^ 2.0);
	tmp = 0.0;
	if (t_m <= 9e-273)
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	elseif (t_m <= 7.6e-246)
		tmp = 1.0;
	elseif (t_m <= 2.35e-180)
		tmp = (1.0 / (l_m * t_2)) * (t_m * sqrt(2.0));
	elseif (t_m <= 1.15e-17)
		tmp = sqrt(2.0) * (t_m / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_3 + ((l_m ^ 2.0) / x))) + ((t_3 + (l_m ^ 2.0)) / x))));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9e-273], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(1.0 / l$95$m), $MachinePrecision] * N[(t$95$m / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.6e-246], 1.0, If[LessEqual[t$95$m, 2.35e-180], N[(N[(1.0 / N[(l$95$m * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.15e-17], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sqrt{\frac{2}{x}}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\
\;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\

\mathbf{elif}\;t\_m \leq 7.6 \cdot 10^{-246}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 2.35 \cdot 10^{-180}:\\
\;\;\;\;\frac{1}{l\_m \cdot t\_2} \cdot \left(t\_m \cdot \sqrt{2}\right)\\

\mathbf{elif}\;t\_m \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_3 + \frac{{l\_m}^{2}}{x}\right)\right) + \frac{t\_3 + {l\_m}^{2}}{x}}}\\

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


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

    1. Initial program 30.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. Simplified30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube9.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)}^{0.3333333333333333}}} \]
      3. pow39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*9.8%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv9.8%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity9.8%

        \[\leadsto \sqrt{2} \cdot \frac{\color{blue}{1 \cdot t}}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}} \]
      2. unpow1/39.9%

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

        \[\leadsto \sqrt{2} \cdot \frac{1 \cdot t}{\color{blue}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      4. times-frac14.6%

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

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

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

    if 8.99999999999999921e-273 < t < 7.59999999999999951e-246

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999951e-246 < t < 2.34999999999999988e-180

    1. Initial program 1.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/353.1%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*53.1%

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \color{blue}{\frac{\sqrt{2}}{\sqrt{x}}}\right)}^{3}\right)}^{0.3333333333333333}} \]
    9. Applied egg-rr53.1%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. unpow1/356.8%

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      4. clear-num56.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{\sqrt{2} \cdot t}}} \]
      5. sqrt-undiv56.7%

        \[\leadsto \frac{1}{\frac{\ell \cdot \color{blue}{\sqrt{\frac{2}{x}}}}{\sqrt{2} \cdot t}} \]
    11. Applied egg-rr56.7%

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

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

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

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

    if 2.34999999999999988e-180 < t < 1.15000000000000004e-17

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\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}}}} \]

    if 1.15000000000000004e-17 < t

    1. Initial program 39.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. Simplified39.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{\ell} \cdot \frac{t}{\sqrt{\frac{2}{x}}}\right)\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{-246}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-180}:\\ \;\;\;\;\frac{1}{\ell \cdot \sqrt{\frac{2}{x}}} \cdot \left(t \cdot \sqrt{2}\right)\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-17}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t}{\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}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt{\frac{2}{x}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\ \mathbf{elif}\;t\_m \leq 7.6 \cdot 10^{-246}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-171}:\\ \;\;\;\;\frac{1}{l\_m \cdot t\_2} \cdot \left(t\_m \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (sqrt (/ 2.0 x))))
   (*
    t_s
    (if (<= t_m 9e-273)
      (* (sqrt 2.0) (* (/ 1.0 l_m) (/ t_m t_2)))
      (if (<= t_m 7.6e-246)
        1.0
        (if (<= t_m 2.8e-171)
          (* (/ 1.0 (* l_m t_2)) (* t_m (sqrt 2.0)))
          (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = sqrt((2.0 / x));
	double tmp;
	if (t_m <= 9e-273) {
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 7.6e-246) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-171) {
		tmp = (1.0 / (l_m * t_2)) * (t_m * sqrt(2.0));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sqrt((2.0d0 / x))
    if (t_m <= 9d-273) then
        tmp = sqrt(2.0d0) * ((1.0d0 / l_m) * (t_m / t_2))
    else if (t_m <= 7.6d-246) then
        tmp = 1.0d0
    else if (t_m <= 2.8d-171) then
        tmp = (1.0d0 / (l_m * t_2)) * (t_m * sqrt(2.0d0))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = Math.sqrt((2.0 / x));
	double tmp;
	if (t_m <= 9e-273) {
		tmp = Math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 7.6e-246) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-171) {
		tmp = (1.0 / (l_m * t_2)) * (t_m * Math.sqrt(2.0));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = math.sqrt((2.0 / x))
	tmp = 0
	if t_m <= 9e-273:
		tmp = math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2))
	elif t_m <= 7.6e-246:
		tmp = 1.0
	elif t_m <= 2.8e-171:
		tmp = (1.0 / (l_m * t_2)) * (t_m * math.sqrt(2.0))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = sqrt(Float64(2.0 / x))
	tmp = 0.0
	if (t_m <= 9e-273)
		tmp = Float64(sqrt(2.0) * Float64(Float64(1.0 / l_m) * Float64(t_m / t_2)));
	elseif (t_m <= 7.6e-246)
		tmp = 1.0;
	elseif (t_m <= 2.8e-171)
		tmp = Float64(Float64(1.0 / Float64(l_m * t_2)) * Float64(t_m * sqrt(2.0)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = sqrt((2.0 / x));
	tmp = 0.0;
	if (t_m <= 9e-273)
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	elseif (t_m <= 7.6e-246)
		tmp = 1.0;
	elseif (t_m <= 2.8e-171)
		tmp = (1.0 / (l_m * t_2)) * (t_m * sqrt(2.0));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9e-273], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(1.0 / l$95$m), $MachinePrecision] * N[(t$95$m / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.6e-246], 1.0, If[LessEqual[t$95$m, 2.8e-171], N[(N[(1.0 / N[(l$95$m * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sqrt{\frac{2}{x}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\
\;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\

\mathbf{elif}\;t\_m \leq 7.6 \cdot 10^{-246}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-171}:\\
\;\;\;\;\frac{1}{l\_m \cdot t\_2} \cdot \left(t\_m \cdot \sqrt{2}\right)\\

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


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

    1. Initial program 30.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. Simplified30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube9.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)}^{0.3333333333333333}}} \]
      3. pow39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*9.8%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv9.8%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity9.8%

        \[\leadsto \sqrt{2} \cdot \frac{\color{blue}{1 \cdot t}}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}} \]
      2. unpow1/39.9%

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

        \[\leadsto \sqrt{2} \cdot \frac{1 \cdot t}{\color{blue}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      4. times-frac14.6%

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

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

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

    if 8.99999999999999921e-273 < t < 7.59999999999999951e-246

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999951e-246 < t < 2.80000000000000023e-171

    1. Initial program 1.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube51.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/347.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)}^{0.3333333333333333}}} \]
      3. pow347.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*47.8%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv47.8%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. unpow1/351.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{{\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}}}} \]
      2. rem-cbrt-cube51.6%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      4. clear-num51.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{\sqrt{2} \cdot t}}} \]
      5. sqrt-undiv51.6%

        \[\leadsto \frac{1}{\frac{\ell \cdot \color{blue}{\sqrt{\frac{2}{x}}}}{\sqrt{2} \cdot t}} \]
    11. Applied egg-rr51.6%

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

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

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

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

    if 2.80000000000000023e-171 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{\ell} \cdot \frac{t}{\sqrt{\frac{2}{x}}}\right)\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{-246}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-171}:\\ \;\;\;\;\frac{1}{\ell \cdot \sqrt{\frac{2}{x}}} \cdot \left(t \cdot \sqrt{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.3% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt{2} \cdot \left(\frac{t\_m}{l\_m} \cdot \sqrt{\frac{x}{2}}\right)\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-170}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* (sqrt 2.0) (* (/ t_m l_m) (sqrt (/ x 2.0))))))
   (*
    t_s
    (if (<= t_m 9e-273)
      t_2
      (if (<= t_m 1.3e-245)
        1.0
        (if (<= t_m 2.8e-170) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = sqrt(2.0) * ((t_m / l_m) * sqrt((x / 2.0)));
	double tmp;
	if (t_m <= 9e-273) {
		tmp = t_2;
	} else if (t_m <= 1.3e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-170) {
		tmp = t_2;
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sqrt(2.0d0) * ((t_m / l_m) * sqrt((x / 2.0d0)))
    if (t_m <= 9d-273) then
        tmp = t_2
    else if (t_m <= 1.3d-245) then
        tmp = 1.0d0
    else if (t_m <= 2.8d-170) then
        tmp = t_2
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = Math.sqrt(2.0) * ((t_m / l_m) * Math.sqrt((x / 2.0)));
	double tmp;
	if (t_m <= 9e-273) {
		tmp = t_2;
	} else if (t_m <= 1.3e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-170) {
		tmp = t_2;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = math.sqrt(2.0) * ((t_m / l_m) * math.sqrt((x / 2.0)))
	tmp = 0
	if t_m <= 9e-273:
		tmp = t_2
	elif t_m <= 1.3e-245:
		tmp = 1.0
	elif t_m <= 2.8e-170:
		tmp = t_2
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(sqrt(2.0) * Float64(Float64(t_m / l_m) * sqrt(Float64(x / 2.0))))
	tmp = 0.0
	if (t_m <= 9e-273)
		tmp = t_2;
	elseif (t_m <= 1.3e-245)
		tmp = 1.0;
	elseif (t_m <= 2.8e-170)
		tmp = t_2;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = sqrt(2.0) * ((t_m / l_m) * sqrt((x / 2.0)));
	tmp = 0.0;
	if (t_m <= 9e-273)
		tmp = t_2;
	elseif (t_m <= 1.3e-245)
		tmp = 1.0;
	elseif (t_m <= 2.8e-170)
		tmp = t_2;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[N[(x / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9e-273], t$95$2, If[LessEqual[t$95$m, 1.3e-245], 1.0, If[LessEqual[t$95$m, 2.8e-170], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot \left(\frac{t\_m}{l\_m} \cdot \sqrt{\frac{x}{2}}\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{-245}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-170}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.99999999999999921e-273 or 1.30000000000000003e-245 < t < 2.79999999999999995e-170

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/312.4%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*12.4%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv12.4%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \color{blue}{\frac{\sqrt{2}}{\sqrt{x}}}\right)}^{3}\right)}^{0.3333333333333333}} \]
    9. Applied egg-rr12.4%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity12.4%

        \[\leadsto \sqrt{2} \cdot \frac{\color{blue}{1 \cdot t}}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}} \]
      2. unpow1/312.7%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{1 \cdot t}{\color{blue}{\frac{\sqrt{2}}{\sqrt{x}} \cdot \ell}} \]
      5. times-frac15.1%

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

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

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

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

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

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

    if 8.99999999999999921e-273 < t < 1.30000000000000003e-245

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999995e-170 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{t}{\ell} \cdot \sqrt{\frac{x}{2}}\right)\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-170}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{t}{\ell} \cdot \sqrt{\frac{x}{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.7% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \frac{\sqrt{2}}{l\_m \cdot \sqrt{\frac{2}{x}}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 8.5 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_m \leq 2 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{-170}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* t_m (/ (sqrt 2.0) (* l_m (sqrt (/ 2.0 x)))))))
   (*
    t_s
    (if (<= t_m 8.5e-273)
      t_2
      (if (<= t_m 2e-245)
        1.0
        (if (<= t_m 5.6e-170) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = t_m * (sqrt(2.0) / (l_m * sqrt((2.0 / x))));
	double tmp;
	if (t_m <= 8.5e-273) {
		tmp = t_2;
	} else if (t_m <= 2e-245) {
		tmp = 1.0;
	} else if (t_m <= 5.6e-170) {
		tmp = t_2;
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = t_m * (sqrt(2.0d0) / (l_m * sqrt((2.0d0 / x))))
    if (t_m <= 8.5d-273) then
        tmp = t_2
    else if (t_m <= 2d-245) then
        tmp = 1.0d0
    else if (t_m <= 5.6d-170) then
        tmp = t_2
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = t_m * (Math.sqrt(2.0) / (l_m * Math.sqrt((2.0 / x))));
	double tmp;
	if (t_m <= 8.5e-273) {
		tmp = t_2;
	} else if (t_m <= 2e-245) {
		tmp = 1.0;
	} else if (t_m <= 5.6e-170) {
		tmp = t_2;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = t_m * (math.sqrt(2.0) / (l_m * math.sqrt((2.0 / x))))
	tmp = 0
	if t_m <= 8.5e-273:
		tmp = t_2
	elif t_m <= 2e-245:
		tmp = 1.0
	elif t_m <= 5.6e-170:
		tmp = t_2
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(t_m * Float64(sqrt(2.0) / Float64(l_m * sqrt(Float64(2.0 / x)))))
	tmp = 0.0
	if (t_m <= 8.5e-273)
		tmp = t_2;
	elseif (t_m <= 2e-245)
		tmp = 1.0;
	elseif (t_m <= 5.6e-170)
		tmp = t_2;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = t_m * (sqrt(2.0) / (l_m * sqrt((2.0 / x))));
	tmp = 0.0;
	if (t_m <= 8.5e-273)
		tmp = t_2;
	elseif (t_m <= 2e-245)
		tmp = 1.0;
	elseif (t_m <= 5.6e-170)
		tmp = t_2;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l$95$m * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.5e-273], t$95$2, If[LessEqual[t$95$m, 2e-245], 1.0, If[LessEqual[t$95$m, 5.6e-170], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := t\_m \cdot \frac{\sqrt{2}}{l\_m \cdot \sqrt{\frac{2}{x}}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.5 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_m \leq 2 \cdot 10^{-245}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{-170}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5000000000000008e-273 or 1.9999999999999999e-245 < t < 5.59999999999999991e-170

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/312.4%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*12.4%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv12.4%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \color{blue}{\frac{\sqrt{2}}{\sqrt{x}}}\right)}^{3}\right)}^{0.3333333333333333}} \]
    9. Applied egg-rr12.4%

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. unpow1/312.7%

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      3. clear-num16.7%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\frac{1}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{t}}} \]
      4. un-div-inv16.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{t}}} \]
      5. sqrt-undiv16.7%

        \[\leadsto \frac{\sqrt{2}}{\frac{\ell \cdot \color{blue}{\sqrt{\frac{2}{x}}}}{t}} \]
    11. Applied egg-rr16.7%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x}}} \cdot t} \]
    13. Simplified17.1%

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

    if 8.5000000000000008e-273 < t < 1.9999999999999999e-245

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 5.59999999999999991e-170 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.5 \cdot 10^{-273}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-170}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.5% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt{\frac{2}{x}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 7.2 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\ \mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{-244}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 3.6 \cdot 10^{-164}:\\ \;\;\;\;t\_m \cdot \frac{\sqrt{2}}{l\_m \cdot t\_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (sqrt (/ 2.0 x))))
   (*
    t_s
    (if (<= t_m 7.2e-273)
      (* (sqrt 2.0) (* (/ 1.0 l_m) (/ t_m t_2)))
      (if (<= t_m 1.8e-244)
        1.0
        (if (<= t_m 3.6e-164)
          (* t_m (/ (sqrt 2.0) (* l_m t_2)))
          (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = sqrt((2.0 / x));
	double tmp;
	if (t_m <= 7.2e-273) {
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 1.8e-244) {
		tmp = 1.0;
	} else if (t_m <= 3.6e-164) {
		tmp = t_m * (sqrt(2.0) / (l_m * t_2));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = sqrt((2.0d0 / x))
    if (t_m <= 7.2d-273) then
        tmp = sqrt(2.0d0) * ((1.0d0 / l_m) * (t_m / t_2))
    else if (t_m <= 1.8d-244) then
        tmp = 1.0d0
    else if (t_m <= 3.6d-164) then
        tmp = t_m * (sqrt(2.0d0) / (l_m * t_2))
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = Math.sqrt((2.0 / x));
	double tmp;
	if (t_m <= 7.2e-273) {
		tmp = Math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	} else if (t_m <= 1.8e-244) {
		tmp = 1.0;
	} else if (t_m <= 3.6e-164) {
		tmp = t_m * (Math.sqrt(2.0) / (l_m * t_2));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = math.sqrt((2.0 / x))
	tmp = 0
	if t_m <= 7.2e-273:
		tmp = math.sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2))
	elif t_m <= 1.8e-244:
		tmp = 1.0
	elif t_m <= 3.6e-164:
		tmp = t_m * (math.sqrt(2.0) / (l_m * t_2))
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = sqrt(Float64(2.0 / x))
	tmp = 0.0
	if (t_m <= 7.2e-273)
		tmp = Float64(sqrt(2.0) * Float64(Float64(1.0 / l_m) * Float64(t_m / t_2)));
	elseif (t_m <= 1.8e-244)
		tmp = 1.0;
	elseif (t_m <= 3.6e-164)
		tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(l_m * t_2)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = sqrt((2.0 / x));
	tmp = 0.0;
	if (t_m <= 7.2e-273)
		tmp = sqrt(2.0) * ((1.0 / l_m) * (t_m / t_2));
	elseif (t_m <= 1.8e-244)
		tmp = 1.0;
	elseif (t_m <= 3.6e-164)
		tmp = t_m * (sqrt(2.0) / (l_m * t_2));
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 7.2e-273], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(1.0 / l$95$m), $MachinePrecision] * N[(t$95$m / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.8e-244], 1.0, If[LessEqual[t$95$m, 3.6e-164], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l$95$m * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \sqrt{\frac{2}{x}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.2 \cdot 10^{-273}:\\
\;\;\;\;\sqrt{2} \cdot \left(\frac{1}{l\_m} \cdot \frac{t\_m}{t\_2}\right)\\

\mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{-244}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 3.6 \cdot 10^{-164}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2}}{l\_m \cdot t\_2}\\

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


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

    1. Initial program 30.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. Simplified30.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube9.9%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)}^{0.3333333333333333}}} \]
      3. pow39.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*9.8%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv9.8%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity9.8%

        \[\leadsto \sqrt{2} \cdot \frac{\color{blue}{1 \cdot t}}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}} \]
      2. unpow1/39.9%

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

        \[\leadsto \sqrt{2} \cdot \frac{1 \cdot t}{\color{blue}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      4. times-frac14.6%

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

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

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

    if 7.19999999999999986e-273 < t < 1.79999999999999987e-244

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 1.79999999999999987e-244 < t < 3.59999999999999994e-164

    1. Initial program 1.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}}} \]
    8. Step-by-step derivation
      1. add-cbrt-cube51.3%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}}} \]
      2. pow1/347.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left(\left(\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right) \cdot \left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)\right)}^{0.3333333333333333}}} \]
      3. pow347.8%

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\color{blue}{\left({\left(\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{x}}\right)}^{3}\right)}}^{0.3333333333333333}} \]
      4. associate-*l*47.8%

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{{\left({\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\color{blue}{1}}{\sqrt{x}}\right)\right)}^{3}\right)}^{0.3333333333333333}} \]
      7. un-div-inv47.8%

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{{\left({\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    10. Step-by-step derivation
      1. unpow1/351.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{{\left(\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}\right)}^{3}}}} \]
      2. rem-cbrt-cube51.6%

        \[\leadsto \sqrt{2} \cdot \frac{t}{\color{blue}{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}} \]
      3. clear-num51.7%

        \[\leadsto \sqrt{2} \cdot \color{blue}{\frac{1}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{t}}} \]
      4. un-div-inv51.7%

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{\frac{\ell \cdot \frac{\sqrt{2}}{\sqrt{x}}}{t}}} \]
      5. sqrt-undiv51.6%

        \[\leadsto \frac{\sqrt{2}}{\frac{\ell \cdot \color{blue}{\sqrt{\frac{2}{x}}}}{t}} \]
    11. Applied egg-rr51.6%

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

        \[\leadsto \color{blue}{\frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x}}} \cdot t} \]
    13. Simplified51.7%

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

    if 3.59999999999999994e-164 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7.2 \cdot 10^{-273}:\\ \;\;\;\;\sqrt{2} \cdot \left(\frac{1}{\ell} \cdot \frac{t}{\sqrt{\frac{2}{x}}}\right)\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-244}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-164}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.3% accurate, 1.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{l\_m} \cdot \sqrt{x}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 8.5 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_m \leq 2.85 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-171}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* (/ t_m l_m) (sqrt x))))
   (*
    t_s
    (if (<= t_m 8.5e-273)
      t_2
      (if (<= t_m 2.85e-245)
        1.0
        (if (<= t_m 2.8e-171) t_2 (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = (t_m / l_m) * sqrt(x);
	double tmp;
	if (t_m <= 8.5e-273) {
		tmp = t_2;
	} else if (t_m <= 2.85e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-171) {
		tmp = t_2;
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = (t_m / l_m) * sqrt(x)
    if (t_m <= 8.5d-273) then
        tmp = t_2
    else if (t_m <= 2.85d-245) then
        tmp = 1.0d0
    else if (t_m <= 2.8d-171) then
        tmp = t_2
    else
        tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = (t_m / l_m) * Math.sqrt(x);
	double tmp;
	if (t_m <= 8.5e-273) {
		tmp = t_2;
	} else if (t_m <= 2.85e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.8e-171) {
		tmp = t_2;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = (t_m / l_m) * math.sqrt(x)
	tmp = 0
	if t_m <= 8.5e-273:
		tmp = t_2
	elif t_m <= 2.85e-245:
		tmp = 1.0
	elif t_m <= 2.8e-171:
		tmp = t_2
	else:
		tmp = math.sqrt(((x + -1.0) / (1.0 + x)))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(Float64(t_m / l_m) * sqrt(x))
	tmp = 0.0
	if (t_m <= 8.5e-273)
		tmp = t_2;
	elseif (t_m <= 2.85e-245)
		tmp = 1.0;
	elseif (t_m <= 2.8e-171)
		tmp = t_2;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = (t_m / l_m) * sqrt(x);
	tmp = 0.0;
	if (t_m <= 8.5e-273)
		tmp = t_2;
	elseif (t_m <= 2.85e-245)
		tmp = 1.0;
	elseif (t_m <= 2.8e-171)
		tmp = t_2;
	else
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.5e-273], t$95$2, If[LessEqual[t$95$m, 2.85e-245], 1.0, If[LessEqual[t$95$m, 2.8e-171], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{l\_m} \cdot \sqrt{x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.5 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_m \leq 2.85 \cdot 10^{-245}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-171}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5000000000000008e-273 or 2.85e-245 < t < 2.80000000000000023e-171

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000008e-273 < t < 2.85e-245

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 2.80000000000000023e-171 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.5 \cdot 10^{-273}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{elif}\;t \leq 2.85 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-171}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.9% accurate, 1.9× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{t\_m}{l\_m} \cdot \sqrt{x}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{-171}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5}{x}}{x}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* (/ t_m l_m) (sqrt x))))
   (*
    t_s
    (if (<= t_m 9e-273)
      t_2
      (if (<= t_m 5.6e-245)
        1.0
        (if (<= t_m 2.7e-171) t_2 (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = (t_m / l_m) * sqrt(x);
	double tmp;
	if (t_m <= 9e-273) {
		tmp = t_2;
	} else if (t_m <= 5.6e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.7e-171) {
		tmp = t_2;
	} else {
		tmp = 1.0 + ((-1.0 + (0.5 / x)) / x);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = (t_m / l_m) * sqrt(x)
    if (t_m <= 9d-273) then
        tmp = t_2
    else if (t_m <= 5.6d-245) then
        tmp = 1.0d0
    else if (t_m <= 2.7d-171) then
        tmp = t_2
    else
        tmp = 1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = (t_m / l_m) * Math.sqrt(x);
	double tmp;
	if (t_m <= 9e-273) {
		tmp = t_2;
	} else if (t_m <= 5.6e-245) {
		tmp = 1.0;
	} else if (t_m <= 2.7e-171) {
		tmp = t_2;
	} else {
		tmp = 1.0 + ((-1.0 + (0.5 / x)) / x);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = (t_m / l_m) * math.sqrt(x)
	tmp = 0
	if t_m <= 9e-273:
		tmp = t_2
	elif t_m <= 5.6e-245:
		tmp = 1.0
	elif t_m <= 2.7e-171:
		tmp = t_2
	else:
		tmp = 1.0 + ((-1.0 + (0.5 / x)) / x)
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(Float64(t_m / l_m) * sqrt(x))
	tmp = 0.0
	if (t_m <= 9e-273)
		tmp = t_2;
	elseif (t_m <= 5.6e-245)
		tmp = 1.0;
	elseif (t_m <= 2.7e-171)
		tmp = t_2;
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = (t_m / l_m) * sqrt(x);
	tmp = 0.0;
	if (t_m <= 9e-273)
		tmp = t_2;
	elseif (t_m <= 5.6e-245)
		tmp = 1.0;
	elseif (t_m <= 2.7e-171)
		tmp = t_2;
	else
		tmp = 1.0 + ((-1.0 + (0.5 / x)) / x);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9e-273], t$95$2, If[LessEqual[t$95$m, 5.6e-245], 1.0, If[LessEqual[t$95$m, 2.7e-171], t$95$2, N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{t\_m}{l\_m} \cdot \sqrt{x}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9 \cdot 10^{-273}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{-245}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{-171}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.99999999999999921e-273 or 5.6000000000000003e-245 < t < 2.70000000000000014e-171

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999921e-273 < t < 5.6000000000000003e-245

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000014e-171 < t

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-273}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{-245}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-171}:\\ \;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5}{x}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 76.5% accurate, 25.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(1 + \frac{-1 + \frac{0.5}{x}}{x}\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (* t_s (+ 1.0 (/ (+ -1.0 (/ 0.5 x)) x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + (((-1.0d0) + (0.5d0 / x)) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * (1.0 + ((-1.0 + (0.5 / x)) / x))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * Float64(1.0 + Float64(Float64(-1.0 + Float64(0.5 / x)) / x)))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * (1.0 + ((-1.0 + (0.5 / x)) / x));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(-1.0 + N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(1 + \frac{-1 + \frac{0.5}{x}}{x}\right)
\end{array}
Derivation
  1. Initial program 34.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 + \frac{-1 + \frac{0.5}{x}}{x}} \]
  10. Final simplification38.8%

    \[\leadsto 1 + \frac{-1 + \frac{0.5}{x}}{x} \]
  11. Add Preprocessing

Alternative 9: 76.3% accurate, 45.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(1 + \frac{-1}{x}\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * (1.0 + (-1.0 / x))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * Float64(1.0 + Float64(-1.0 / x)))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * (1.0 + (-1.0 / x));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
Derivation
  1. Initial program 34.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  8. Final simplification38.7%

    \[\leadsto 1 + \frac{-1}{x} \]
  9. Add Preprocessing

Alternative 10: 75.6% accurate, 225.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot 1 \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	return t_s * 1.0;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	return t_s * 1.0;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	return t_s * 1.0
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	return Float64(t_s * 1.0)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l_m, t_m)
	tmp = t_s * 1.0;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot 1
\end{array}
Derivation
  1. Initial program 34.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  8. Final simplification38.4%

    \[\leadsto 1 \]
  9. Add Preprocessing

Reproduce

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