Toniolo and Linder, Equation (7)

Percentage Accurate: 32.8% → 85.0%
Time: 27.5s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 32.8% 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.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) \\ \begin{array}{l} t_2 := 2 \cdot {t_m}^{2}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 1.26 \cdot 10^{-197}:\\ \;\;\;\;\frac{\left(t_m \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{l_m}\\ \mathbf{elif}\;t_m \leq 5.5 \cdot 10^{-159} \lor \neg \left(t_m \leq 2 \cdot 10^{+47}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t_m}^{2}}{x} + \left(t_2 + \frac{{l_m}^{2}}{x}\right)\right) + \frac{t_2 + {l_m}^{2}}{x}}}\\ \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 (* 2.0 (pow t_m 2.0))))
   (*
    t_s
    (if (<= t_m 1.26e-197)
      (/ (* (* t_m (sqrt 2.0)) (sqrt (- (* 0.5 x) 0.5))) l_m)
      (if (or (<= t_m 5.5e-159) (not (<= t_m 2e+47)))
        (sqrt (/ (+ -1.0 x) (+ x 1.0)))
        (*
         t_m
         (/
          (sqrt 2.0)
          (sqrt
           (+
            (+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
            (/ (+ t_2 (pow l_m 2.0)) x))))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = 2.0 * pow(t_m, 2.0);
	double tmp;
	if (t_m <= 1.26e-197) {
		tmp = ((t_m * sqrt(2.0)) * sqrt(((0.5 * x) - 0.5))) / l_m;
	} else if ((t_m <= 5.5e-159) || !(t_m <= 2e+47)) {
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + ((t_2 + pow(l_m, 2.0)) / x))));
	}
	return t_s * tmp;
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: t_2
    real(8) :: tmp
    t_2 = 2.0d0 * (t_m ** 2.0d0)
    if (t_m <= 1.26d-197) then
        tmp = ((t_m * sqrt(2.0d0)) * sqrt(((0.5d0 * x) - 0.5d0))) / l_m
    else if ((t_m <= 5.5d-159) .or. (.not. (t_m <= 2d+47))) then
        tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
    else
        tmp = t_m * (sqrt(2.0d0) / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + ((t_2 + (l_m ** 2.0d0)) / x))))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = 2.0 * Math.pow(t_m, 2.0);
	double tmp;
	if (t_m <= 1.26e-197) {
		tmp = ((t_m * Math.sqrt(2.0)) * Math.sqrt(((0.5 * x) - 0.5))) / l_m;
	} else if ((t_m <= 5.5e-159) || !(t_m <= 2e+47)) {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (Math.sqrt(2.0) / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + ((t_2 + Math.pow(l_m, 2.0)) / x))));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	t_2 = 2.0 * math.pow(t_m, 2.0)
	tmp = 0
	if t_m <= 1.26e-197:
		tmp = ((t_m * math.sqrt(2.0)) * math.sqrt(((0.5 * x) - 0.5))) / l_m
	elif (t_m <= 5.5e-159) or not (t_m <= 2e+47):
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	else:
		tmp = t_m * (math.sqrt(2.0) / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + ((t_2 + math.pow(l_m, 2.0)) / x))))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	t_2 = Float64(2.0 * (t_m ^ 2.0))
	tmp = 0.0
	if (t_m <= 1.26e-197)
		tmp = Float64(Float64(Float64(t_m * sqrt(2.0)) * sqrt(Float64(Float64(0.5 * x) - 0.5))) / l_m);
	elseif ((t_m <= 5.5e-159) || !(t_m <= 2e+47))
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(Float64(t_2 + (l_m ^ 2.0)) / x)))));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	t_2 = 2.0 * (t_m ^ 2.0);
	tmp = 0.0;
	if (t_m <= 1.26e-197)
		tmp = ((t_m * sqrt(2.0)) * sqrt(((0.5 * x) - 0.5))) / l_m;
	elseif ((t_m <= 5.5e-159) || ~((t_m <= 2e+47)))
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	else
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + ((t_2 + (l_m ^ 2.0)) / x))));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.26e-197], N[(N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[Or[LessEqual[t$95$m, 5.5e-159], N[Not[LessEqual[t$95$m, 2e+47]], $MachinePrecision]], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / 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)

\\
\begin{array}{l}
t_2 := 2 \cdot {t_m}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 1.26 \cdot 10^{-197}:\\
\;\;\;\;\frac{\left(t_m \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{l_m}\\

\mathbf{elif}\;t_m \leq 5.5 \cdot 10^{-159} \lor \neg \left(t_m \leq 2 \cdot 10^{+47}\right):\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right) \cdot 2} \cdot t}{\ell}} \]
    10. Taylor expanded in t around 0 14.7%

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

    if 1.26000000000000003e-197 < t < 5.5000000000000003e-159 or 2.0000000000000001e47 < t

    1. Initial program 21.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. Simplified21.4%

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

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

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

    if 5.5000000000000003e-159 < t < 2.0000000000000001e47

    1. Initial program 53.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. Simplified53.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 x around inf 86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.26 \cdot 10^{-197}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{\ell}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-159} \lor \neg \left(t \leq 2 \cdot 10^{+47}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot {t}^{2} + \frac{{\ell}^{2}}{x}\right)\right) + \frac{2 \cdot {t}^{2} + {\ell}^{2}}{x}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 85.5% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := 2 \cdot {t_m}^{2}\\ t_3 := t_2 + {l_m}^{2}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 7 \cdot 10^{-159}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{t_3 + t_3}{t_m \cdot \left(\sqrt{2} \cdot x\right)} + t_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t_m \leq 9.2 \cdot 10^{+42}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t_m}^{2}}{x} + \left(t_2 + \frac{{l_m}^{2}}{x}\right)\right) + \frac{t_3}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{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 (* 2.0 (pow t_m 2.0))) (t_3 (+ t_2 (pow l_m 2.0))))
   (*
    t_s
    (if (<= t_m 7e-159)
      (*
       t_m
       (/
        (sqrt 2.0)
        (+
         (* 0.5 (/ (+ t_3 t_3) (* t_m (* (sqrt 2.0) x))))
         (* t_m (sqrt 2.0)))))
      (if (<= t_m 9.2e+42)
        (*
         t_m
         (/
          (sqrt 2.0)
          (sqrt
           (+
            (+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_2 (/ (pow l_m 2.0) x)))
            (/ t_3 x)))))
        (sqrt (/ (+ -1.0 x) (+ 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 = 2.0 * pow(t_m, 2.0);
	double t_3 = t_2 + pow(l_m, 2.0);
	double tmp;
	if (t_m <= 7e-159) {
		tmp = t_m * (sqrt(2.0) / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 9.2e+42) {
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * (pow(t_m, 2.0) / x)) + (t_2 + (pow(l_m, 2.0) / x))) + (t_3 / x))));
	} else {
		tmp = sqrt(((-1.0 + x) / (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 = 2.0d0 * (t_m ** 2.0d0)
    t_3 = t_2 + (l_m ** 2.0d0)
    if (t_m <= 7d-159) then
        tmp = t_m * (sqrt(2.0d0) / ((0.5d0 * ((t_3 + t_3) / (t_m * (sqrt(2.0d0) * x)))) + (t_m * sqrt(2.0d0))))
    else if (t_m <= 9.2d+42) then
        tmp = t_m * (sqrt(2.0d0) / sqrt((((2.0d0 * ((t_m ** 2.0d0) / x)) + (t_2 + ((l_m ** 2.0d0) / x))) + (t_3 / x))))
    else
        tmp = sqrt((((-1.0d0) + x) / (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 = 2.0 * Math.pow(t_m, 2.0);
	double t_3 = t_2 + Math.pow(l_m, 2.0);
	double tmp;
	if (t_m <= 7e-159) {
		tmp = t_m * (Math.sqrt(2.0) / ((0.5 * ((t_3 + t_3) / (t_m * (Math.sqrt(2.0) * x)))) + (t_m * Math.sqrt(2.0))));
	} else if (t_m <= 9.2e+42) {
		tmp = t_m * (Math.sqrt(2.0) / Math.sqrt((((2.0 * (Math.pow(t_m, 2.0) / x)) + (t_2 + (Math.pow(l_m, 2.0) / x))) + (t_3 / x))));
	} else {
		tmp = Math.sqrt(((-1.0 + x) / (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 = 2.0 * math.pow(t_m, 2.0)
	t_3 = t_2 + math.pow(l_m, 2.0)
	tmp = 0
	if t_m <= 7e-159:
		tmp = t_m * (math.sqrt(2.0) / ((0.5 * ((t_3 + t_3) / (t_m * (math.sqrt(2.0) * x)))) + (t_m * math.sqrt(2.0))))
	elif t_m <= 9.2e+42:
		tmp = t_m * (math.sqrt(2.0) / math.sqrt((((2.0 * (math.pow(t_m, 2.0) / x)) + (t_2 + (math.pow(l_m, 2.0) / x))) + (t_3 / x))))
	else:
		tmp = math.sqrt(((-1.0 + x) / (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(2.0 * (t_m ^ 2.0))
	t_3 = Float64(t_2 + (l_m ^ 2.0))
	tmp = 0.0
	if (t_m <= 7e-159)
		tmp = Float64(t_m * Float64(sqrt(2.0) / Float64(Float64(0.5 * Float64(Float64(t_3 + t_3) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 9.2e+42)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_2 + Float64((l_m ^ 2.0) / x))) + Float64(t_3 / x)))));
	else
		tmp = sqrt(Float64(Float64(-1.0 + x) / 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 = 2.0 * (t_m ^ 2.0);
	t_3 = t_2 + (l_m ^ 2.0);
	tmp = 0.0;
	if (t_m <= 7e-159)
		tmp = t_m * (sqrt(2.0) / ((0.5 * ((t_3 + t_3) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	elseif (t_m <= 9.2e+42)
		tmp = t_m * (sqrt(2.0) / sqrt((((2.0 * ((t_m ^ 2.0) / x)) + (t_2 + ((l_m ^ 2.0) / x))) + (t_3 / x))));
	else
		tmp = sqrt(((-1.0 + x) / (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[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 7e-159], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(0.5 * N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 9.2e+42], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $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 := 2 \cdot {t_m}^{2}\\
t_3 := t_2 + {l_m}^{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 7 \cdot 10^{-159}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{0.5 \cdot \frac{t_3 + t_3}{t_m \cdot \left(\sqrt{2} \cdot x\right)} + t_m \cdot \sqrt{2}}\\

\mathbf{elif}\;t_m \leq 9.2 \cdot 10^{+42}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{2}}{\sqrt{\left(2 \cdot \frac{{t_m}^{2}}{x} + \left(t_2 + \frac{{l_m}^{2}}{x}\right)\right) + \frac{t_3}{x}}}\\

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


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

    1. Initial program 30.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. Simplified30.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 x around inf 11.3%

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

    if 7.00000000000000005e-159 < t < 9.2e42

    1. Initial program 53.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. Simplified53.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 x around inf 86.4%

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

    if 9.2e42 < t

    1. Initial program 23.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. Simplified23.4%

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

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

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

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

Alternative 3: 79.8% 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) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 3.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{t_m \cdot \sqrt{-1 + x}}{l_m}\\ \mathbf{elif}\;t_m \leq 1.2 \cdot 10^{-113} \lor \neg \left(t_m \leq 4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t_m \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{l_m}\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 3.7e-205)
    (/ (* t_m (sqrt (+ -1.0 x))) l_m)
    (if (or (<= t_m 1.2e-113) (not (<= t_m 4e-97)))
      (sqrt (/ (+ -1.0 x) (+ x 1.0)))
      (* t_m (* (sqrt (* 0.5 x)) (/ (sqrt 2.0) l_m)))))))
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 <= 3.7e-205) {
		tmp = (t_m * sqrt((-1.0 + x))) / l_m;
	} else if ((t_m <= 1.2e-113) || !(t_m <= 4e-97)) {
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (sqrt((0.5 * x)) * (sqrt(2.0) / l_m));
	}
	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 <= 3.7d-205) then
        tmp = (t_m * sqrt(((-1.0d0) + x))) / l_m
    else if ((t_m <= 1.2d-113) .or. (.not. (t_m <= 4d-97))) then
        tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
    else
        tmp = t_m * (sqrt((0.5d0 * x)) * (sqrt(2.0d0) / l_m))
    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 <= 3.7e-205) {
		tmp = (t_m * Math.sqrt((-1.0 + x))) / l_m;
	} else if ((t_m <= 1.2e-113) || !(t_m <= 4e-97)) {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (Math.sqrt((0.5 * x)) * (Math.sqrt(2.0) / l_m));
	}
	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 <= 3.7e-205:
		tmp = (t_m * math.sqrt((-1.0 + x))) / l_m
	elif (t_m <= 1.2e-113) or not (t_m <= 4e-97):
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	else:
		tmp = t_m * (math.sqrt((0.5 * x)) * (math.sqrt(2.0) / l_m))
	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 (t_m <= 3.7e-205)
		tmp = Float64(Float64(t_m * sqrt(Float64(-1.0 + x))) / l_m);
	elseif ((t_m <= 1.2e-113) || !(t_m <= 4e-97))
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m * Float64(sqrt(Float64(0.5 * x)) * Float64(sqrt(2.0) / l_m)));
	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 <= 3.7e-205)
		tmp = (t_m * sqrt((-1.0 + x))) / l_m;
	elseif ((t_m <= 1.2e-113) || ~((t_m <= 4e-97)))
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	else
		tmp = t_m * (sqrt((0.5 * x)) * (sqrt(2.0) / l_m));
	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[t$95$m, 3.7e-205], N[(N[(t$95$m * N[Sqrt[N[(-1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[Or[LessEqual[t$95$m, 1.2e-113], N[Not[LessEqual[t$95$m, 4e-97]], $MachinePrecision]], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(0.5 * x), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $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}\;t_m \leq 3.7 \cdot 10^{-205}:\\
\;\;\;\;\frac{t_m \cdot \sqrt{-1 + x}}{l_m}\\

\mathbf{elif}\;t_m \leq 1.2 \cdot 10^{-113} \lor \neg \left(t_m \leq 4 \cdot 10^{-97}\right):\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;t_m \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{l_m}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right) \cdot 2} \cdot t}{\ell}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u10.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t \cdot \sqrt{x \cdot \color{blue}{1} + -0.5 \cdot 2}}{\ell} \]
      7. metadata-eval14.7%

        \[\leadsto \frac{t \cdot \sqrt{x \cdot 1 + \color{blue}{-1}}}{\ell} \]
      8. metadata-eval14.7%

        \[\leadsto \frac{t \cdot \sqrt{x \cdot 1 + \color{blue}{-1 \cdot 1}}}{\ell} \]
      9. distribute-rgt-in14.7%

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

        \[\leadsto \frac{t \cdot \sqrt{\color{blue}{x + -1}}}{\ell} \]
    13. Simplified14.7%

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

    if 3.7000000000000001e-205 < t < 1.20000000000000006e-113 or 4.00000000000000014e-97 < t

    1. Initial program 35.0%

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

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

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

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

    if 1.20000000000000006e-113 < t < 4.00000000000000014e-97

    1. Initial program 13.3%

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

      \[\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}{\left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \cdot t \]
    5. Step-by-step derivation
      1. *-commutative1.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3.7 \cdot 10^{-205}:\\ \;\;\;\;\frac{t \cdot \sqrt{-1 + x}}{\ell}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-113} \lor \neg \left(t \leq 4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.8% 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) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 1.7 \cdot 10^{-198}:\\ \;\;\;\;\frac{\left(t_m \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{l_m}\\ \mathbf{elif}\;t_m \leq 2.2 \cdot 10^{-113} \lor \neg \left(t_m \leq 2.4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t_m \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{l_m}\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 1.7e-198)
    (/ (* (* t_m (sqrt 2.0)) (sqrt (- (* 0.5 x) 0.5))) l_m)
    (if (or (<= t_m 2.2e-113) (not (<= t_m 2.4e-97)))
      (sqrt (/ (+ -1.0 x) (+ x 1.0)))
      (* t_m (* (sqrt (* 0.5 x)) (/ (sqrt 2.0) l_m)))))))
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 <= 1.7e-198) {
		tmp = ((t_m * sqrt(2.0)) * sqrt(((0.5 * x) - 0.5))) / l_m;
	} else if ((t_m <= 2.2e-113) || !(t_m <= 2.4e-97)) {
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (sqrt((0.5 * x)) * (sqrt(2.0) / l_m));
	}
	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 <= 1.7d-198) then
        tmp = ((t_m * sqrt(2.0d0)) * sqrt(((0.5d0 * x) - 0.5d0))) / l_m
    else if ((t_m <= 2.2d-113) .or. (.not. (t_m <= 2.4d-97))) then
        tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
    else
        tmp = t_m * (sqrt((0.5d0 * x)) * (sqrt(2.0d0) / l_m))
    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 <= 1.7e-198) {
		tmp = ((t_m * Math.sqrt(2.0)) * Math.sqrt(((0.5 * x) - 0.5))) / l_m;
	} else if ((t_m <= 2.2e-113) || !(t_m <= 2.4e-97)) {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (Math.sqrt((0.5 * x)) * (Math.sqrt(2.0) / l_m));
	}
	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 <= 1.7e-198:
		tmp = ((t_m * math.sqrt(2.0)) * math.sqrt(((0.5 * x) - 0.5))) / l_m
	elif (t_m <= 2.2e-113) or not (t_m <= 2.4e-97):
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	else:
		tmp = t_m * (math.sqrt((0.5 * x)) * (math.sqrt(2.0) / l_m))
	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 (t_m <= 1.7e-198)
		tmp = Float64(Float64(Float64(t_m * sqrt(2.0)) * sqrt(Float64(Float64(0.5 * x) - 0.5))) / l_m);
	elseif ((t_m <= 2.2e-113) || !(t_m <= 2.4e-97))
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m * Float64(sqrt(Float64(0.5 * x)) * Float64(sqrt(2.0) / l_m)));
	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 <= 1.7e-198)
		tmp = ((t_m * sqrt(2.0)) * sqrt(((0.5 * x) - 0.5))) / l_m;
	elseif ((t_m <= 2.2e-113) || ~((t_m <= 2.4e-97)))
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	else
		tmp = t_m * (sqrt((0.5 * x)) * (sqrt(2.0) / l_m));
	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[t$95$m, 1.7e-198], N[(N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(0.5 * x), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[Or[LessEqual[t$95$m, 2.2e-113], N[Not[LessEqual[t$95$m, 2.4e-97]], $MachinePrecision]], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(N[Sqrt[N[(0.5 * x), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $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}\;t_m \leq 1.7 \cdot 10^{-198}:\\
\;\;\;\;\frac{\left(t_m \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{l_m}\\

\mathbf{elif}\;t_m \leq 2.2 \cdot 10^{-113} \lor \neg \left(t_m \leq 2.4 \cdot 10^{-97}\right):\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;t_m \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{l_m}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right) \cdot 2} \cdot t}{\ell}} \]
    10. Taylor expanded in t around 0 14.7%

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

    if 1.6999999999999999e-198 < t < 2.20000000000000004e-113 or 2.4e-97 < t

    1. Initial program 35.0%

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

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

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

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

    if 2.20000000000000004e-113 < t < 2.4e-97

    1. Initial program 13.3%

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

      \[\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}{\left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \cdot t \]
    5. Step-by-step derivation
      1. *-commutative1.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.7 \cdot 10^{-198}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{0.5 \cdot x - 0.5}}{\ell}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-113} \lor \neg \left(t \leq 2.4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(\sqrt{0.5 \cdot x} \cdot \frac{\sqrt{2}}{\ell}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.8% accurate, 1.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 6.6 \cdot 10^{-199} \lor \neg \left(t_m \leq 2.2 \cdot 10^{-113}\right) \land t_m \leq 2.4 \cdot 10^{-97}:\\ \;\;\;\;t_m \cdot \frac{\sqrt{-1 + x}}{l_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \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 (or (<= t_m 6.6e-199) (and (not (<= t_m 2.2e-113)) (<= t_m 2.4e-97)))
    (* t_m (/ (sqrt (+ -1.0 x)) l_m))
    (sqrt (/ (+ -1.0 x) (+ 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 tmp;
	if ((t_m <= 6.6e-199) || (!(t_m <= 2.2e-113) && (t_m <= 2.4e-97))) {
		tmp = t_m * (sqrt((-1.0 + x)) / l_m);
	} else {
		tmp = sqrt(((-1.0 + x) / (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) :: tmp
    if ((t_m <= 6.6d-199) .or. (.not. (t_m <= 2.2d-113)) .and. (t_m <= 2.4d-97)) then
        tmp = t_m * (sqrt(((-1.0d0) + x)) / l_m)
    else
        tmp = sqrt((((-1.0d0) + x) / (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 tmp;
	if ((t_m <= 6.6e-199) || (!(t_m <= 2.2e-113) && (t_m <= 2.4e-97))) {
		tmp = t_m * (Math.sqrt((-1.0 + x)) / l_m);
	} else {
		tmp = Math.sqrt(((-1.0 + x) / (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):
	tmp = 0
	if (t_m <= 6.6e-199) or (not (t_m <= 2.2e-113) and (t_m <= 2.4e-97)):
		tmp = t_m * (math.sqrt((-1.0 + x)) / l_m)
	else:
		tmp = math.sqrt(((-1.0 + x) / (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)
	tmp = 0.0
	if ((t_m <= 6.6e-199) || (!(t_m <= 2.2e-113) && (t_m <= 2.4e-97)))
		tmp = Float64(t_m * Float64(sqrt(Float64(-1.0 + x)) / l_m));
	else
		tmp = sqrt(Float64(Float64(-1.0 + x) / 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)
	tmp = 0.0;
	if ((t_m <= 6.6e-199) || (~((t_m <= 2.2e-113)) && (t_m <= 2.4e-97)))
		tmp = t_m * (sqrt((-1.0 + x)) / l_m);
	else
		tmp = sqrt(((-1.0 + x) / (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_] := N[(t$95$s * If[Or[LessEqual[t$95$m, 6.6e-199], And[N[Not[LessEqual[t$95$m, 2.2e-113]], $MachinePrecision], LessEqual[t$95$m, 2.4e-97]]], N[(t$95$m * N[(N[Sqrt[N[(-1.0 + x), $MachinePrecision]], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(-1.0 + x), $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 \begin{array}{l}
\mathbf{if}\;t_m \leq 6.6 \cdot 10^{-199} \lor \neg \left(t_m \leq 2.2 \cdot 10^{-113}\right) \land t_m \leq 2.4 \cdot 10^{-97}:\\
\;\;\;\;t_m \cdot \frac{\sqrt{-1 + x}}{l_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.6000000000000005e-199 or 2.20000000000000004e-113 < t < 2.4e-97

    1. Initial program 30.6%

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

      \[\leadsto \color{blue}{\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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{0.5 \cdot x - 0.5} \cdot \sqrt{0.5 \cdot x - 0.5}\right) \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \frac{\sqrt{2}}{\ell}\right)}} \cdot t \]
      4. add-sqr-sqrt19.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{\sqrt{2 \cdot \mathsf{fma}\left(x, 0.5, -0.5\right)}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)} - 1\right) \cdot t \]
      8. add-sqr-sqrt10.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6000000000000005e-199 < t < 2.20000000000000004e-113 or 2.4e-97 < t

    1. Initial program 35.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.6 \cdot 10^{-199} \lor \neg \left(t \leq 2.2 \cdot 10^{-113}\right) \land t \leq 2.4 \cdot 10^{-97}:\\ \;\;\;\;t \cdot \frac{\sqrt{-1 + x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.9% accurate, 1.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt{-1 + x}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 8.8 \cdot 10^{-207}:\\ \;\;\;\;\frac{t_m \cdot t_2}{l_m}\\ \mathbf{elif}\;t_m \leq 4 \cdot 10^{-113} \lor \neg \left(t_m \leq 2.4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t_m \cdot \frac{t_2}{l_m}\\ \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 (+ -1.0 x))))
   (*
    t_s
    (if (<= t_m 8.8e-207)
      (/ (* t_m t_2) l_m)
      (if (or (<= t_m 4e-113) (not (<= t_m 2.4e-97)))
        (sqrt (/ (+ -1.0 x) (+ x 1.0)))
        (* t_m (/ t_2 l_m)))))))
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((-1.0 + x));
	double tmp;
	if (t_m <= 8.8e-207) {
		tmp = (t_m * t_2) / l_m;
	} else if ((t_m <= 4e-113) || !(t_m <= 2.4e-97)) {
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (t_2 / l_m);
	}
	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(((-1.0d0) + x))
    if (t_m <= 8.8d-207) then
        tmp = (t_m * t_2) / l_m
    else if ((t_m <= 4d-113) .or. (.not. (t_m <= 2.4d-97))) then
        tmp = sqrt((((-1.0d0) + x) / (x + 1.0d0)))
    else
        tmp = t_m * (t_2 / l_m)
    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((-1.0 + x));
	double tmp;
	if (t_m <= 8.8e-207) {
		tmp = (t_m * t_2) / l_m;
	} else if ((t_m <= 4e-113) || !(t_m <= 2.4e-97)) {
		tmp = Math.sqrt(((-1.0 + x) / (x + 1.0)));
	} else {
		tmp = t_m * (t_2 / l_m);
	}
	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((-1.0 + x))
	tmp = 0
	if t_m <= 8.8e-207:
		tmp = (t_m * t_2) / l_m
	elif (t_m <= 4e-113) or not (t_m <= 2.4e-97):
		tmp = math.sqrt(((-1.0 + x) / (x + 1.0)))
	else:
		tmp = t_m * (t_2 / l_m)
	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(-1.0 + x))
	tmp = 0.0
	if (t_m <= 8.8e-207)
		tmp = Float64(Float64(t_m * t_2) / l_m);
	elseif ((t_m <= 4e-113) || !(t_m <= 2.4e-97))
		tmp = sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)));
	else
		tmp = Float64(t_m * Float64(t_2 / l_m));
	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((-1.0 + x));
	tmp = 0.0;
	if (t_m <= 8.8e-207)
		tmp = (t_m * t_2) / l_m;
	elseif ((t_m <= 4e-113) || ~((t_m <= 2.4e-97)))
		tmp = sqrt(((-1.0 + x) / (x + 1.0)));
	else
		tmp = t_m * (t_2 / l_m);
	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[(-1.0 + x), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.8e-207], N[(N[(t$95$m * t$95$2), $MachinePrecision] / l$95$m), $MachinePrecision], If[Or[LessEqual[t$95$m, 4e-113], N[Not[LessEqual[t$95$m, 2.4e-97]], $MachinePrecision]], N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$m * N[(t$95$2 / l$95$m), $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{-1 + x}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 8.8 \cdot 10^{-207}:\\
\;\;\;\;\frac{t_m \cdot t_2}{l_m}\\

\mathbf{elif}\;t_m \leq 4 \cdot 10^{-113} \lor \neg \left(t_m \leq 2.4 \cdot 10^{-97}\right):\\
\;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\

\mathbf{else}:\\
\;\;\;\;t_m \cdot \frac{t_2}{l_m}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right) \cdot 2} \cdot t}{\ell}} \]
    10. Step-by-step derivation
      1. expm1-log1p-u10.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t \cdot \sqrt{x \cdot \color{blue}{1} + -0.5 \cdot 2}}{\ell} \]
      7. metadata-eval14.7%

        \[\leadsto \frac{t \cdot \sqrt{x \cdot 1 + \color{blue}{-1}}}{\ell} \]
      8. metadata-eval14.7%

        \[\leadsto \frac{t \cdot \sqrt{x \cdot 1 + \color{blue}{-1 \cdot 1}}}{\ell} \]
      9. distribute-rgt-in14.7%

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

        \[\leadsto \frac{t \cdot \sqrt{\color{blue}{x + -1}}}{\ell} \]
    13. Simplified14.7%

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

    if 8.7999999999999995e-207 < t < 3.99999999999999991e-113 or 2.4e-97 < t

    1. Initial program 35.0%

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

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

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

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

    if 3.99999999999999991e-113 < t < 2.4e-97

    1. Initial program 13.3%

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

      \[\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}{\left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)} \cdot t \]
    5. Step-by-step derivation
      1. *-commutative1.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\mathsf{fma}\left(x, 0.5, -0.5\right)} \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \frac{\sqrt{2}}{\ell}\right)} \cdot t \]
      7. metadata-eval46.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{x \cdot \color{blue}{1} + -0.5 \cdot 2}}{\ell} \cdot t \]
      7. metadata-eval31.0%

        \[\leadsto \frac{\sqrt{x \cdot 1 + \color{blue}{-1}}}{\ell} \cdot t \]
      8. metadata-eval31.0%

        \[\leadsto \frac{\sqrt{x \cdot 1 + \color{blue}{-1 \cdot 1}}}{\ell} \cdot t \]
      9. distribute-rgt-in31.0%

        \[\leadsto \frac{\sqrt{\color{blue}{1 \cdot \left(x + -1\right)}}}{\ell} \cdot t \]
      10. *-lft-identity31.0%

        \[\leadsto \frac{\sqrt{\color{blue}{x + -1}}}{\ell} \cdot t \]
    13. Simplified31.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.8 \cdot 10^{-207}:\\ \;\;\;\;\frac{t \cdot \sqrt{-1 + x}}{\ell}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-113} \lor \neg \left(t \leq 2.4 \cdot 10^{-97}\right):\\ \;\;\;\;\sqrt{\frac{-1 + x}{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{-1 + x}}{\ell}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.1% 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{-1 + x}{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 (/ (+ -1.0 x) (+ 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(((-1.0 + x) / (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((((-1.0d0) + x) / (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(((-1.0 + x) / (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(((-1.0 + x) / (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(-1.0 + x) / 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(((-1.0 + x) / (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[(-1.0 + x), $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{-1 + x}{x + 1}}
\end{array}
Derivation
  1. Initial program 32.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. Simplified32.4%

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

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

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

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

Alternative 8: 76.5% 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 32.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. Simplified32.4%

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

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

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  6. Final simplification40.5%

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

Alternative 9: 75.9% 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 32.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. Simplified32.4%

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

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

    \[\leadsto \color{blue}{1} \]
  6. Final simplification40.1%

    \[\leadsto 1 \]
  7. Add Preprocessing

Reproduce

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