Toniolo and Linder, Equation (7)

Percentage Accurate: 34.1% → 85.4%
Time: 22.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: 34.1% 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: 85.4% accurate, 0.4× 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{x + -1}{x + 1}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 8.5 \cdot 10^{-245}:\\ \;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\ \mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + 2 \cdot {l_m}^{2}}{t_m \cdot \left(x \cdot \sqrt{2}\right)} + t_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t_2}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (/ (+ x -1.0) (+ x 1.0))))
   (*
    t_s
    (if (<= t_m 8.5e-245)
      (/ (* t_m (sqrt (* x 0.5))) (/ l_m (sqrt 2.0)))
      (if (<= t_m 2.75e-176)
        (*
         t_m
         (/
          (sqrt 2.0)
          (+
           (*
            0.5
            (/
             (+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l_m 2.0)))
             (* t_m (* x (sqrt 2.0)))))
           (* t_m (sqrt 2.0)))))
        (if (<= t_m 3.2e+55)
          (*
           t_m
           (/
            (sqrt 2.0)
            (sqrt
             (fma 2.0 (/ (pow t_m 2.0) t_2) (* 2.0 (/ (pow l_m 2.0) x))))))
          (sqrt t_2)))))))
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 = (x + -1.0) / (x + 1.0);
	double tmp;
	if (t_m <= 8.5e-245) {
		tmp = (t_m * sqrt((x * 0.5))) / (l_m / sqrt(2.0));
	} else if (t_m <= 2.75e-176) {
		tmp = t_m * (sqrt(2.0) / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l_m, 2.0))) / (t_m * (x * sqrt(2.0))))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 3.2e+55) {
		tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), (2.0 * (pow(l_m, 2.0) / x)))));
	} else {
		tmp = sqrt(t_2);
	}
	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(x + -1.0) / Float64(x + 1.0))
	tmp = 0.0
	if (t_m <= 8.5e-245)
		tmp = Float64(Float64(t_m * sqrt(Float64(x * 0.5))) / Float64(l_m / sqrt(2.0)));
	elseif (t_m <= 2.75e-176)
		tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l_m ^ 2.0))) / Float64(t_m * Float64(x * sqrt(2.0))))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 3.2e+55)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(2.0 * Float64((l_m ^ 2.0) / x))))));
	else
		tmp = sqrt(t_2);
	end
	return Float64(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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.5e-245], N[(N[(t$95$m * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.75e-176], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.2e+55], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $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{x + -1}{x + 1}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 8.5 \cdot 10^{-245}:\\
\;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\

\mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{2 \cdot \left({t_m}^{2} + {t_m}^{2}\right) + 2 \cdot {l_m}^{2}}{t_m \cdot \left(x \cdot \sqrt{2}\right)} + t_m \cdot \sqrt{2}}\\

\mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    9. Simplified12.4%

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

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

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

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

    if 8.50000000000000022e-245 < t < 2.75e-176

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.75e-176 < t < 3.2000000000000003e55

    1. Initial program 49.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. Simplified49.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000003e55 < t

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.5 \cdot 10^{-245}:\\ \;\;\;\;\frac{t \cdot \sqrt{x \cdot 0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.75 \cdot 10^{-176}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{2 \cdot \left({t}^{2} + {t}^{2}\right) + 2 \cdot {\ell}^{2}}{t \cdot \left(x \cdot \sqrt{2}\right)} + t \cdot \sqrt{2}}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+55}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{x + -1}{x + 1}}, 2 \cdot \frac{{\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 79.0% 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) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_m}{\frac{l_m}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{{x}^{2}} + \left(\frac{1}{x} + \frac{1}{{x}^{3}}\right)\right)}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<=
       (/
        (* t_m (sqrt 2.0))
        (sqrt
         (-
          (* (/ (+ x 1.0) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
          (* l_m l_m))))
       2.0)
    (sqrt (/ (+ x -1.0) (+ x 1.0)))
    (/
     t_m
     (*
      (/ l_m (sqrt 2.0))
      (sqrt
       (+
        (/ 1.0 (+ x -1.0))
        (+ (/ 1.0 (pow x 2.0)) (+ (/ 1.0 x) (/ 1.0 (pow x 3.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) {
	double tmp;
	if (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + ((1.0 / pow(x, 2.0)) + ((1.0 / x) + (1.0 / pow(x, 3.0)))))));
	}
	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) :: tmp
    if (((t_m * sqrt(2.0d0)) / sqrt(((((x + 1.0d0) / (x + (-1.0d0))) * ((l_m * l_m) + (2.0d0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0d0) then
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    else
        tmp = t_m / ((l_m / sqrt(2.0d0)) * sqrt(((1.0d0 / (x + (-1.0d0))) + ((1.0d0 / (x ** 2.0d0)) + ((1.0d0 / x) + (1.0d0 / (x ** 3.0d0)))))))
    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 tmp;
	if (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = t_m / ((l_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / Math.pow(x, 2.0)) + ((1.0 / x) + (1.0 / Math.pow(x, 3.0)))))));
	}
	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):
	tmp = 0
	if ((t_m * math.sqrt(2.0)) / math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	else:
		tmp = t_m / ((l_m / math.sqrt(2.0)) * math.sqrt(((1.0 / (x + -1.0)) + ((1.0 / math.pow(x, 2.0)) + ((1.0 / x) + (1.0 / math.pow(x, 3.0)))))))
	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)
	tmp = 0.0
	if (Float64(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= 2.0)
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m / Float64(Float64(l_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / (x ^ 2.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 3.0))))))));
	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)
	tmp = 0.0;
	if (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0)
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	else
		tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (x + -1.0)) + ((1.0 / (x ^ 2.0)) + ((1.0 / x) + (1.0 / (x ^ 3.0)))))));
	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_] := N[(t$95$s * If[LessEqual[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m / N[(N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t}{\sqrt{\frac{1}{x + -1} + \color{blue}{\left(\frac{1}{x} + \left(\frac{1}{{x}^{2}} + \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{\ell}{\sqrt{2}}} \]
    10. Step-by-step derivation
      1. associate-+r+38.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \leq 2:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \left(\frac{1}{{x}^{2}} + \left(\frac{1}{x} + \frac{1}{{x}^{3}}\right)\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.9% accurate, 0.4× 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{x + -1}{x + 1}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 10^{-211}:\\ \;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\ \mathbf{elif}\;t_m \leq 2.4 \cdot 10^{-177}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t_2}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (/ (+ x -1.0) (+ x 1.0))))
   (*
    t_s
    (if (<= t_m 1e-211)
      (/ (* t_m (sqrt (* x 0.5))) (/ l_m (sqrt 2.0)))
      (if (<= t_m 2.4e-177)
        1.0
        (if (<= t_m 3.2e+55)
          (*
           t_m
           (/
            (sqrt 2.0)
            (sqrt
             (fma 2.0 (/ (pow t_m 2.0) t_2) (* 2.0 (/ (pow l_m 2.0) x))))))
          (sqrt t_2)))))))
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 = (x + -1.0) / (x + 1.0);
	double tmp;
	if (t_m <= 1e-211) {
		tmp = (t_m * sqrt((x * 0.5))) / (l_m / sqrt(2.0));
	} else if (t_m <= 2.4e-177) {
		tmp = 1.0;
	} else if (t_m <= 3.2e+55) {
		tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) / t_2), (2.0 * (pow(l_m, 2.0) / x)))));
	} else {
		tmp = sqrt(t_2);
	}
	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(x + -1.0) / Float64(x + 1.0))
	tmp = 0.0
	if (t_m <= 1e-211)
		tmp = Float64(Float64(t_m * sqrt(Float64(x * 0.5))) / Float64(l_m / sqrt(2.0)));
	elseif (t_m <= 2.4e-177)
		tmp = 1.0;
	elseif (t_m <= 3.2e+55)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) / t_2), Float64(2.0 * Float64((l_m ^ 2.0) / x))))));
	else
		tmp = sqrt(t_2);
	end
	return Float64(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[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1e-211], N[(N[(t$95$m * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.4e-177], 1.0, If[LessEqual[t$95$m, 3.2e+55], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[t$95$2], $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{x + -1}{x + 1}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 10^{-211}:\\
\;\;\;\;\frac{t_m \cdot \sqrt{x \cdot 0.5}}{\frac{l_m}{\sqrt{2}}}\\

\mathbf{elif}\;t_m \leq 2.4 \cdot 10^{-177}:\\
\;\;\;\;1\\

\mathbf{elif}\;t_m \leq 3.2 \cdot 10^{+55}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t_m}^{2}}{t_2}, 2 \cdot \frac{{l_m}^{2}}{x}\right)}}\\

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


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

    1. Initial program 34.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    9. Simplified14.1%

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

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

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

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

    if 1.00000000000000009e-211 < t < 2.3999999999999999e-177

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e-177 < t < 3.2000000000000003e55

    1. Initial program 49.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. Simplified49.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000003e55 < t

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 10^{-211}:\\ \;\;\;\;\frac{t \cdot \sqrt{x \cdot 0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-177}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+55}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \frac{{t}^{2}}{\frac{x + -1}{x + 1}}, 2 \cdot \frac{{\ell}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.9% accurate, 0.5× 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 \begin{array}{l} \mathbf{if}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_m}{\frac{l_m}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<=
       (/
        (* t_m (sqrt 2.0))
        (sqrt
         (-
          (* (/ (+ x 1.0) (+ x -1.0)) (+ (* l_m l_m) (* 2.0 (* t_m t_m))))
          (* l_m l_m))))
       2.0)
    (sqrt (/ (+ x -1.0) (+ x 1.0)))
    (/ t_m (* (/ l_m (sqrt 2.0)) (sqrt (+ (/ 1.0 (+ 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 tmp;
	if (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (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) :: tmp
    if (((t_m * sqrt(2.0d0)) / sqrt(((((x + 1.0d0) / (x + (-1.0d0))) * ((l_m * l_m) + (2.0d0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0d0) then
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    else
        tmp = t_m / ((l_m / sqrt(2.0d0)) * sqrt(((1.0d0 / (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 tmp;
	if (((t_m * Math.sqrt(2.0)) / Math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0) {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else {
		tmp = t_m / ((l_m / Math.sqrt(2.0)) * Math.sqrt(((1.0 / (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):
	tmp = 0
	if ((t_m * math.sqrt(2.0)) / math.sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	else:
		tmp = t_m / ((l_m / math.sqrt(2.0)) * math.sqrt(((1.0 / (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)
	tmp = 0.0
	if (Float64(Float64(t_m * sqrt(2.0)) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x + -1.0)) * Float64(Float64(l_m * l_m) + Float64(2.0 * Float64(t_m * t_m)))) - Float64(l_m * l_m)))) <= 2.0)
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m / Float64(Float64(l_m / sqrt(2.0)) * sqrt(Float64(Float64(1.0 / 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)
	tmp = 0.0;
	if (((t_m * sqrt(2.0)) / sqrt(((((x + 1.0) / (x + -1.0)) * ((l_m * l_m) + (2.0 * (t_m * t_m)))) - (l_m * l_m)))) <= 2.0)
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	else
		tmp = t_m / ((l_m / sqrt(2.0)) * sqrt(((1.0 / (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_] := N[(t$95$s * If[LessEqual[N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] + N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m / N[(N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $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)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{t_m \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(l_m \cdot l_m + 2 \cdot \left(t_m \cdot t_m\right)\right) - l_m \cdot l_m}} \leq 2:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_m}{\frac{l_m}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{x + 1}{x + -1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \leq 2:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{\ell}{\sqrt{2}} \cdot \sqrt{\frac{1}{x + -1} + \frac{1}{x}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.1% 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(\sqrt{x \cdot 0.5} \cdot \frac{t_m}{l_m}\right)\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 2 \cdot 10^{-211}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_m \leq 8 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_m \leq 5.8 \cdot 10^{-135}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (* (sqrt 2.0) (* (sqrt (* x 0.5)) (/ t_m l_m)))))
   (*
    t_s
    (if (<= t_m 2e-211)
      t_2
      (if (<= t_m 8e-176)
        1.0
        (if (<= t_m 5.8e-135)
          t_2
          (if (<= t_m 2.8e-61)
            (+ 1.0 (/ -1.0 x))
            (if (<= t_m 1.12e-39) t_2 (sqrt (/ (+ x -1.0) (+ x 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) {
	double t_2 = sqrt(2.0) * (sqrt((x * 0.5)) * (t_m / l_m));
	double tmp;
	if (t_m <= 2e-211) {
		tmp = t_2;
	} else if (t_m <= 8e-176) {
		tmp = 1.0;
	} else if (t_m <= 5.8e-135) {
		tmp = t_2;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = t_2;
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	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) * (sqrt((x * 0.5d0)) * (t_m / l_m))
    if (t_m <= 2d-211) then
        tmp = t_2
    else if (t_m <= 8d-176) then
        tmp = 1.0d0
    else if (t_m <= 5.8d-135) then
        tmp = t_2
    else if (t_m <= 2.8d-61) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t_m <= 1.12d-39) then
        tmp = t_2
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    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) * (Math.sqrt((x * 0.5)) * (t_m / l_m));
	double tmp;
	if (t_m <= 2e-211) {
		tmp = t_2;
	} else if (t_m <= 8e-176) {
		tmp = 1.0;
	} else if (t_m <= 5.8e-135) {
		tmp = t_2;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = t_2;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	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) * (math.sqrt((x * 0.5)) * (t_m / l_m))
	tmp = 0
	if t_m <= 2e-211:
		tmp = t_2
	elif t_m <= 8e-176:
		tmp = 1.0
	elif t_m <= 5.8e-135:
		tmp = t_2
	elif t_m <= 2.8e-61:
		tmp = 1.0 + (-1.0 / x)
	elif t_m <= 1.12e-39:
		tmp = t_2
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	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(sqrt(Float64(x * 0.5)) * Float64(t_m / l_m)))
	tmp = 0.0
	if (t_m <= 2e-211)
		tmp = t_2;
	elseif (t_m <= 8e-176)
		tmp = 1.0;
	elseif (t_m <= 5.8e-135)
		tmp = t_2;
	elseif (t_m <= 2.8e-61)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t_m <= 1.12e-39)
		tmp = t_2;
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	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) * (sqrt((x * 0.5)) * (t_m / l_m));
	tmp = 0.0;
	if (t_m <= 2e-211)
		tmp = t_2;
	elseif (t_m <= 8e-176)
		tmp = 1.0;
	elseif (t_m <= 5.8e-135)
		tmp = t_2;
	elseif (t_m <= 2.8e-61)
		tmp = 1.0 + (-1.0 / x);
	elseif (t_m <= 1.12e-39)
		tmp = t_2;
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	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[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2e-211], t$95$2, If[LessEqual[t$95$m, 8e-176], 1.0, If[LessEqual[t$95$m, 5.8e-135], t$95$2, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], t$95$2, N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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(\sqrt{x \cdot 0.5} \cdot \frac{t_m}{l_m}\right)\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2 \cdot 10^{-211}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_m \leq 8 \cdot 10^{-176}:\\
\;\;\;\;1\\

\mathbf{elif}\;t_m \leq 5.8 \cdot 10^{-135}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 2.00000000000000017e-211 or 8e-176 < t < 5.8000000000000004e-135 or 2.8000000000000001e-61 < t < 1.12e-39

    1. Initial program 33.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    9. Simplified17.7%

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-un-lft-identity17.7%

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{1 \cdot t}}{\frac{\ell}{\sqrt{2}}} \]
      3. div-inv17.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{\frac{1 \cdot t}{\ell}}}{{2}^{-0.5}} \]
      3. *-lft-identity17.7%

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\frac{\color{blue}{t}}{\ell}}{{2}^{-0.5}} \]
    13. Simplified17.7%

      \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{\frac{t}{\ell}}{{2}^{-0.5}}} \]
    14. Step-by-step derivation
      1. expm1-log1p-u17.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{x \cdot 0.5} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
      3. associate-*r*17.8%

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

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)} \]
    17. Simplified17.8%

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

    if 2.00000000000000017e-211 < t < 8e-176

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

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

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

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

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

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

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

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

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

    if 5.8000000000000004e-135 < t < 2.8000000000000001e-61

    1. Initial program 37.8%

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

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

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

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

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

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

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

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

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

    if 1.12e-39 < t

    1. Initial program 42.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2 \cdot 10^{-211}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-135}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.1% 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{x \cdot 0.5}\\ t_3 := t_2 \cdot \left(t_m \cdot \frac{\sqrt{2}}{l_m}\right)\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 2.2 \cdot 10^{-211}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_m \leq 4.6 \cdot 10^{-135}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (sqrt (* x 0.5))) (t_3 (* t_2 (* t_m (/ (sqrt 2.0) l_m)))))
   (*
    t_s
    (if (<= t_m 2.2e-211)
      t_3
      (if (<= t_m 2.75e-176)
        1.0
        (if (<= t_m 4.6e-135)
          t_3
          (if (<= t_m 2.8e-61)
            (+ 1.0 (/ -1.0 x))
            (if (<= t_m 1.12e-39)
              (* (sqrt 2.0) (* t_2 (/ t_m l_m)))
              (sqrt (/ (+ x -1.0) (+ x 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) {
	double t_2 = sqrt((x * 0.5));
	double t_3 = t_2 * (t_m * (sqrt(2.0) / l_m));
	double tmp;
	if (t_m <= 2.2e-211) {
		tmp = t_3;
	} else if (t_m <= 2.75e-176) {
		tmp = 1.0;
	} else if (t_m <= 4.6e-135) {
		tmp = t_3;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	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((x * 0.5d0))
    t_3 = t_2 * (t_m * (sqrt(2.0d0) / l_m))
    if (t_m <= 2.2d-211) then
        tmp = t_3
    else if (t_m <= 2.75d-176) then
        tmp = 1.0d0
    else if (t_m <= 4.6d-135) then
        tmp = t_3
    else if (t_m <= 2.8d-61) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t_m <= 1.12d-39) then
        tmp = sqrt(2.0d0) * (t_2 * (t_m / l_m))
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    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((x * 0.5));
	double t_3 = t_2 * (t_m * (Math.sqrt(2.0) / l_m));
	double tmp;
	if (t_m <= 2.2e-211) {
		tmp = t_3;
	} else if (t_m <= 2.75e-176) {
		tmp = 1.0;
	} else if (t_m <= 4.6e-135) {
		tmp = t_3;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = Math.sqrt(2.0) * (t_2 * (t_m / l_m));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	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((x * 0.5))
	t_3 = t_2 * (t_m * (math.sqrt(2.0) / l_m))
	tmp = 0
	if t_m <= 2.2e-211:
		tmp = t_3
	elif t_m <= 2.75e-176:
		tmp = 1.0
	elif t_m <= 4.6e-135:
		tmp = t_3
	elif t_m <= 2.8e-61:
		tmp = 1.0 + (-1.0 / x)
	elif t_m <= 1.12e-39:
		tmp = math.sqrt(2.0) * (t_2 * (t_m / l_m))
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	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(x * 0.5))
	t_3 = Float64(t_2 * Float64(t_m * Float64(sqrt(2.0) / l_m)))
	tmp = 0.0
	if (t_m <= 2.2e-211)
		tmp = t_3;
	elseif (t_m <= 2.75e-176)
		tmp = 1.0;
	elseif (t_m <= 4.6e-135)
		tmp = t_3;
	elseif (t_m <= 2.8e-61)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t_m <= 1.12e-39)
		tmp = Float64(sqrt(2.0) * Float64(t_2 * Float64(t_m / l_m)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	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((x * 0.5));
	t_3 = t_2 * (t_m * (sqrt(2.0) / l_m));
	tmp = 0.0;
	if (t_m <= 2.2e-211)
		tmp = t_3;
	elseif (t_m <= 2.75e-176)
		tmp = 1.0;
	elseif (t_m <= 4.6e-135)
		tmp = t_3;
	elseif (t_m <= 2.8e-61)
		tmp = 1.0 + (-1.0 / x);
	elseif (t_m <= 1.12e-39)
		tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	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[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.2e-211], t$95$3, If[LessEqual[t$95$m, 2.75e-176], 1.0, If[LessEqual[t$95$m, 4.6e-135], t$95$3, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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{x \cdot 0.5}\\
t_3 := t_2 \cdot \left(t_m \cdot \frac{\sqrt{2}}{l_m}\right)\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2.2 \cdot 10^{-211}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_m \leq 2.75 \cdot 10^{-176}:\\
\;\;\;\;1\\

\mathbf{elif}\;t_m \leq 4.6 \cdot 10^{-135}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < 2.19999999999999998e-211 or 2.75e-176 < t < 4.5999999999999998e-135

    1. Initial program 33.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    10. Step-by-step derivation
      1. expm1-log1p-u15.8%

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t \cdot \sqrt{2}}{\ell}\right)} - 1\right)} \]
      3. *-un-lft-identity6.2%

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

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

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

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

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

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

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

    if 2.19999999999999998e-211 < t < 2.75e-176

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

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

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

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

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

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

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

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

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

    if 4.5999999999999998e-135 < t < 2.8000000000000001e-61

    1. Initial program 37.8%

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

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

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

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

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

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

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

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

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

    if 2.8000000000000001e-61 < t < 1.12e-39

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    9. Simplified75.4%

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-un-lft-identity75.4%

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{1 \cdot t}}{\frac{\ell}{\sqrt{2}}} \]
      3. div-inv74.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{\frac{1 \cdot t}{\ell}}}{{2}^{-0.5}} \]
      3. *-lft-identity74.6%

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

      \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{\frac{t}{\ell}}{{2}^{-0.5}}} \]
    14. Step-by-step derivation
      1. expm1-log1p-u74.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{x \cdot 0.5} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
      3. associate-*r*75.8%

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

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)} \]
    17. Simplified75.8%

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

    if 1.12e-39 < t

    1. Initial program 42.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.2 \cdot 10^{-211}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(t \cdot \frac{\sqrt{2}}{\ell}\right)\\ \mathbf{elif}\;t \leq 2.75 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-135}:\\ \;\;\;\;\sqrt{x \cdot 0.5} \cdot \left(t \cdot \frac{\sqrt{2}}{\ell}\right)\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 78.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{x \cdot 0.5}\\ t_3 := \frac{t_m \cdot t_2}{\frac{l_m}{\sqrt{2}}}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 1.85 \cdot 10^{-211}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_m \leq 1.55 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t_m \leq 3.1 \cdot 10^{-135}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (let* ((t_2 (sqrt (* x 0.5))) (t_3 (/ (* t_m t_2) (/ l_m (sqrt 2.0)))))
   (*
    t_s
    (if (<= t_m 1.85e-211)
      t_3
      (if (<= t_m 1.55e-176)
        1.0
        (if (<= t_m 3.1e-135)
          t_3
          (if (<= t_m 2.8e-61)
            (+ 1.0 (/ -1.0 x))
            (if (<= t_m 1.12e-39)
              (* (sqrt 2.0) (* t_2 (/ t_m l_m)))
              (sqrt (/ (+ x -1.0) (+ x 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) {
	double t_2 = sqrt((x * 0.5));
	double t_3 = (t_m * t_2) / (l_m / sqrt(2.0));
	double tmp;
	if (t_m <= 1.85e-211) {
		tmp = t_3;
	} else if (t_m <= 1.55e-176) {
		tmp = 1.0;
	} else if (t_m <= 3.1e-135) {
		tmp = t_3;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	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((x * 0.5d0))
    t_3 = (t_m * t_2) / (l_m / sqrt(2.0d0))
    if (t_m <= 1.85d-211) then
        tmp = t_3
    else if (t_m <= 1.55d-176) then
        tmp = 1.0d0
    else if (t_m <= 3.1d-135) then
        tmp = t_3
    else if (t_m <= 2.8d-61) then
        tmp = 1.0d0 + ((-1.0d0) / x)
    else if (t_m <= 1.12d-39) then
        tmp = sqrt(2.0d0) * (t_2 * (t_m / l_m))
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    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((x * 0.5));
	double t_3 = (t_m * t_2) / (l_m / Math.sqrt(2.0));
	double tmp;
	if (t_m <= 1.85e-211) {
		tmp = t_3;
	} else if (t_m <= 1.55e-176) {
		tmp = 1.0;
	} else if (t_m <= 3.1e-135) {
		tmp = t_3;
	} else if (t_m <= 2.8e-61) {
		tmp = 1.0 + (-1.0 / x);
	} else if (t_m <= 1.12e-39) {
		tmp = Math.sqrt(2.0) * (t_2 * (t_m / l_m));
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	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((x * 0.5))
	t_3 = (t_m * t_2) / (l_m / math.sqrt(2.0))
	tmp = 0
	if t_m <= 1.85e-211:
		tmp = t_3
	elif t_m <= 1.55e-176:
		tmp = 1.0
	elif t_m <= 3.1e-135:
		tmp = t_3
	elif t_m <= 2.8e-61:
		tmp = 1.0 + (-1.0 / x)
	elif t_m <= 1.12e-39:
		tmp = math.sqrt(2.0) * (t_2 * (t_m / l_m))
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	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(x * 0.5))
	t_3 = Float64(Float64(t_m * t_2) / Float64(l_m / sqrt(2.0)))
	tmp = 0.0
	if (t_m <= 1.85e-211)
		tmp = t_3;
	elseif (t_m <= 1.55e-176)
		tmp = 1.0;
	elseif (t_m <= 3.1e-135)
		tmp = t_3;
	elseif (t_m <= 2.8e-61)
		tmp = Float64(1.0 + Float64(-1.0 / x));
	elseif (t_m <= 1.12e-39)
		tmp = Float64(sqrt(2.0) * Float64(t_2 * Float64(t_m / l_m)));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	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((x * 0.5));
	t_3 = (t_m * t_2) / (l_m / sqrt(2.0));
	tmp = 0.0;
	if (t_m <= 1.85e-211)
		tmp = t_3;
	elseif (t_m <= 1.55e-176)
		tmp = 1.0;
	elseif (t_m <= 3.1e-135)
		tmp = t_3;
	elseif (t_m <= 2.8e-61)
		tmp = 1.0 + (-1.0 / x);
	elseif (t_m <= 1.12e-39)
		tmp = sqrt(2.0) * (t_2 * (t_m / l_m));
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	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[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$m * t$95$2), $MachinePrecision] / N[(l$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.85e-211], t$95$3, If[LessEqual[t$95$m, 1.55e-176], 1.0, If[LessEqual[t$95$m, 3.1e-135], t$95$3, If[LessEqual[t$95$m, 2.8e-61], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.12e-39], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$2 * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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{x \cdot 0.5}\\
t_3 := \frac{t_m \cdot t_2}{\frac{l_m}{\sqrt{2}}}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 1.85 \cdot 10^{-211}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_m \leq 1.55 \cdot 10^{-176}:\\
\;\;\;\;1\\

\mathbf{elif}\;t_m \leq 3.1 \cdot 10^{-135}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_m \leq 2.8 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{-1}{x}\\

\mathbf{elif}\;t_m \leq 1.12 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{2} \cdot \left(t_2 \cdot \frac{t_m}{l_m}\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < 1.8499999999999999e-211 or 1.54999999999999996e-176 < t < 3.1000000000000001e-135

    1. Initial program 33.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8499999999999999e-211 < t < 1.54999999999999996e-176

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

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

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

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

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

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

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

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

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

    if 3.1000000000000001e-135 < t < 2.8000000000000001e-61

    1. Initial program 37.8%

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

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

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

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

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

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

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

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

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

    if 2.8000000000000001e-61 < t < 1.12e-39

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{x \cdot 0.5}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
    9. Simplified75.4%

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{t}{\frac{\ell}{\sqrt{2}}}} \]
      2. *-un-lft-identity75.4%

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{1 \cdot t}}{\frac{\ell}{\sqrt{2}}} \]
      3. div-inv74.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{x \cdot 0.5} \cdot \frac{\color{blue}{\frac{1 \cdot t}{\ell}}}{{2}^{-0.5}} \]
      3. *-lft-identity74.6%

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

      \[\leadsto \sqrt{x \cdot 0.5} \cdot \color{blue}{\frac{\frac{t}{\ell}}{{2}^{-0.5}}} \]
    14. Step-by-step derivation
      1. expm1-log1p-u74.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{x \cdot 0.5} \cdot \left(\frac{t}{\ell} \cdot \sqrt{2}\right)} \]
      3. associate-*r*75.8%

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

        \[\leadsto \color{blue}{\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)} \]
    17. Simplified75.8%

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

    if 1.12e-39 < t

    1. Initial program 42.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.85 \cdot 10^{-211}:\\ \;\;\;\;\frac{t \cdot \sqrt{x \cdot 0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-176}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-135}:\\ \;\;\;\;\frac{t \cdot \sqrt{x \cdot 0.5}}{\frac{\ell}{\sqrt{2}}}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-61}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-39}:\\ \;\;\;\;\sqrt{2} \cdot \left(\sqrt{x \cdot 0.5} \cdot \frac{t}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 77.0% accurate, 2.1× 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 \sqrt{\frac{x + -1}{x + 1}} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (* t_s (sqrt (/ (+ x -1.0) (+ x 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 * sqrt(((x + -1.0) / (x + 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 * sqrt(((x + (-1.0d0)) / (x + 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 * Math.sqrt(((x + -1.0) / (x + 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 * math.sqrt(((x + -1.0) / (x + 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 * sqrt(Float64(Float64(x + -1.0) / Float64(x + 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 * sqrt(((x + -1.0) / (x + 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 * N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $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)

\\
t_s \cdot \sqrt{\frac{x + -1}{x + 1}}
\end{array}
Derivation
  1. Initial program 35.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. Simplified35.5%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
  8. Final simplification36.0%

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

Alternative 9: 76.4% 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 1 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 35.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. Simplified35.5%

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

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

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

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

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

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

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

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

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

Alternative 10: 75.7% 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 1 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 35.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. Simplified35.5%

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

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

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

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

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

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

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

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

    \[\leadsto 1 \]
  9. Add Preprocessing

Reproduce

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