Toniolo and Linder, Equation (7)

Percentage Accurate: 32.9% → 84.9%
Time: 20.0s
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: 32.9% 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: 84.9% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9.5 \cdot 10^{-164}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t\_m \leq 1.15 \cdot 10^{+33}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{-1 + x}, {\ell}^{2} \cdot \left(\frac{1}{-1 + x} + \frac{1 + \frac{1 + \left(\frac{1}{x} + \frac{1}{{x}^{2}}\right)}{x}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 9.5e-164)
    (*
     (sqrt 2.0)
     (/
      t_m
      (+
       (*
        0.5
        (/
         (+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l 2.0)))
         (* t_m (* (sqrt 2.0) x))))
       (* t_m (sqrt 2.0)))))
    (if (<= t_m 1.15e+33)
      (*
       (sqrt 2.0)
       (/
        t_m
        (sqrt
         (fma
          2.0
          (* (pow t_m 2.0) (/ (+ x 1.0) (+ -1.0 x)))
          (*
           (pow l 2.0)
           (+
            (/ 1.0 (+ -1.0 x))
            (/ (+ 1.0 (/ (+ 1.0 (+ (/ 1.0 x) (/ 1.0 (pow x 2.0)))) x)) x)))))))
      (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 9.5e-164) {
		tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l, 2.0))) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 1.15e+33) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (-1.0 + x))), (pow(l, 2.0) * ((1.0 / (-1.0 + x)) + ((1.0 + ((1.0 + ((1.0 / x) + (1.0 / pow(x, 2.0)))) / x)) / x))))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (t_m <= 9.5e-164)
		tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 1.15e+33)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(-1.0 + x))), Float64((l ^ 2.0) * Float64(Float64(1.0 / Float64(-1.0 + x)) + Float64(Float64(1.0 + Float64(Float64(1.0 + Float64(Float64(1.0 / x) + Float64(1.0 / (x ^ 2.0)))) / x)) / x)))))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 9.5e-164], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.15e+33], 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[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(1.0 + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.5 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\

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

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


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

    1. Initial program 26.6%

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

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

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

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

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

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

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

        \[\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-neg43.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}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      9. metadata-eval43.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}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      10. +-commutative43.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}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      11. sub-neg43.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} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)\right)\right)}} \]
      12. metadata-eval43.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} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)\right)}} \]
      13. +-commutative43.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} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)\right)\right)}} \]
    6. Simplified43.9%

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

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

    if 9.5000000000000001e-164 < t < 1.15000000000000005e33

    1. Initial program 56.9%

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

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

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

        \[\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. sub-neg60.3%

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

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

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

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

        \[\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+73.3%

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

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

        \[\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. +-commutative73.3%

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

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

        \[\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. +-commutative73.3%

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

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

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

    if 1.15000000000000005e33 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 2: 84.8% accurate, 0.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 6.8 \cdot 10^{-164}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t\_m \leq 5.5 \cdot 10^{+32}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{-1 + x}, {\ell}^{2} \cdot \frac{2 + \frac{2 + \left(2 \cdot \frac{1}{x} + \frac{2}{{x}^{2}}\right)}{x}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 6.8e-164)
    (*
     (sqrt 2.0)
     (/
      t_m
      (+
       (*
        0.5
        (/
         (+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l 2.0)))
         (* t_m (* (sqrt 2.0) x))))
       (* t_m (sqrt 2.0)))))
    (if (<= t_m 5.5e+32)
      (*
       (sqrt 2.0)
       (/
        t_m
        (sqrt
         (fma
          2.0
          (* (pow t_m 2.0) (/ (+ x 1.0) (+ -1.0 x)))
          (*
           (pow l 2.0)
           (/
            (+ 2.0 (/ (+ 2.0 (+ (* 2.0 (/ 1.0 x)) (/ 2.0 (pow x 2.0)))) x))
            x))))))
      (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 6.8e-164) {
		tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l, 2.0))) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 5.5e+32) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (-1.0 + x))), (pow(l, 2.0) * ((2.0 + ((2.0 + ((2.0 * (1.0 / x)) + (2.0 / pow(x, 2.0)))) / x)) / x)))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (t_m <= 6.8e-164)
		tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 5.5e+32)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(-1.0 + x))), Float64((l ^ 2.0) * Float64(Float64(2.0 + Float64(Float64(2.0 + Float64(Float64(2.0 * Float64(1.0 / x)) + Float64(2.0 / (x ^ 2.0)))) / x)) / x))))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 6.8e-164], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.5e+32], 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[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(N[(2.0 + N[(N[(2.0 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.8 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\

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

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


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

    1. Initial program 26.6%

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

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

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

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

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

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

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

        \[\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-neg43.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}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      9. metadata-eval43.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}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      10. +-commutative43.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}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      11. sub-neg43.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} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)\right)\right)}} \]
      12. metadata-eval43.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} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)\right)}} \]
      13. +-commutative43.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} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)\right)\right)}} \]
    6. Simplified43.9%

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

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

    if 6.8e-164 < t < 5.49999999999999984e32

    1. Initial program 56.9%

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

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

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

        \[\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. sub-neg60.3%

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

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

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

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

        \[\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+73.3%

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

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

        \[\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. +-commutative73.3%

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

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

        \[\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. +-commutative73.3%

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

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

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

    if 5.49999999999999984e32 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 3: 84.9% accurate, 0.4× speedup?

\[\begin{array}{l} 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.02 \cdot 10^{-163}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\ \mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+32}:\\ \;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{x + 1}{-1 + x}, {\ell}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.02e-163)
    (*
     (sqrt 2.0)
     (/
      t_m
      (+
       (*
        0.5
        (/
         (+ (* 2.0 (+ (pow t_m 2.0) (pow t_m 2.0))) (* 2.0 (pow l 2.0)))
         (* t_m (* (sqrt 2.0) x))))
       (* t_m (sqrt 2.0)))))
    (if (<= t_m 2.7e+32)
      (*
       t_m
       (/
        (sqrt 2.0)
        (sqrt
         (fma
          2.0
          (* (pow t_m 2.0) (/ (+ x 1.0) (+ -1.0 x)))
          (* (pow l 2.0) (/ (+ 2.0 (/ 2.0 x)) x))))))
      (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double tmp;
	if (t_m <= 1.02e-163) {
		tmp = sqrt(2.0) * (t_m / ((0.5 * (((2.0 * (pow(t_m, 2.0) + pow(t_m, 2.0))) + (2.0 * pow(l, 2.0))) / (t_m * (sqrt(2.0) * x)))) + (t_m * sqrt(2.0))));
	} else if (t_m <= 2.7e+32) {
		tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) * ((x + 1.0) / (-1.0 + x))), (pow(l, 2.0) * ((2.0 + (2.0 / x)) / x)))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	tmp = 0.0
	if (t_m <= 1.02e-163)
		tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(0.5 * Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) + (t_m ^ 2.0))) + Float64(2.0 * (l ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x)))) + Float64(t_m * sqrt(2.0)))));
	elseif (t_m <= 2.7e+32)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(x + 1.0) / Float64(-1.0 + x))), Float64((l ^ 2.0) * Float64(Float64(2.0 + Float64(2.0 / x)) / x))))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.02e-163], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(0.5 * N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.7e+32], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
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.02 \cdot 10^{-163}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{0.5 \cdot \frac{2 \cdot \left({t\_m}^{2} + {t\_m}^{2}\right) + 2 \cdot {\ell}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)} + t\_m \cdot \sqrt{2}}\\

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

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


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

    1. Initial program 26.6%

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

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

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

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

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

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

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

        \[\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-neg43.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}{\color{blue}{x + \left(-1\right)}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      9. metadata-eval43.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}{x + \color{blue}{-1}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      10. +-commutative43.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}{\color{blue}{-1 + x}} + \left(\frac{x}{x - 1} - 1\right)\right)\right)}} \]
      11. sub-neg43.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} + \left(\frac{x}{\color{blue}{x + \left(-1\right)}} - 1\right)\right)\right)}} \]
      12. metadata-eval43.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} + \left(\frac{x}{x + \color{blue}{-1}} - 1\right)\right)\right)}} \]
      13. +-commutative43.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} + \left(\frac{x}{\color{blue}{-1 + x}} - 1\right)\right)\right)}} \]
    6. Simplified43.9%

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

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

    if 1.02000000000000007e-163 < t < 2.70000000000000013e32

    1. Initial program 56.9%

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

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

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

        \[\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. sub-neg60.3%

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

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

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

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

        \[\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+73.3%

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

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

        \[\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. +-commutative73.3%

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

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

        \[\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. +-commutative73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000013e32 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 4: 81.6% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{x + 1}{-1 + x}\\ t_3 := t\_m \cdot \sqrt{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 10^{-163}:\\ \;\;\;\;\frac{t\_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t\_3\right) \cdot \sqrt{t\_2}, \ell\right)}\\ \mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{+32}:\\ \;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot t\_2, {\ell}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (let* ((t_2 (/ (+ x 1.0) (+ -1.0 x))) (t_3 (* t_m (sqrt 2.0))))
   (*
    t_s
    (if (<= t_m 1e-163)
      (/ t_3 (hypot (* (hypot l t_3) (sqrt t_2)) l))
      (if (<= t_m 1.8e+32)
        (*
         t_m
         (/
          (sqrt 2.0)
          (sqrt
           (fma
            2.0
            (* (pow t_m 2.0) t_2)
            (* (pow l 2.0) (/ (+ 2.0 (/ 2.0 x)) x))))))
        (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double t_2 = (x + 1.0) / (-1.0 + x);
	double t_3 = t_m * sqrt(2.0);
	double tmp;
	if (t_m <= 1e-163) {
		tmp = t_3 / hypot((hypot(l, t_3) * sqrt(t_2)), l);
	} else if (t_m <= 1.8e+32) {
		tmp = t_m * (sqrt(2.0) / sqrt(fma(2.0, (pow(t_m, 2.0) * t_2), (pow(l, 2.0) * ((2.0 + (2.0 / x)) / x)))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	t_2 = Float64(Float64(x + 1.0) / Float64(-1.0 + x))
	t_3 = Float64(t_m * sqrt(2.0))
	tmp = 0.0
	if (t_m <= 1e-163)
		tmp = Float64(t_3 / hypot(Float64(hypot(l, t_3) * sqrt(t_2)), l));
	elseif (t_m <= 1.8e+32)
		tmp = Float64(t_m * Float64(sqrt(2.0) / sqrt(fma(2.0, Float64((t_m ^ 2.0) * t_2), Float64((l ^ 2.0) * Float64(Float64(2.0 + Float64(2.0 / x)) / x))))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1e-163], N[(t$95$3 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.8e+32], N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{x + 1}{-1 + x}\\
t_3 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 10^{-163}:\\
\;\;\;\;\frac{t\_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t\_3\right) \cdot \sqrt{t\_2}, \ell\right)}\\

\mathbf{elif}\;t\_m \leq 1.8 \cdot 10^{+32}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot t\_2, {\ell}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\

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


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

    1. Initial program 26.6%

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x + -1}, \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Applied egg-rr67.6%

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

    if 9.99999999999999923e-164 < t < 1.7999999999999998e32

    1. Initial program 56.9%

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

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

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

        \[\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. sub-neg60.3%

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

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

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

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

        \[\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+73.3%

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

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

        \[\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. +-commutative73.3%

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

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

        \[\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. +-commutative73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7999999999999998e32 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 5: 81.5% accurate, 0.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{x + 1}{-1 + x}\\ t_3 := t\_m \cdot \sqrt{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9.6 \cdot 10^{-164}:\\ \;\;\;\;\frac{t\_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t\_3\right) \cdot \sqrt{t\_2}, \ell\right)}\\ \mathbf{elif}\;t\_m \leq 8.8 \cdot 10^{+32}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, t\_2 \cdot \left(t\_m \cdot t\_m\right), {\ell}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (let* ((t_2 (/ (+ x 1.0) (+ -1.0 x))) (t_3 (* t_m (sqrt 2.0))))
   (*
    t_s
    (if (<= t_m 9.6e-164)
      (/ t_3 (hypot (* (hypot l t_3) (sqrt t_2)) l))
      (if (<= t_m 8.8e+32)
        (*
         (sqrt 2.0)
         (/
          t_m
          (sqrt
           (fma
            2.0
            (* t_2 (* t_m t_m))
            (* (pow l 2.0) (/ (+ 2.0 (/ 2.0 x)) x))))))
        (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double t_2 = (x + 1.0) / (-1.0 + x);
	double t_3 = t_m * sqrt(2.0);
	double tmp;
	if (t_m <= 9.6e-164) {
		tmp = t_3 / hypot((hypot(l, t_3) * sqrt(t_2)), l);
	} else if (t_m <= 8.8e+32) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (t_2 * (t_m * t_m)), (pow(l, 2.0) * ((2.0 + (2.0 / x)) / x)))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	t_2 = Float64(Float64(x + 1.0) / Float64(-1.0 + x))
	t_3 = Float64(t_m * sqrt(2.0))
	tmp = 0.0
	if (t_m <= 9.6e-164)
		tmp = Float64(t_3 / hypot(Float64(hypot(l, t_3) * sqrt(t_2)), l));
	elseif (t_m <= 8.8e+32)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64(t_2 * Float64(t_m * t_m)), Float64((l ^ 2.0) * Float64(Float64(2.0 + Float64(2.0 / x)) / x))))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 9.6e-164], N[(t$95$3 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 8.8e+32], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(t$95$2 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{x + 1}{-1 + x}\\
t_3 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.6 \cdot 10^{-164}:\\
\;\;\;\;\frac{t\_3}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t\_3\right) \cdot \sqrt{t\_2}, \ell\right)}\\

\mathbf{elif}\;t\_m \leq 8.8 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, t\_2 \cdot \left(t\_m \cdot t\_m\right), {\ell}^{2} \cdot \frac{2 + \frac{2}{x}}{x}\right)}}\\

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


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

    1. Initial program 26.6%

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

      \[\leadsto \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(x + 1, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x + -1}, \ell \cdot \left(-\ell\right)\right)}}} \]
    3. Add Preprocessing
    4. Applied egg-rr67.6%

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

    if 9.59999999999999932e-164 < t < 8.80000000000000004e32

    1. Initial program 56.9%

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

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

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

        \[\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. sub-neg60.3%

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

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

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

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

        \[\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+73.3%

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

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

        \[\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. +-commutative73.3%

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

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

        \[\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. +-commutative73.3%

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

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

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

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

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

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

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

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

    if 8.80000000000000004e32 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 6: 81.4% accurate, 0.5× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{2 + \frac{2}{x}}{x}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 3.9 \cdot 10^{-161}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\ell \cdot \sqrt{t\_2}}\\ \mathbf{elif}\;t\_m \leq 1.06 \cdot 10^{+32}:\\ \;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, \frac{x + 1}{-1 + x} \cdot \left(t\_m \cdot t\_m\right), {\ell}^{2} \cdot t\_2\right)}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (let* ((t_2 (/ (+ 2.0 (/ 2.0 x)) x)))
   (*
    t_s
    (if (<= t_m 3.9e-161)
      (* (sqrt 2.0) (/ t_m (* l (sqrt t_2))))
      (if (<= t_m 1.06e+32)
        (*
         (sqrt 2.0)
         (/
          t_m
          (sqrt
           (fma
            2.0
            (* (/ (+ x 1.0) (+ -1.0 x)) (* t_m t_m))
            (* (pow l 2.0) t_2)))))
        (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	double t_2 = (2.0 + (2.0 / x)) / x;
	double tmp;
	if (t_m <= 3.9e-161) {
		tmp = sqrt(2.0) * (t_m / (l * sqrt(t_2)));
	} else if (t_m <= 1.06e+32) {
		tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (((x + 1.0) / (-1.0 + x)) * (t_m * t_m)), (pow(l, 2.0) * t_2))));
	} else {
		tmp = 1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	t_2 = Float64(Float64(2.0 + Float64(2.0 / x)) / x)
	tmp = 0.0
	if (t_m <= 3.9e-161)
		tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l * sqrt(t_2))));
	elseif (t_m <= 1.06e+32)
		tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64(Float64(Float64(x + 1.0) / Float64(-1.0 + x)) * Float64(t_m * t_m)), Float64((l ^ 2.0) * t_2)))));
	else
		tmp = Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x));
	end
	return Float64(t_s * tmp)
end
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_, t$95$m_] := Block[{t$95$2 = N[(N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 3.9e-161], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.06e+32], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;t\_m \leq 1.06 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, \frac{x + 1}{-1 + x} \cdot \left(t\_m \cdot t\_m\right), {\ell}^{2} \cdot t\_2\right)}}\\

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


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

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

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

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

        \[\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. sub-neg26.4%

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(2, {t}^{2} \cdot \frac{\color{blue}{x + 1}}{x + -1}, {\ell}^{2} \cdot \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)}} \]
      6. +-commutative34.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+43.8%

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

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

        \[\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. +-commutative43.8%

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

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

        \[\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. +-commutative43.8%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2 + \frac{\color{blue}{2}}{x}}{x}}} \]
    12. Simplified21.0%

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

    if 3.89999999999999973e-161 < t < 1.0600000000000001e32

    1. Initial program 58.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. Simplified58.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 61.9%

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

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

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

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

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

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

        \[\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+74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0600000000000001e32 < t

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--50.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval50.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr50.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 97.3%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg97.3%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg97.3%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg97.3%

        \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
      4. unsub-neg97.3%

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval97.3%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified97.3%

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

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

Alternative 7: 78.7% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.1 \cdot 10^{+175}:\\
\;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\ell \cdot \sqrt{\frac{2 + \frac{2}{x}}{x}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.0999999999999999e175

    1. Initial program 35.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--20.8%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def20.8%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval20.8%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr20.8%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 41.2%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg41.2%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg41.2%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg41.2%

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

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/41.2%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval41.2%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified41.2%

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

    if 2.0999999999999999e175 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified0.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 0.7%

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

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

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

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

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

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

        \[\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+29.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2 + \frac{\color{blue}{2}}{x}}{x}}} \]
    12. Simplified55.1%

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

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

Alternative 8: 77.9% accurate, 1.1× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.9 \cdot 10^{+186}:\\
\;\;\;\;1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot x} \cdot \left(t\_m \cdot \frac{\sqrt{2}}{\ell}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.9e186

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
      4. flip--21.3%

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

        \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
      6. fmm-def21.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
      7. metadata-eval21.3%

        \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
    9. Applied egg-rr21.3%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
    10. Taylor expanded in x around -inf 41.2%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    11. Step-by-step derivation
      1. mul-1-neg41.2%

        \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
      2. unsub-neg41.2%

        \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
      3. mul-1-neg41.2%

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

        \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
      5. associate-*r/41.2%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
      6. metadata-eval41.2%

        \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
    12. Simplified41.2%

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

    if 2.9e186 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Simplified0.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 0.0%

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

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

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

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

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

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

        \[\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+36.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{2}}}}} \]
    11. Step-by-step derivation
      1. *-commutative52.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{2}}}} \cdot \frac{t \cdot \sqrt{2}}{\ell}} \]
      2. associate-*r/52.6%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\frac{2 \cdot 1}{x}} + 2 \cdot \frac{1}{{x}^{2}}}} \cdot \frac{t \cdot \sqrt{2}}{\ell} \]
      3. metadata-eval52.6%

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

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

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

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

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

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

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

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

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

Alternative 9: 77.0% accurate, 17.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(1 + \frac{-1 + \frac{0.5 - \frac{0.5}{x}}{x}}{x}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (* t_s (+ 1.0 (/ (+ -1.0 (/ (- 0.5 (/ 0.5 x)) x)) x))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + (((-1.0d0) + ((0.5d0 - (0.5d0 / x)) / x)) / x))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * (1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * Float64(1.0 + Float64(Float64(-1.0 + Float64(Float64(0.5 - Float64(0.5 / x)) / x)) / x)))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * (1.0 + ((-1.0 + ((0.5 - (0.5 / x)) / x)) / x));
end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(N[(-1.0 + N[(N[(0.5 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
    4. flip--22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{x \cdot x - -1 \cdot -1}{x + -1}}}} \]
    5. metadata-eval22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
    6. fmm-def22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
    7. metadata-eval22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
  9. Applied egg-rr22.5%

    \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
  10. Taylor expanded in x around -inf 39.7%

    \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
  11. Step-by-step derivation
    1. mul-1-neg39.7%

      \[\leadsto 1 + \color{blue}{\left(-\frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}\right)} \]
    2. unsub-neg39.7%

      \[\leadsto \color{blue}{1 - \frac{1 + -1 \cdot \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}{x}} \]
    3. mul-1-neg39.7%

      \[\leadsto 1 - \frac{1 + \color{blue}{\left(-\frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}\right)}}{x} \]
    4. unsub-neg39.7%

      \[\leadsto 1 - \frac{\color{blue}{1 - \frac{0.5 - 0.5 \cdot \frac{1}{x}}{x}}}{x} \]
    5. associate-*r/39.7%

      \[\leadsto 1 - \frac{1 - \frac{0.5 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{x}}{x} \]
    6. metadata-eval39.7%

      \[\leadsto 1 - \frac{1 - \frac{0.5 - \frac{\color{blue}{0.5}}{x}}{x}}{x} \]
  12. Simplified39.7%

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

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

Alternative 10: 76.9% accurate, 25.0× speedup?

\[\begin{array}{l} 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} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m)
 :precision binary64
 (* t_s (+ 1.0 (/ (- -1.0 (/ -0.5 x)) x))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + (((-1.0d0) - ((-0.5d0) / x)) / x))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * Float64(1.0 + Float64(Float64(-1.0 - Float64(-0.5 / x)) / x)))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * (1.0 + ((-1.0 - (-0.5 / x)) / x));
end
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_, 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}
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 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{x - -1}}} \]
    4. flip--22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{x \cdot x - -1 \cdot -1}{x + -1}}}} \]
    5. metadata-eval22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{x \cdot x - \color{blue}{1}}{x + -1}}} \]
    6. fmm-def22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}{x + -1}}} \]
    7. metadata-eval22.5%

      \[\leadsto \sqrt{\frac{x - 1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}{x + -1}}} \]
  9. Applied egg-rr22.5%

    \[\leadsto \sqrt{\frac{x - 1}{\color{blue}{\frac{\mathsf{fma}\left(x, x, -1\right)}{x + -1}}}} \]
  10. Taylor expanded in x around -inf 39.6%

    \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 - 0.5 \cdot \frac{1}{x}}{x}} \]
  11. Step-by-step derivation
    1. mul-1-neg39.6%

      \[\leadsto 1 + \color{blue}{\left(-\frac{1 - 0.5 \cdot \frac{1}{x}}{x}\right)} \]
    2. unsub-neg39.6%

      \[\leadsto \color{blue}{1 - \frac{1 - 0.5 \cdot \frac{1}{x}}{x}} \]
    3. sub-neg39.6%

      \[\leadsto 1 - \frac{\color{blue}{1 + \left(-0.5 \cdot \frac{1}{x}\right)}}{x} \]
    4. associate-*r/39.6%

      \[\leadsto 1 - \frac{1 + \left(-\color{blue}{\frac{0.5 \cdot 1}{x}}\right)}{x} \]
    5. metadata-eval39.6%

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

      \[\leadsto 1 - \frac{1 + \color{blue}{\frac{-0.5}{x}}}{x} \]
    7. metadata-eval39.6%

      \[\leadsto 1 - \frac{1 + \frac{\color{blue}{-0.5}}{x}}{x} \]
  12. Simplified39.6%

    \[\leadsto \color{blue}{1 - \frac{1 + \frac{-0.5}{x}}{x}} \]
  13. Final simplification39.6%

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

Alternative 11: 76.7% accurate, 45.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(1 + \frac{-1}{x}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l, t_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t_m
    code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l, double t_m) {
	return t_s * (1.0 + (-1.0 / x));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, x, l, t_m):
	return t_s * (1.0 + (-1.0 / x))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, x, l, t_m)
	return Float64(t_s * Float64(1.0 + Float64(-1.0 / x)))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, x, l, t_m)
	tmp = t_s * (1.0 + (-1.0 / x));
end
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_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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 31.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 76.0% accurate, 225.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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