Toniolo and Linder, Equation (7)

Percentage Accurate: 33.6% → 86.7%
Time: 27.1s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 33.6% accurate, 1.0× speedup?

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

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

Alternative 1: 86.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ t_2 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\ \mathbf{if}\;t \leq -4200000:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-227}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-159}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{t_2 + t_2}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1
         (*
          t
          (/
           (sqrt 2.0)
           (sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (/ l (/ x (* 2.0 l))))))))
        (t_2 (fma 2.0 (* t t) (* l l))))
   (if (<= t -4200000.0)
     (- (sqrt (/ (+ x -1.0) (+ x 1.0))))
     (if (<= t 2.55e-227)
       t_1
       (if (<= t 1.75e-159)
         (*
          t
          (/
           (sqrt 2.0)
           (fma 0.5 (/ (+ t_2 t_2) (* (sqrt 2.0) (* t x))) (* t (sqrt 2.0)))))
         (if (<= t 1.05e+107) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))
double code(double x, double l, double t) {
	double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
	double t_2 = fma(2.0, (t * t), (l * l));
	double tmp;
	if (t <= -4200000.0) {
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 2.55e-227) {
		tmp = t_1;
	} else if (t <= 1.75e-159) {
		tmp = t * (sqrt(2.0) / fma(0.5, ((t_2 + t_2) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
	} else if (t <= 1.05e+107) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
function code(x, l, t)
	t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l / Float64(x / Float64(2.0 * l)))))))
	t_2 = fma(2.0, Float64(t * t), Float64(l * l))
	tmp = 0.0
	if (t <= -4200000.0)
		tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))));
	elseif (t <= 2.55e-227)
		tmp = t_1;
	elseif (t <= 1.75e-159)
		tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(t_2 + t_2) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0)))));
	elseif (t <= 1.05e+107)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l / N[(x / N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4200000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 2.55e-227], t$95$1, If[LessEqual[t, 1.75e-159], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(t$95$2 + t$95$2), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+107], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\
t_2 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
\mathbf{if}\;t \leq -4200000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{elif}\;t \leq 2.55 \cdot 10^{-227}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.75 \cdot 10^{-159}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{t_2 + t_2}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+107}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.2e6

    1. Initial program 38.2%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg92.4%

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

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

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

    if -4.2e6 < t < 2.54999999999999996e-227 or 1.75000000000000001e-159 < t < 1.05e107

    1. Initial program 41.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. Step-by-step derivation
      1. associate-*l/41.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\left(2 \cdot \left(t \cdot t\right) + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}} \cdot t \]
      11. fma-udef80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.54999999999999996e-227 < t < 1.75000000000000001e-159

    1. Initial program 2.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. Step-by-step derivation
      1. associate-*l/2.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e107 < t

    1. Initial program 23.7%

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

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

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

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

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

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

        \[\leadsto 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right) \]
      4. unpow296.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4200000:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{-227}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-159}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right) + \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+107}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 2: 85.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ \mathbf{if}\;t \leq -4200000:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-224}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.18 \cdot 10^{-159}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1
         (*
          t
          (/
           (sqrt 2.0)
           (sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (/ l (/ x (* 2.0 l)))))))))
   (if (<= t -4200000.0)
     (- (sqrt (/ (+ x -1.0) (+ x 1.0))))
     (if (<= t 3.2e-224)
       t_1
       (if (<= t 2.18e-159)
         1.0
         (if (<= t 3e+97) t_1 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))))
double code(double x, double l, double t) {
	double t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
	double tmp;
	if (t <= -4200000.0) {
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 3.2e-224) {
		tmp = t_1;
	} else if (t <= 2.18e-159) {
		tmp = 1.0;
	} else if (t <= 3e+97) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (sqrt(2.0d0) / sqrt(((2.0d0 * (t * (t + (t / x)))) + (l / (x / (2.0d0 * l))))))
    if (t <= (-4200000.0d0)) then
        tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    else if (t <= 3.2d-224) then
        tmp = t_1
    else if (t <= 2.18d-159) then
        tmp = 1.0d0
    else if (t <= 3d+97) then
        tmp = t_1
    else
        tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = t * (Math.sqrt(2.0) / Math.sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
	double tmp;
	if (t <= -4200000.0) {
		tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
	} else if (t <= 3.2e-224) {
		tmp = t_1;
	} else if (t <= 2.18e-159) {
		tmp = 1.0;
	} else if (t <= 3e+97) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
def code(x, l, t):
	t_1 = t * (math.sqrt(2.0) / math.sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))))
	tmp = 0
	if t <= -4200000.0:
		tmp = -math.sqrt(((x + -1.0) / (x + 1.0)))
	elif t <= 3.2e-224:
		tmp = t_1
	elif t <= 2.18e-159:
		tmp = 1.0
	elif t <= 3e+97:
		tmp = t_1
	else:
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x))
	return tmp
function code(x, l, t)
	t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l / Float64(x / Float64(2.0 * l)))))))
	tmp = 0.0
	if (t <= -4200000.0)
		tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))));
	elseif (t <= 3.2e-224)
		tmp = t_1;
	elseif (t <= 2.18e-159)
		tmp = 1.0;
	elseif (t <= 3e+97)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = t * (sqrt(2.0) / sqrt(((2.0 * (t * (t + (t / x)))) + (l / (x / (2.0 * l))))));
	tmp = 0.0;
	if (t <= -4200000.0)
		tmp = -sqrt(((x + -1.0) / (x + 1.0)));
	elseif (t <= 3.2e-224)
		tmp = t_1;
	elseif (t <= 2.18e-159)
		tmp = 1.0;
	elseif (t <= 3e+97)
		tmp = t_1;
	else
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l / N[(x / N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4200000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 3.2e-224], t$95$1, If[LessEqual[t, 2.18e-159], 1.0, If[LessEqual[t, 3e+97], t$95$1, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\
\mathbf{if}\;t \leq -4200000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-224}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.18 \cdot 10^{-159}:\\
\;\;\;\;1\\

\mathbf{elif}\;t \leq 3 \cdot 10^{+97}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.2e6

    1. Initial program 38.2%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg92.4%

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

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

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

    if -4.2e6 < t < 3.1999999999999999e-224 or 2.18e-159 < t < 2.9999999999999998e97

    1. Initial program 41.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. Step-by-step derivation
      1. associate-*l/41.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\left(2 \cdot \left(t \cdot t\right) + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}} \cdot t \]
      11. fma-udef80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e-224 < t < 2.18e-159

    1. Initial program 2.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. Applied egg-rr55.7%

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

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

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

    if 2.9999999999999998e97 < t

    1. Initial program 23.7%

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

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

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

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

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

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

        \[\leadsto 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right) \]
      4. unpow296.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4200000:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-224}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ \mathbf{elif}\;t \leq 2.18 \cdot 10^{-159}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+97}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell}{\frac{x}{2 \cdot \ell}}}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 3: 78.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{-152}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-226}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -4.2e-152)
     (- t_1)
     (if (<= t 7e-226)
       (* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 (* x x)) (/ 2.0 x))))))
       t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4.2e-152) {
		tmp = -t_1;
	} else if (t <= 7e-226) {
		tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / (x * x)) + (2.0 / x)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-4.2d-152)) then
        tmp = -t_1
    else if (t <= 7d-226) then
        tmp = t * (sqrt(2.0d0) / (l * sqrt(((2.0d0 / (x * x)) + (2.0d0 / x)))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -4.2e-152) {
		tmp = -t_1;
	} else if (t <= 7e-226) {
		tmp = t * (Math.sqrt(2.0) / (l * Math.sqrt(((2.0 / (x * x)) + (2.0 / x)))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -4.2e-152:
		tmp = -t_1
	elif t <= 7e-226:
		tmp = t * (math.sqrt(2.0) / (l * math.sqrt(((2.0 / (x * x)) + (2.0 / x)))))
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -4.2e-152)
		tmp = Float64(-t_1);
	elseif (t <= 7e-226)
		tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x))))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -4.2e-152)
		tmp = -t_1;
	elseif (t <= 7e-226)
		tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / (x * x)) + (2.0 / x)))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.2e-152], (-t$95$1), If[LessEqual[t, 7e-226], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[Sqrt[N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{-152}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 7 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 44.1%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg86.4%

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

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

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

    if -4.19999999999999998e-152 < t < 7e-226

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{\color{blue}{2}}{{x}^{2}} + 2 \cdot \frac{1}{x}}} \cdot t \]
      4. unpow242.3%

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

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

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

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

    if 7e-226 < t

    1. Initial program 35.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{-152}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-226}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 4: 77.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{-150}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-224}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -2.35e-150)
   (+ -1.0 (/ 1.0 x))
   (if (<= t 3.7e-224) (/ (* t (sqrt x)) l) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -2.35e-150) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 3.7e-224) {
		tmp = (t * sqrt(x)) / l;
	} else {
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-2.35d-150)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 3.7d-224) then
        tmp = (t * sqrt(x)) / l
    else
        tmp = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -2.35e-150) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 3.7e-224) {
		tmp = (t * Math.sqrt(x)) / l;
	} else {
		tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -2.35e-150:
		tmp = -1.0 + (1.0 / x)
	elif t <= 3.7e-224:
		tmp = (t * math.sqrt(x)) / l
	else:
		tmp = math.sqrt(((x + -1.0) / (x + 1.0)))
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -2.35e-150)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 3.7e-224)
		tmp = Float64(Float64(t * sqrt(x)) / l);
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -2.35e-150)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 3.7e-224)
		tmp = (t * sqrt(x)) / l;
	else
		tmp = sqrt(((x + -1.0) / (x + 1.0)));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -2.35e-150], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-224], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-150}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 3.7 \cdot 10^{-224}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\

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


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

    1. Initial program 44.1%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt85.8%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    6. Simplified85.8%

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

    if -2.3499999999999999e-150 < t < 3.7000000000000002e-224

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2} - -1 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv67.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{{\ell}^{2}}}{x}}} \cdot t \]
      6. unpow267.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{\ell \cdot \ell}}{x}}} \cdot t \]
    9. Simplified67.6%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}} \cdot t \]
    10. Taylor expanded in l around 0 42.4%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x}}}{\ell} \cdot t \]
    12. Simplified42.4%

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

        \[\leadsto \color{blue}{\frac{\sqrt{x} \cdot t}{\ell}} \]
    14. Applied egg-rr42.5%

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

    if 3.7000000000000002e-224 < t

    1. Initial program 35.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{-150}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-224}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 5: 78.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{-151}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-225}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
   (if (<= t -3.1e-151)
     (- t_1)
     (if (<= t 6.4e-225) (/ (* t (sqrt x)) l) t_1))))
double code(double x, double l, double t) {
	double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.1e-151) {
		tmp = -t_1;
	} else if (t <= 6.4e-225) {
		tmp = (t * sqrt(x)) / l;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
    if (t <= (-3.1d-151)) then
        tmp = -t_1
    else if (t <= 6.4d-225) then
        tmp = (t * sqrt(x)) / l
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
	double tmp;
	if (t <= -3.1e-151) {
		tmp = -t_1;
	} else if (t <= 6.4e-225) {
		tmp = (t * Math.sqrt(x)) / l;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, l, t):
	t_1 = math.sqrt(((x + -1.0) / (x + 1.0)))
	tmp = 0
	if t <= -3.1e-151:
		tmp = -t_1
	elif t <= 6.4e-225:
		tmp = (t * math.sqrt(x)) / l
	else:
		tmp = t_1
	return tmp
function code(x, l, t)
	t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))
	tmp = 0.0
	if (t <= -3.1e-151)
		tmp = Float64(-t_1);
	elseif (t <= 6.4e-225)
		tmp = Float64(Float64(t * sqrt(x)) / l);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	t_1 = sqrt(((x + -1.0) / (x + 1.0)));
	tmp = 0.0;
	if (t <= -3.1e-151)
		tmp = -t_1;
	elseif (t <= 6.4e-225)
		tmp = (t * sqrt(x)) / l;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.1e-151], (-t$95$1), If[LessEqual[t, 6.4e-225], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-151}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;t \leq 6.4 \cdot 10^{-225}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 44.1%

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}} \]
      2. sub-neg86.4%

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

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

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

    if -3.09999999999999984e-151 < t < 6.3999999999999995e-225

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2} - -1 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv67.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{{\ell}^{2}}}{x}}} \cdot t \]
      6. unpow267.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{\ell \cdot \ell}}{x}}} \cdot t \]
    9. Simplified67.6%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}} \cdot t \]
    10. Taylor expanded in l around 0 42.4%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x}}}{\ell} \cdot t \]
    12. Simplified42.4%

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

        \[\leadsto \color{blue}{\frac{\sqrt{x} \cdot t}{\ell}} \]
    14. Applied egg-rr42.5%

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

    if 6.3999999999999995e-225 < t

    1. Initial program 35.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-151}:\\ \;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-225}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\ \end{array} \]

Alternative 6: 76.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{-150}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -2.2e-150)
   (+ -1.0 (/ 1.0 x))
   (if (<= t 7.2e-226)
     (* (sqrt x) (/ t l))
     (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -2.2e-150) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 7.2e-226) {
		tmp = sqrt(x) * (t / l);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-2.2d-150)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 7.2d-226) then
        tmp = sqrt(x) * (t / l)
    else
        tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -2.2e-150) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 7.2e-226) {
		tmp = Math.sqrt(x) * (t / l);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -2.2e-150:
		tmp = -1.0 + (1.0 / x)
	elif t <= 7.2e-226:
		tmp = math.sqrt(x) * (t / l)
	else:
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x))
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -2.2e-150)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 7.2e-226)
		tmp = Float64(sqrt(x) * Float64(t / l));
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -2.2e-150)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 7.2e-226)
		tmp = sqrt(x) * (t / l);
	else
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -2.2e-150], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-226], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-150}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{-226}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\

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


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

    1. Initial program 44.1%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt85.8%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    6. Simplified85.8%

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

    if -2.1999999999999999e-150 < t < 7.19999999999999988e-226

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2} - -1 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv67.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{{\ell}^{2}}}{x}}} \cdot t \]
      6. unpow267.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{\ell \cdot \ell}}{x}}} \cdot t \]
    9. Simplified67.6%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}} \cdot t \]
    10. Taylor expanded in l around 0 39.9%

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

    if 7.19999999999999988e-226 < t

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{-150}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 7: 77.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-153}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-225}:\\ \;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -1.35e-153)
   (+ -1.0 (/ 1.0 x))
   (if (<= t 5.8e-225)
     (* t (/ (sqrt x) l))
     (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.35e-153) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 5.8e-225) {
		tmp = t * (sqrt(x) / l);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.35d-153)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 5.8d-225) then
        tmp = t * (sqrt(x) / l)
    else
        tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -1.35e-153) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 5.8e-225) {
		tmp = t * (Math.sqrt(x) / l);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -1.35e-153:
		tmp = -1.0 + (1.0 / x)
	elif t <= 5.8e-225:
		tmp = t * (math.sqrt(x) / l)
	else:
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x))
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -1.35e-153)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 5.8e-225)
		tmp = Float64(t * Float64(sqrt(x) / l));
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -1.35e-153)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 5.8e-225)
		tmp = t * (sqrt(x) / l);
	else
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -1.35e-153], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-225], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-153}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-225}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\

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


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

    1. Initial program 44.1%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt85.8%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    6. Simplified85.8%

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

    if -1.35000000000000005e-153 < t < 5.7999999999999996e-225

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2} - -1 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv67.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{{\ell}^{2}}}{x}}} \cdot t \]
      6. unpow267.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{\ell \cdot \ell}}{x}}} \cdot t \]
    9. Simplified67.6%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}} \cdot t \]
    10. Taylor expanded in l around 0 42.4%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x}}}{\ell} \cdot t \]
    12. Simplified42.4%

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

    if 5.7999999999999996e-225 < t

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-153}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-225}:\\ \;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 8: 77.5% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8.8 \cdot 10^{-154}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-225}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t -8.8e-154)
   (+ -1.0 (/ 1.0 x))
   (if (<= t 3.3e-225)
     (/ (* t (sqrt x)) l)
     (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x))))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -8.8e-154) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 3.3e-225) {
		tmp = (t * sqrt(x)) / l;
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-8.8d-154)) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else if (t <= 3.3d-225) then
        tmp = (t * sqrt(x)) / l
    else
        tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -8.8e-154) {
		tmp = -1.0 + (1.0 / x);
	} else if (t <= 3.3e-225) {
		tmp = (t * Math.sqrt(x)) / l;
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -8.8e-154:
		tmp = -1.0 + (1.0 / x)
	elif t <= 3.3e-225:
		tmp = (t * math.sqrt(x)) / l
	else:
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x))
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -8.8e-154)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	elseif (t <= 3.3e-225)
		tmp = Float64(Float64(t * sqrt(x)) / l);
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -8.8e-154)
		tmp = -1.0 + (1.0 / x);
	elseif (t <= 3.3e-225)
		tmp = (t * sqrt(x)) / l;
	else
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -8.8e-154], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-225], N[(N[(t * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{-154}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{elif}\;t \leq 3.3 \cdot 10^{-225}:\\
\;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\

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


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

    1. Initial program 44.1%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt85.8%

        \[\leadsto \color{blue}{-1} + \frac{1}{x} \]
    6. Simplified85.8%

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

    if -8.80000000000000029e-154 < t < 3.3000000000000001e-225

    1. Initial program 3.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. Step-by-step derivation
      1. associate-*l/3.4%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{x + 1}}{\frac{x - 1}{{\ell}^{2}}} - {\ell}^{2}}} \cdot t \]
      3. sub-neg3.5%

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2} - -1 \cdot {\ell}^{2}}{x}}}} \cdot t \]
    8. Step-by-step derivation
      1. cancel-sign-sub-inv67.6%

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

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

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

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

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{{\ell}^{2}}}{x}}} \cdot t \]
      6. unpow267.6%

        \[\leadsto \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell + \color{blue}{\ell \cdot \ell}}{x}}} \cdot t \]
    9. Simplified67.6%

      \[\leadsto \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}} \cdot t \]
    10. Taylor expanded in l around 0 42.4%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x}}}{\ell} \cdot t \]
    12. Simplified42.4%

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

        \[\leadsto \color{blue}{\frac{\sqrt{x} \cdot t}{\ell}} \]
    14. Applied egg-rr42.5%

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

    if 3.3000000000000001e-225 < t

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.8 \cdot 10^{-154}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-225}:\\ \;\;\;\;\frac{t \cdot \sqrt{x}}{\ell}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 9: 76.6% accurate, 17.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t 1.4e-302)
   (+ -1.0 (/ 1.0 x))
   (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 1.4d-302) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else
        tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= 1.4e-302:
		tmp = -1.0 + (1.0 / x)
	else:
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x))
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= 1.4e-302)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	else
		tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= 1.4e-302)
		tmp = -1.0 + (1.0 / x);
	else
		tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\

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


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

    1. Initial program 36.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt76.5%

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

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

    if 1.4e-302 < t

    1. Initial program 32.7%

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

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

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

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

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

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

        \[\leadsto 1 + \left(\frac{\color{blue}{0.5}}{{x}^{2}} - \frac{1}{x}\right) \]
      4. unpow277.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]

Alternative 10: 76.2% accurate, 31.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t 1.4e-302) (+ -1.0 (/ 1.0 x)) 1.0))
double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 1.4d-302) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= 1.4e-302:
		tmp = -1.0 + (1.0 / x)
	else:
		tmp = 1.0
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= 1.4e-302)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= 1.4e-302)
		tmp = -1.0 + (1.0 / x);
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 36.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt76.5%

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

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

    if 1.4e-302 < t

    1. Initial program 32.7%

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 11: 76.5% accurate, 31.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \end{array} \]
(FPCore (x l t)
 :precision binary64
 (if (<= t 1.4e-302) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 1.4d-302) then
        tmp = (-1.0d0) + (1.0d0 / x)
    else
        tmp = 1.0d0 + ((-1.0d0) / x)
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-302) {
		tmp = -1.0 + (1.0 / x);
	} else {
		tmp = 1.0 + (-1.0 / x);
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= 1.4e-302:
		tmp = -1.0 + (1.0 / x)
	else:
		tmp = 1.0 + (-1.0 / x)
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= 1.4e-302)
		tmp = Float64(-1.0 + Float64(1.0 / x));
	else
		tmp = Float64(1.0 + Float64(-1.0 / x));
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= 1.4e-302)
		tmp = -1.0 + (1.0 / x);
	else
		tmp = 1.0 + (-1.0 / x);
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, 1.4e-302], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;-1 + \frac{1}{x}\\

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


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

    1. Initial program 36.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x} \]
      2. rem-square-sqrt76.5%

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

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

    if 1.4e-302 < t

    1. Initial program 32.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;-1 + \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]

Alternative 12: 76.0% accurate, 73.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-5d-310)) then
        tmp = -1.0d0
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double l, double t) {
	double tmp;
	if (t <= -5e-310) {
		tmp = -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, l, t):
	tmp = 0
	if t <= -5e-310:
		tmp = -1.0
	else:
		tmp = 1.0
	return tmp
function code(x, l, t)
	tmp = 0.0
	if (t <= -5e-310)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, l, t)
	tmp = 0.0;
	if (t <= -5e-310)
		tmp = -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\

\mathbf{else}:\\
\;\;\;\;1\\


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

    1. Initial program 36.5%

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
    5. Step-by-step derivation
      1. unpow20.0%

        \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
      2. rem-square-sqrt76.4%

        \[\leadsto \color{blue}{-1} \]
    6. Simplified76.4%

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

    if -4.999999999999985e-310 < t

    1. Initial program 32.4%

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 13: 39.2% accurate, 225.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x l t) :precision binary64 -1.0)
double code(double x, double l, double t) {
	return -1.0;
}
real(8) function code(x, l, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: l
    real(8), intent (in) :: t
    code = -1.0d0
end function
public static double code(double x, double l, double t) {
	return -1.0;
}
def code(x, l, t):
	return -1.0
function code(x, l, t)
	return -1.0
end
function tmp = code(x, l, t)
	tmp = -1.0;
end
code[x_, l_, t_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 34.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. Applied egg-rr68.9%

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

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

    \[\leadsto \color{blue}{{\left(\sqrt{-1}\right)}^{2}} \]
  5. Step-by-step derivation
    1. unpow20.0%

      \[\leadsto \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} \]
    2. rem-square-sqrt38.8%

      \[\leadsto \color{blue}{-1} \]
  6. Simplified38.8%

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

    \[\leadsto -1 \]

Reproduce

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