Toniolo and Linder, Equation (7)

Percentage Accurate: 33.2% → 85.2%
Time: 19.4s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 33.2% 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.2% accurate, 0.2× 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 1.9 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\ \mathbf{elif}\;t\_m \leq 1.75 \cdot 10^{+49}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{t\_2 + \frac{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \frac{{l\_m}^{2}}{x}\right) + \left(\left(t\_3 + t\_3\right) + \frac{t\_3}{x}\right)}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) 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 1.9e-171)
      (/ (* (* t_m (sqrt (fma x 0.5 -0.5))) (sqrt 2.0)) l_m)
      (if (<= t_m 1.75e+49)
        (*
         (sqrt 2.0)
         (/
          t_m
          (sqrt
           (+
            t_2
            (/
             (+
              (+ (* 2.0 (/ (pow t_m 2.0) x)) (/ (pow l_m 2.0) x))
              (+ (+ t_3 t_3) (/ t_3 x)))
             x)))))
        (sqrt (/ (+ x -1.0) (+ x 1.0))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double t_2 = 2.0 * pow(t_m, 2.0);
	double t_3 = t_2 + pow(l_m, 2.0);
	double tmp;
	if (t_m <= 1.9e-171) {
		tmp = ((t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m;
	} else if (t_m <= 1.75e+49) {
		tmp = sqrt(2.0) * (t_m / sqrt((t_2 + ((((2.0 * (pow(t_m, 2.0) / x)) + (pow(l_m, 2.0) / x)) + ((t_3 + t_3) + (t_3 / x))) / x))));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.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 <= 1.9e-171)
		tmp = Float64(Float64(Float64(t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m);
	elseif (t_m <= 1.75e+49)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(t_2 + Float64(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64((l_m ^ 2.0) / x)) + Float64(Float64(t_3 + t_3) + Float64(t_3 / x))) / x)))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(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, 1.9e-171], N[(N[(N[(t$95$m * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 1.75e+49], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(t$95$2 + N[(N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 + t$95$3), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := 2 \cdot {t\_m}^{2}\\
t_3 := t\_2 + {l\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-171}:\\
\;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.90000000000000011e-171 < t < 1.74999999999999987e49

    1. Initial program 59.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. Simplified59.3%

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

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

    if 1.74999999999999987e49 < t

    1. Initial program 33.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. Simplified33.3%

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

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

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

Alternative 2: 85.3% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\ \mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{+48}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, {l\_m}^{2} \cdot \left(\frac{1}{x + -1} + \frac{1}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.9e-171)
    (/ (* (* t_m (sqrt (fma x 0.5 -0.5))) (sqrt 2.0)) l_m)
    (if (<= t_m 1.3e+48)
      (*
       (sqrt 2.0)
       (/
        t_m
        (sqrt
         (fma
          2.0
          (* (pow t_m 2.0) (/ (+ x 1.0) (+ x -1.0)))
          (* (pow l_m 2.0) (+ (/ 1.0 (+ x -1.0)) (/ 1.0 x)))))))
      (sqrt (/ (+ x -1.0) (+ x 1.0)))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.9e-171) {
		tmp = ((t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m;
	} else if (t_m <= 1.3e+48) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (x + -1.0))), (pow(l_m, 2.0) * ((1.0 / (x + -1.0)) + (1.0 / x))))));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 1.9e-171)
		tmp = Float64(Float64(Float64(t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m);
	elseif (t_m <= 1.3e+48)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(x + -1.0))), Float64((l_m ^ 2.0) * Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(1.0 / x)))))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.9e-171], N[(N[(N[(t$95$m * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 1.3e+48], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-171}:\\
\;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\

\mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{+48}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, {l\_m}^{2} \cdot \left(\frac{1}{x + -1} + \frac{1}{x}\right)\right)}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.90000000000000011e-171 < t < 1.29999999999999998e48

    1. Initial program 59.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. Simplified59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999998e48 < t

    1. Initial program 33.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. Simplified33.3%

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

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

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

Alternative 3: 85.3% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\ \mathbf{elif}\;t\_m \leq 8.5 \cdot 10^{+47}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, 2 \cdot \frac{{l\_m}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.9e-171)
    (/ (* (* t_m (sqrt (fma x 0.5 -0.5))) (sqrt 2.0)) l_m)
    (if (<= t_m 8.5e+47)
      (*
       (sqrt 2.0)
       (/
        t_m
        (sqrt
         (fma
          2.0
          (* (pow t_m 2.0) (/ (+ x 1.0) (+ x -1.0)))
          (* 2.0 (/ (pow l_m 2.0) x))))))
      (sqrt (/ (+ x -1.0) (+ x 1.0)))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.9e-171) {
		tmp = ((t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m;
	} else if (t_m <= 8.5e+47) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (x + -1.0))), (2.0 * (pow(l_m, 2.0) / x)))));
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 1.9e-171)
		tmp = Float64(Float64(Float64(t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m);
	elseif (t_m <= 8.5e+47)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(x + -1.0))), Float64(2.0 * Float64((l_m ^ 2.0) / x))))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.9e-171], N[(N[(N[(t$95$m * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], If[LessEqual[t$95$m, 8.5e+47], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-171}:\\
\;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\

\mathbf{elif}\;t\_m \leq 8.5 \cdot 10^{+47}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{x + -1}, 2 \cdot \frac{{l\_m}^{2}}{x}\right)}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.90000000000000011e-171 < t < 8.5000000000000008e47

    1. Initial program 59.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. Simplified59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000008e47 < t

    1. Initial program 33.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. Simplified33.3%

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

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

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

Alternative 4: 80.7% accurate, 0.7× 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 2.2 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{x + -1}\right)}^{-0.5}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.2e-171)
    (/ (* (* t_m (sqrt (fma x 0.5 -0.5))) (sqrt 2.0)) l_m)
    (pow (/ (+ x 1.0) (+ x -1.0)) -0.5))))
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 <= 2.2e-171) {
		tmp = ((t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m;
	} else {
		tmp = pow(((x + 1.0) / (x + -1.0)), -0.5);
	}
	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 <= 2.2e-171)
		tmp = Float64(Float64(Float64(t_m * sqrt(fma(x, 0.5, -0.5))) * sqrt(2.0)) / l_m);
	else
		tmp = Float64(Float64(x + 1.0) / Float64(x + -1.0)) ^ -0.5;
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.2e-171], N[(N[(N[(t$95$m * N[Sqrt[N[(x * 0.5 + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 2.2 \cdot 10^{-171}:\\
\;\;\;\;\frac{\left(t\_m \cdot \sqrt{\mathsf{fma}\left(x, 0.5, -0.5\right)}\right) \cdot \sqrt{2}}{l\_m}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{x + -1}\right)}^{-0.5}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2000000000000001e-171 < t

    1. Initial program 43.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. Simplified43.3%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    6. Step-by-step derivation
      1. clear-num88.3%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{1 + x}{x - 1}}}} \]
      2. sqrt-div88.3%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{1 + x}{x - 1}}}} \]
      3. metadata-eval88.3%

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

        \[\leadsto \frac{1}{\sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      5. sub-neg88.3%

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

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    7. Applied egg-rr88.3%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}} \]
    8. Step-by-step derivation
      1. frac-2neg88.3%

        \[\leadsto \color{blue}{\frac{-1}{-\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. metadata-eval88.3%

        \[\leadsto \frac{\color{blue}{-1}}{-\sqrt{\frac{x + 1}{x + -1}}} \]
      3. div-inv88.3%

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

        \[\leadsto -1 \cdot \frac{1}{-\sqrt{\frac{\color{blue}{1 + x}}{x + -1}}} \]
    9. Applied egg-rr88.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1}{-\sqrt{\frac{1 + x}{x + -1}}}} \]
    10. Step-by-step derivation
      1. mul-1-neg88.3%

        \[\leadsto \color{blue}{-\frac{1}{-\sqrt{\frac{1 + x}{x + -1}}}} \]
      2. distribute-frac-neg288.3%

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

        \[\leadsto -\left(-\color{blue}{{\left(\sqrt{\frac{1 + x}{x + -1}}\right)}^{-1}}\right) \]
      4. remove-double-neg88.3%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{1 + x}{x + -1}}\right)}^{-1}} \]
      5. rem-exp-log40.0%

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{e^{\log \left(1 + x\right)}}}{x + -1}}\right)}^{-1} \]
      6. log1p-undefine40.0%

        \[\leadsto {\left(\sqrt{\frac{e^{\color{blue}{\mathsf{log1p}\left(x\right)}}}{x + -1}}\right)}^{-1} \]
      7. rem-exp-log43.1%

        \[\leadsto {\left(\sqrt{\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{e^{\log \left(x + -1\right)}}}}\right)}^{-1} \]
      8. exp-diff43.1%

        \[\leadsto {\left(\sqrt{\color{blue}{e^{\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)}}}\right)}^{-1} \]
      9. unpow1/243.1%

        \[\leadsto {\color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)}\right)}^{0.5}\right)}}^{-1} \]
      10. exp-prod43.1%

        \[\leadsto {\color{blue}{\left(e^{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot 0.5}\right)}}^{-1} \]
      11. *-commutative43.1%

        \[\leadsto {\left(e^{\color{blue}{0.5 \cdot \left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right)}}\right)}^{-1} \]
      12. exp-prod43.1%

        \[\leadsto \color{blue}{e^{\left(0.5 \cdot \left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right)\right) \cdot -1}} \]
      13. *-commutative43.1%

        \[\leadsto e^{\color{blue}{\left(\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot 0.5\right)} \cdot -1} \]
      14. associate-*l*43.1%

        \[\leadsto e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot \left(0.5 \cdot -1\right)}} \]
      15. metadata-eval43.1%

        \[\leadsto e^{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot \color{blue}{-0.5}} \]
    11. Simplified88.3%

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

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

Alternative 5: 80.5% accurate, 2.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 5.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{x + 1}{x + -1}\right)}^{-0.5}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 5.8e-170)
    (/ (* t_m (sqrt x)) l_m)
    (pow (/ (+ x 1.0) (+ x -1.0)) -0.5))))
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 <= 5.8e-170) {
		tmp = (t_m * sqrt(x)) / l_m;
	} else {
		tmp = pow(((x + 1.0) / (x + -1.0)), -0.5);
	}
	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 <= 5.8d-170) then
        tmp = (t_m * sqrt(x)) / l_m
    else
        tmp = ((x + 1.0d0) / (x + (-1.0d0))) ** (-0.5d0)
    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 <= 5.8e-170) {
		tmp = (t_m * Math.sqrt(x)) / l_m;
	} else {
		tmp = Math.pow(((x + 1.0) / (x + -1.0)), -0.5);
	}
	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 <= 5.8e-170:
		tmp = (t_m * math.sqrt(x)) / l_m
	else:
		tmp = math.pow(((x + 1.0) / (x + -1.0)), -0.5)
	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 <= 5.8e-170)
		tmp = Float64(Float64(t_m * sqrt(x)) / l_m);
	else
		tmp = Float64(Float64(x + 1.0) / Float64(x + -1.0)) ^ -0.5;
	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 <= 5.8e-170)
		tmp = (t_m * sqrt(x)) / l_m;
	else
		tmp = ((x + 1.0) / (x + -1.0)) ^ -0.5;
	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, 5.8e-170], N[(N[(t$95$m * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], N[Power[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 5.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{x + 1}{x + -1}\right)}^{-0.5}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000001e-170 < t

    1. Initial program 43.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. Simplified43.3%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    6. Step-by-step derivation
      1. clear-num88.3%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{1 + x}{x - 1}}}} \]
      2. sqrt-div88.3%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{1 + x}{x - 1}}}} \]
      3. metadata-eval88.3%

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

        \[\leadsto \frac{1}{\sqrt{\frac{\color{blue}{x + 1}}{x - 1}}} \]
      5. sub-neg88.3%

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

        \[\leadsto \frac{1}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}} \]
    7. Applied egg-rr88.3%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{x + 1}{x + -1}}}} \]
    8. Step-by-step derivation
      1. frac-2neg88.3%

        \[\leadsto \color{blue}{\frac{-1}{-\sqrt{\frac{x + 1}{x + -1}}}} \]
      2. metadata-eval88.3%

        \[\leadsto \frac{\color{blue}{-1}}{-\sqrt{\frac{x + 1}{x + -1}}} \]
      3. div-inv88.3%

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

        \[\leadsto -1 \cdot \frac{1}{-\sqrt{\frac{\color{blue}{1 + x}}{x + -1}}} \]
    9. Applied egg-rr88.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1}{-\sqrt{\frac{1 + x}{x + -1}}}} \]
    10. Step-by-step derivation
      1. mul-1-neg88.3%

        \[\leadsto \color{blue}{-\frac{1}{-\sqrt{\frac{1 + x}{x + -1}}}} \]
      2. distribute-frac-neg288.3%

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

        \[\leadsto -\left(-\color{blue}{{\left(\sqrt{\frac{1 + x}{x + -1}}\right)}^{-1}}\right) \]
      4. remove-double-neg88.3%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{1 + x}{x + -1}}\right)}^{-1}} \]
      5. rem-exp-log40.0%

        \[\leadsto {\left(\sqrt{\frac{\color{blue}{e^{\log \left(1 + x\right)}}}{x + -1}}\right)}^{-1} \]
      6. log1p-undefine40.0%

        \[\leadsto {\left(\sqrt{\frac{e^{\color{blue}{\mathsf{log1p}\left(x\right)}}}{x + -1}}\right)}^{-1} \]
      7. rem-exp-log43.1%

        \[\leadsto {\left(\sqrt{\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{e^{\log \left(x + -1\right)}}}}\right)}^{-1} \]
      8. exp-diff43.1%

        \[\leadsto {\left(\sqrt{\color{blue}{e^{\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)}}}\right)}^{-1} \]
      9. unpow1/243.1%

        \[\leadsto {\color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)}\right)}^{0.5}\right)}}^{-1} \]
      10. exp-prod43.1%

        \[\leadsto {\color{blue}{\left(e^{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot 0.5}\right)}}^{-1} \]
      11. *-commutative43.1%

        \[\leadsto {\left(e^{\color{blue}{0.5 \cdot \left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right)}}\right)}^{-1} \]
      12. exp-prod43.1%

        \[\leadsto \color{blue}{e^{\left(0.5 \cdot \left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right)\right) \cdot -1}} \]
      13. *-commutative43.1%

        \[\leadsto e^{\color{blue}{\left(\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot 0.5\right)} \cdot -1} \]
      14. associate-*l*43.1%

        \[\leadsto e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot \left(0.5 \cdot -1\right)}} \]
      15. metadata-eval43.1%

        \[\leadsto e^{\left(\mathsf{log1p}\left(x\right) - \log \left(x + -1\right)\right) \cdot \color{blue}{-0.5}} \]
    11. Simplified88.3%

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

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

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.1 \cdot 10^{-170}:\\
\;\;\;\;\frac{t\_m \cdot \sqrt{x}}{l\_m}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.09999999999999966e-170 < t

    1. Initial program 43.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. Simplified43.3%

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999994e-167 < t

    1. Initial program 43.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. Simplified43.3%

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

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

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

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

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

Alternative 8: 80.1% accurate, 2.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.42 \cdot 10^{-170}:\\ \;\;\;\;t\_m \cdot \frac{\sqrt{x}}{l\_m}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 - \frac{-0.5}{x}}{x}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.42e-170)
    (* t_m (/ (sqrt x) l_m))
    (+ 1.0 (/ (- -1.0 (/ -0.5 x)) x)))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.42e-170) {
		tmp = t_m * (sqrt(x) / l_m);
	} else {
		tmp = 1.0 + ((-1.0 - (-0.5 / x)) / x);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l_m
    real(8), intent (in) :: t_m
    real(8) :: tmp
    if (t_m <= 1.42d-170) then
        tmp = t_m * (sqrt(x) / l_m)
    else
        tmp = 1.0d0 + (((-1.0d0) - ((-0.5d0) / x)) / x)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
	double tmp;
	if (t_m <= 1.42e-170) {
		tmp = t_m * (Math.sqrt(x) / l_m);
	} else {
		tmp = 1.0 + ((-1.0 - (-0.5 / x)) / x);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l_m, t_m):
	tmp = 0
	if t_m <= 1.42e-170:
		tmp = t_m * (math.sqrt(x) / l_m)
	else:
		tmp = 1.0 + ((-1.0 - (-0.5 / x)) / x)
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l_m, t_m)
	tmp = 0.0
	if (t_m <= 1.42e-170)
		tmp = Float64(t_m * Float64(sqrt(x) / l_m));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 - Float64(-0.5 / x)) / x));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, x, l_m, t_m)
	tmp = 0.0;
	if (t_m <= 1.42e-170)
		tmp = t_m * (sqrt(x) / l_m);
	else
		tmp = 1.0 + ((-1.0 - (-0.5 / x)) / x);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.42e-170], N[(t$95$m * N[(N[Sqrt[x], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 - N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.42 \cdot 10^{-170}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{x}}{l\_m}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\ell}{t \cdot 1}}} \cdot \sqrt{x} \]
      6. *-rgt-identity15.7%

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

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

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

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

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

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

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

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

    if 1.41999999999999999e-170 < t

    1. Initial program 43.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. Simplified43.3%

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

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

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

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

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

Alternative 9: 75.8% accurate, 25.0× speedup?

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

\\
t\_s \cdot \left(1 + \frac{-1 - \frac{-0.5}{x}}{x}\right)
\end{array}
Derivation
  1. Initial program 37.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. Simplified37.0%

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

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

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

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

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

Alternative 10: 75.6% accurate, 32.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 \left(-1 + \left(2 + \frac{-1}{x}\right)\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
 :precision binary64
 (* t_s (+ -1.0 (+ 2.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 + (2.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) + (2.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 + (2.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 + (2.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(2.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 + (2.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[(2.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(-1 + \left(2 + \frac{-1}{x}\right)\right)
\end{array}
Derivation
  1. Initial program 37.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. Simplified37.0%

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

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

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u38.5%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(1 - \frac{1}{x}\right)\right)} \]
  7. Applied egg-rr38.5%

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(1 - \frac{1}{x}\right)\right)} \]
  8. Step-by-step derivation
    1. expm1-undefine38.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(1 - \frac{1}{x}\right)} - 1} \]
    2. sub-neg38.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(1 - \frac{1}{x}\right)} + \left(-1\right)} \]
    3. log1p-undefine38.5%

      \[\leadsto e^{\color{blue}{\log \left(1 + \left(1 - \frac{1}{x}\right)\right)}} + \left(-1\right) \]
    4. rem-exp-log38.5%

      \[\leadsto \color{blue}{\left(1 + \left(1 - \frac{1}{x}\right)\right)} + \left(-1\right) \]
    5. sub-neg38.5%

      \[\leadsto \left(1 + \color{blue}{\left(1 + \left(-\frac{1}{x}\right)\right)}\right) + \left(-1\right) \]
    6. distribute-neg-frac38.5%

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

      \[\leadsto \left(1 + \left(1 + \frac{\color{blue}{-1}}{x}\right)\right) + \left(-1\right) \]
    8. associate-+r+38.5%

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

      \[\leadsto \left(\color{blue}{2} + \frac{-1}{x}\right) + \left(-1\right) \]
    10. metadata-eval38.5%

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

    \[\leadsto \color{blue}{\left(2 + \frac{-1}{x}\right) + -1} \]
  10. Final simplification38.5%

    \[\leadsto -1 + \left(2 + \frac{-1}{x}\right) \]
  11. Add Preprocessing

Alternative 11: 75.6% accurate, 45.0× speedup?

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

\\
t\_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
Derivation
  1. Initial program 37.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. Simplified37.0%

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

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

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

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

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

\\
t\_s \cdot 1
\end{array}
Derivation
  1. Initial program 37.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. Simplified37.0%

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

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

    \[\leadsto \color{blue}{1} \]
  6. Add Preprocessing

Reproduce

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