Toniolo and Linder, Equation (7)

Percentage Accurate: 33.5% → 80.8%
Time: 15.6s
Alternatives: 9
Speedup: 225.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 33.5% 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: 80.8% accurate, 2.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 8.5 \cdot 10^{+158}:\\
\;\;\;\;{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}\\

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


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

    1. Initial program 42.9%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
    5. Simplified47.0%

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

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

        \[\leadsto \frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\color{blue}{\sqrt{\frac{1 + x}{x + -1}}}} \]
      3. *-inversesN/A

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{1 + x}{x + -1}}}} \]
      4. pow1/2N/A

        \[\leadsto \frac{1}{{\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\frac{1}{2}}}} \]
      5. pow-flipN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\frac{-1}{2}} \]
      7. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{1 + x}{x + -1}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{x + 1}{x + -1}\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), \left(x + -1\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      14. metadata-eval47.1%

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \frac{-1}{2}\right) \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]

    if 8.49999999999999978e158 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t \cdot \sqrt{2}}{\ell}\right), \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(t \cdot \sqrt{2}\right), \ell\right), \left(\sqrt{\color{blue}{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \ell\right), \left(\sqrt{\frac{\color{blue}{1}}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + -1\right)\right)\right)\right) \]
      10. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{x}{x - 1} + \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(\frac{x}{x - 1}\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x - 1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{x - 1}\right), -1\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x - 1\right)\right), -1\right)\right)\right)\right)\right) \]
      18. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), -1\right)\right)\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + -1\right)\right), -1\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, -1\right)\right), -1\right)\right)\right)\right)\right) \]
    5. Simplified7.5%

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

        \[\leadsto \frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}}{\color{blue}{\ell}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}\right), \color{blue}{\ell}\right) \]
    7. Applied egg-rr7.9%

      \[\leadsto \color{blue}{\frac{t \cdot {\left(2 \cdot \frac{1}{-1 + \frac{1 + x}{x + -1}}\right)}^{0.5}}{\ell}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\color{blue}{\left(x - 1\right)}, \frac{1}{2}\right)\right), \ell\right) \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(x + \left(\mathsf{neg}\left(1\right)\right)\right), \frac{1}{2}\right)\right), \ell\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(x + -1\right), \frac{1}{2}\right)\right), \ell\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(-1 + x\right), \frac{1}{2}\right)\right), \ell\right) \]
      4. +-lowering-+.f6473.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(-1, x\right), \frac{1}{2}\right)\right), \ell\right) \]
    10. Simplified73.6%

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

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

Alternative 2: 80.9% accurate, 2.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 6 \cdot 10^{+158}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\

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


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

    1. Initial program 42.9%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
    5. Simplified47.0%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    7. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{x - 1}{1 + x}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(1 + x\right)\right)\right) \]
      3. sub-negN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x + \left(\mathsf{neg}\left(1\right)\right)\right), \left(1 + x\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x + -1\right), \left(1 + x\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(1 + x\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(x + 1\right)\right)\right) \]
      7. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, 1\right)\right)\right) \]
    8. Simplified47.0%

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

    if 6e158 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t \cdot \sqrt{2}}{\ell}\right), \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(t \cdot \sqrt{2}\right), \ell\right), \left(\sqrt{\color{blue}{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \ell\right), \left(\sqrt{\frac{\color{blue}{1}}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + -1\right)\right)\right)\right) \]
      10. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{x}{x - 1} + \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(\frac{x}{x - 1}\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x - 1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{x - 1}\right), -1\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x - 1\right)\right), -1\right)\right)\right)\right)\right) \]
      18. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), -1\right)\right)\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + -1\right)\right), -1\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, -1\right)\right), -1\right)\right)\right)\right)\right) \]
    5. Simplified7.5%

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

        \[\leadsto \frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}}{\color{blue}{\ell}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}\right), \color{blue}{\ell}\right) \]
    7. Applied egg-rr7.9%

      \[\leadsto \color{blue}{\frac{t \cdot {\left(2 \cdot \frac{1}{-1 + \frac{1 + x}{x + -1}}\right)}^{0.5}}{\ell}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\color{blue}{\left(x - 1\right)}, \frac{1}{2}\right)\right), \ell\right) \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(x + \left(\mathsf{neg}\left(1\right)\right)\right), \frac{1}{2}\right)\right), \ell\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(x + -1\right), \frac{1}{2}\right)\right), \ell\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\left(-1 + x\right), \frac{1}{2}\right)\right), \ell\right) \]
      4. +-lowering-+.f6473.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{pow.f64}\left(\mathsf{+.f64}\left(-1, x\right), \frac{1}{2}\right)\right), \ell\right) \]
    10. Simplified73.6%

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

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

Alternative 3: 80.8% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{x}}{l\_m}\\


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

    1. Initial program 42.9%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
    5. Simplified47.0%

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

      \[\leadsto \color{blue}{\sqrt{\frac{x - 1}{1 + x}}} \]
    7. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{x - 1}{1 + x}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x - 1\right), \left(1 + x\right)\right)\right) \]
      3. sub-negN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x + \left(\mathsf{neg}\left(1\right)\right)\right), \left(1 + x\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(x + -1\right), \left(1 + x\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(1 + x\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \left(x + 1\right)\right)\right) \]
      7. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, -1\right), \mathsf{+.f64}\left(x, 1\right)\right)\right) \]
    8. Simplified47.0%

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

    if 8.49999999999999978e158 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t \cdot \sqrt{2}}{\ell}\right), \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(t \cdot \sqrt{2}\right), \ell\right), \left(\sqrt{\color{blue}{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \ell\right), \left(\sqrt{\frac{\color{blue}{1}}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + -1\right)\right)\right)\right) \]
      10. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{x}{x - 1} + \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(\frac{x}{x - 1}\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x - 1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{x - 1}\right), -1\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x - 1\right)\right), -1\right)\right)\right)\right)\right) \]
      18. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), -1\right)\right)\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + -1\right)\right), -1\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, -1\right)\right), -1\right)\right)\right)\right)\right) \]
    5. Simplified7.5%

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

        \[\leadsto \frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}}{\color{blue}{\ell}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}\right), \color{blue}{\ell}\right) \]
    7. Applied egg-rr7.9%

      \[\leadsto \color{blue}{\frac{t \cdot {\left(2 \cdot \frac{1}{-1 + \frac{1 + x}{x + -1}}\right)}^{0.5}}{\ell}} \]
    8. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \color{blue}{\left(\sqrt{x}\right)}\right), \ell\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f6469.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(x\right)\right), \ell\right) \]
    10. Simplified69.6%

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

        \[\leadsto t \cdot \color{blue}{\frac{\sqrt{x}}{\ell}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\sqrt{x}}{\ell} \cdot \color{blue}{t} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{x}}{\ell}\right), \color{blue}{t}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{x}\right), \ell\right), t\right) \]
      5. sqrt-lowering-sqrt.f6469.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(x\right), \ell\right), t\right) \]
    12. Applied egg-rr69.8%

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

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

Alternative 4: 80.4% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_m \cdot \frac{\sqrt{x}}{l\_m}\\


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

    1. Initial program 42.9%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6447.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
    5. Simplified47.0%

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

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

        \[\leadsto \frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\color{blue}{\sqrt{\frac{1 + x}{x + -1}}}} \]
      3. *-inversesN/A

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{1 + x}{x + -1}}}} \]
      4. pow1/2N/A

        \[\leadsto \frac{1}{{\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\frac{1}{2}}}} \]
      5. pow-flipN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\frac{-1}{2}} \]
      7. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{1 + x}{x + -1}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{x + 1}{x + -1}\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), \left(x + -1\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      14. metadata-eval47.1%

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \frac{-1}{2}\right) \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
    8. Taylor expanded in x around -inf

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 1 + \left(\mathsf{neg}\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)\right) \]
      2. unsub-negN/A

        \[\leadsto 1 - \color{blue}{\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), \color{blue}{x}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \left(\mathsf{neg}\left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right)\right), x\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), x\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right), x\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}\right), x\right)\right), x\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right)\right), x\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right)\right), x\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right)\right), x\right)\right) \]
      12. /-lowering-/.f6446.9%

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right)\right), x\right)\right) \]
    10. Simplified46.9%

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

    if 9.9999999999999993e158 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t \cdot \sqrt{2}}{\ell}\right), \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(t \cdot \sqrt{2}\right), \ell\right), \left(\sqrt{\color{blue}{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \ell\right), \left(\sqrt{\frac{\color{blue}{1}}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + -1\right)\right)\right)\right) \]
      10. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{x}{x - 1} + \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(\frac{x}{x - 1}\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x - 1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{x - 1}\right), -1\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x - 1\right)\right), -1\right)\right)\right)\right)\right) \]
      18. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), -1\right)\right)\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + -1\right)\right), -1\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f647.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, -1\right)\right), -1\right)\right)\right)\right)\right) \]
    5. Simplified7.5%

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

        \[\leadsto \frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}}{\color{blue}{\ell}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}\right), \color{blue}{\ell}\right) \]
    7. Applied egg-rr7.9%

      \[\leadsto \color{blue}{\frac{t \cdot {\left(2 \cdot \frac{1}{-1 + \frac{1 + x}{x + -1}}\right)}^{0.5}}{\ell}} \]
    8. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \color{blue}{\left(\sqrt{x}\right)}\right), \ell\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f6469.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(x\right)\right), \ell\right) \]
    10. Simplified69.6%

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

        \[\leadsto t \cdot \color{blue}{\frac{\sqrt{x}}{\ell}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\sqrt{x}}{\ell} \cdot \color{blue}{t} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{x}}{\ell}\right), \color{blue}{t}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{x}\right), \ell\right), t\right) \]
      5. sqrt-lowering-sqrt.f6469.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(x\right), \ell\right), t\right) \]
    12. Applied egg-rr69.8%

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

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

Alternative 5: 78.9% accurate, 2.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 4.8 \cdot 10^{+188}:\\
\;\;\;\;1 + \frac{-1 - \frac{\frac{0.5}{x} - 0.5}{x}}{x}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\


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

    1. Initial program 41.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. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f6446.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
    5. Simplified46.4%

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

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

        \[\leadsto \frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\color{blue}{\sqrt{\frac{1 + x}{x + -1}}}} \]
      3. *-inversesN/A

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{1 + x}{x + -1}}}} \]
      4. pow1/2N/A

        \[\leadsto \frac{1}{{\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\frac{1}{2}}}} \]
      5. pow-flipN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\frac{-1}{2}} \]
      7. metadata-evalN/A

        \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{1 + x}{x + -1}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{x + 1}{x + -1}\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), \left(x + -1\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
      14. metadata-eval46.4%

        \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \frac{-1}{2}\right) \]
    7. Applied egg-rr46.4%

      \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
    8. Taylor expanded in x around -inf

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto 1 + \left(\mathsf{neg}\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)\right) \]
      2. unsub-negN/A

        \[\leadsto 1 - \color{blue}{\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), \color{blue}{x}\right)\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \left(\mathsf{neg}\left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right)\right), x\right)\right) \]
      6. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), x\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right), x\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}\right), x\right)\right), x\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right)\right), x\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right)\right), x\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right)\right), x\right)\right) \]
      12. /-lowering-/.f6446.3%

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right)\right), x\right)\right) \]
    10. Simplified46.3%

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

    if 4.7999999999999999e188 < l

    1. Initial program 0.0%

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{t \cdot \sqrt{2}}{\ell}\right), \color{blue}{\left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(t \cdot \sqrt{2}\right), \ell\right), \left(\sqrt{\color{blue}{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \ell\right), \left(\sqrt{\frac{\color{blue}{1}}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \left(\sqrt{\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\left(\frac{1}{\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) - 1\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{1}{x - 1} + \frac{x}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + -1\right)\right)\right)\right) \]
      10. associate-+l+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{x}{x - 1} + \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(\frac{x}{x - 1}\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x - 1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \left(x + -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \left(\frac{1}{x - 1} + -1\right)\right)\right)\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\left(\frac{1}{x - 1}\right), -1\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x - 1\right)\right), -1\right)\right)\right)\right)\right) \]
      18. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right), -1\right)\right)\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \left(x + -1\right)\right), -1\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f646.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, -1\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, -1\right)\right), -1\right)\right)\right)\right)\right) \]
    5. Simplified6.4%

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

        \[\leadsto \frac{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}}{\color{blue}{\ell}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1}{\frac{x}{x + -1} + \left(\frac{1}{x + -1} + -1\right)}}\right), \color{blue}{\ell}\right) \]
    7. Applied egg-rr6.9%

      \[\leadsto \color{blue}{\frac{t \cdot {\left(2 \cdot \frac{1}{-1 + \frac{1 + x}{x + -1}}\right)}^{0.5}}{\ell}} \]
    8. Taylor expanded in x around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \color{blue}{\left(\sqrt{x}\right)}\right), \ell\right) \]
    9. Step-by-step derivation
      1. sqrt-lowering-sqrt.f6476.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(x\right)\right), \ell\right) \]
    10. Simplified76.5%

      \[\leadsto \frac{t \cdot \color{blue}{\sqrt{x}}}{\ell} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\sqrt{x} \cdot t}{\ell} \]
      2. associate-/l*N/A

        \[\leadsto \sqrt{x} \cdot \color{blue}{\frac{t}{\ell}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{x}\right), \color{blue}{\left(\frac{t}{\ell}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \left(\frac{\color{blue}{t}}{\ell}\right)\right) \]
      5. /-lowering-/.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(x\right), \mathsf{/.f64}\left(t, \color{blue}{\ell}\right)\right) \]
    12. Applied egg-rr64.3%

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

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

Alternative 6: 76.6% accurate, 17.3× speedup?

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

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

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Add Preprocessing
  3. Taylor expanded in l around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f6444.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
  5. Simplified44.3%

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

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

      \[\leadsto \frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\color{blue}{\sqrt{\frac{1 + x}{x + -1}}}} \]
    3. *-inversesN/A

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{1 + x}{x + -1}}}} \]
    4. pow1/2N/A

      \[\leadsto \frac{1}{{\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\frac{1}{2}}}} \]
    5. pow-flipN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
    6. metadata-evalN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\frac{-1}{2}} \]
    7. metadata-evalN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \]
    8. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\left(\frac{1 + x}{x + -1}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{pow.f64}\left(\left(\frac{x + 1}{x + -1}\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), \left(x + -1\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right) \]
    11. +-commutativeN/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    12. +-lowering-+.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    14. metadata-eval44.3%

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \frac{-1}{2}\right) \]
  7. Applied egg-rr44.3%

    \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
  8. Taylor expanded in x around -inf

    \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
  9. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto 1 + \left(\mathsf{neg}\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)\right) \]
    2. unsub-negN/A

      \[\leadsto 1 - \color{blue}{\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}}{x}\right)}\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), \color{blue}{x}\right)\right) \]
    5. mul-1-negN/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \left(\mathsf{neg}\left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right)\right), x\right)\right) \]
    6. unsub-negN/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right), x\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right), x\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{x}\right), x\right)\right), x\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right)\right), x\right)\right) \]
    10. associate-*r/N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right)\right), x\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right)\right), x\right)\right) \]
    12. /-lowering-/.f6444.1%

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right)\right), x\right)\right) \]
  10. Simplified44.1%

    \[\leadsto \color{blue}{1 - \frac{1 - \frac{0.5 - \frac{0.5}{x}}{x}}{x}} \]
  11. Final simplification44.1%

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

Alternative 7: 76.4% accurate, 25.0× speedup?

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

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

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Add Preprocessing
  3. Taylor expanded in l around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f6444.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
  5. Simplified44.3%

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

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

      \[\leadsto \frac{\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot t}}{\color{blue}{\sqrt{\frac{1 + x}{x + -1}}}} \]
    3. *-inversesN/A

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{1 + x}{x + -1}}}} \]
    4. pow1/2N/A

      \[\leadsto \frac{1}{{\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\frac{1}{2}}}} \]
    5. pow-flipN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
    6. metadata-evalN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\frac{-1}{2}} \]
    7. metadata-evalN/A

      \[\leadsto {\left(\frac{1 + x}{x + -1}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \]
    8. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\left(\frac{1 + x}{x + -1}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{pow.f64}\left(\left(\frac{x + 1}{x + -1}\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), \left(x + -1\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right) \]
    11. +-commutativeN/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    12. +-lowering-+.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right) \]
    14. metadata-eval44.3%

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right), \frac{-1}{2}\right) \]
  7. Applied egg-rr44.3%

    \[\leadsto \color{blue}{{\left(\frac{1 + x}{x + -1}\right)}^{-0.5}} \]
  8. Taylor expanded in x around -inf

    \[\leadsto \color{blue}{1 + -1 \cdot \frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}} \]
  9. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto 1 + \left(\mathsf{neg}\left(\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)\right) \]
    2. unsub-negN/A

      \[\leadsto 1 - \color{blue}{\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{1}{2} \cdot \frac{1}{x}\right), \color{blue}{x}\right)\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right)\right) \]
    8. /-lowering-/.f6444.1%

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right)\right) \]
  10. Simplified44.1%

    \[\leadsto \color{blue}{1 - \frac{1 - \frac{0.5}{x}}{x}} \]
  11. Final simplification44.1%

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

Alternative 8: 76.2% accurate, 45.0× speedup?

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

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

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Add Preprocessing
  3. Taylor expanded in l around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f6444.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
  5. Simplified44.3%

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

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  7. Step-by-step derivation
    1. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{1}{x}\right)}\right) \]
    2. /-lowering-/.f6444.0%

      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(1, \color{blue}{x}\right)\right) \]
  8. Simplified44.0%

    \[\leadsto \color{blue}{1 - \frac{1}{x}} \]
  9. Final simplification44.0%

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

Alternative 9: 75.5% accurate, 225.0× speedup?

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

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

    \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \]
  2. Add Preprocessing
  3. Taylor expanded in l around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \color{blue}{\left(\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}\right) \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\left(t \cdot \sqrt{2}\right), \color{blue}{\left(\sqrt{\frac{1 + x}{x - 1}}\right)}\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(\sqrt{2}\right)\right), \left(\sqrt{\color{blue}{\frac{1 + x}{x - 1}}}\right)\right)\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \left(\sqrt{\frac{1 + x}{\color{blue}{x - 1}}}\right)\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\left(\frac{1 + x}{x - 1}\right)\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(1 + x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    6. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x - 1\right)\right)\right)\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \left(x + -1\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f6444.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), t\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, x\right), \mathsf{+.f64}\left(x, -1\right)\right)\right)\right)\right) \]
  5. Simplified44.3%

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

    \[\leadsto \color{blue}{1} \]
  7. Step-by-step derivation
    1. Simplified43.4%

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

    Reproduce

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