Average Error: 42.9 → 10.5
Time: 26.6s
Precision: binary64
Cost: 21580
\[\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}} \]
\[\begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{+54}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \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)))))
(FPCore (x l t)
 :precision binary64
 (if (<= t 1.4e-301)
   (/ t (- (* -0.5 (* (/ l t) (/ l x))) t))
   (if (<= t 4.5e-160)
     (/ t (hypot t (* l (sqrt (/ 1.0 x)))))
     (if (<= t 4.4e+54)
       (*
        t
        (/
         (sqrt 2.0)
         (sqrt
          (+
           (/ (* l l) x)
           (+
            (* 2.0 (+ (* t t) (/ (* t t) x)))
            (/ (fma 2.0 (* t t) (* l l)) x))))))
       (sqrt (/ (+ x -1.0) (+ 1.0 x)))))))
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)));
}
double code(double x, double l, double t) {
	double tmp;
	if (t <= 1.4e-301) {
		tmp = t / ((-0.5 * ((l / t) * (l / x))) - t);
	} else if (t <= 4.5e-160) {
		tmp = t / hypot(t, (l * sqrt((1.0 / x))));
	} else if (t <= 4.4e+54) {
		tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma(2.0, (t * t), (l * l)) / x)))));
	} else {
		tmp = sqrt(((x + -1.0) / (1.0 + x)));
	}
	return tmp;
}
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 code(x, l, t)
	tmp = 0.0
	if (t <= 1.4e-301)
		tmp = Float64(t / Float64(Float64(-0.5 * Float64(Float64(l / t) * Float64(l / x))) - t));
	elseif (t <= 4.5e-160)
		tmp = Float64(t / hypot(t, Float64(l * sqrt(Float64(1.0 / x)))));
	elseif (t <= 4.4e+54)
		tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x))))));
	else
		tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x)));
	end
	return tmp
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]
code[x_, l_, t_] := If[LessEqual[t, 1.4e-301], N[(t / N[(N[(-0.5 * N[(N[(l / t), $MachinePrecision] * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-160], N[(t / N[Sqrt[t ^ 2 + N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+54], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\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}}
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\
\;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\

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

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


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if t < 1.4000000000000001e-301

    1. Initial program 43.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. Simplified45.9

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

      [Start]43.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}} \]

      associate-*r/ [<=]43.2

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

      associate-*l/ [=>]48.9

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

      associate-*r/ [<=]46.4

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

      *-lft-identity [<=]46.4

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

      associate-*r* [<=]46.4

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

      *-commutative [<=]46.4

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

      associate-*r* [=>]46.4

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

      *-commutative [<=]46.4

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

      fma-neg [=>]45.9

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

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

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

      [Start]30.3

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}} \]

      distribute-lft-out [=>]30.3

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

      +-commutative [=>]30.3

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

      unpow2 [=>]30.3

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

      fma-udef [<=]30.3

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

      unpow2 [=>]30.3

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

      unpow2 [=>]30.3

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + \color{blue}{t \cdot t}\right)}} \]
    5. Applied egg-rr35.7

      \[\leadsto \color{blue}{\frac{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)}} \]
    6. Simplified35.7

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

      [Start]35.7

      \[ \frac{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)} \]

      *-inverses [=>]35.7

      \[ \frac{\frac{t}{\color{blue}{1}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)} \]
    7. Taylor expanded in t around 0 25.1

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

      \[\leadsto \frac{\frac{t}{1}}{\color{blue}{-1 \cdot t + -0.5 \cdot \frac{{\ell}^{2}}{t \cdot x}}} \]
    9. Simplified13.5

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

      [Start]18.1

      \[ \frac{\frac{t}{1}}{-1 \cdot t + -0.5 \cdot \frac{{\ell}^{2}}{t \cdot x}} \]

      +-commutative [=>]18.1

      \[ \frac{\frac{t}{1}}{\color{blue}{-0.5 \cdot \frac{{\ell}^{2}}{t \cdot x} + -1 \cdot t}} \]

      mul-1-neg [=>]18.1

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

      unsub-neg [=>]18.1

      \[ \frac{\frac{t}{1}}{\color{blue}{-0.5 \cdot \frac{{\ell}^{2}}{t \cdot x} - t}} \]

      unpow2 [=>]18.1

      \[ \frac{\frac{t}{1}}{-0.5 \cdot \frac{\color{blue}{\ell \cdot \ell}}{t \cdot x} - t} \]

      times-frac [=>]13.5

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

    if 1.4000000000000001e-301 < t < 4.50000000000000026e-160

    1. Initial program 63.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. Simplified62.0

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

      [Start]63.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}} \]

      associate-*r/ [<=]63.0

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

      associate-*l/ [=>]61.7

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

      associate-*r/ [<=]63.1

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

      *-lft-identity [<=]63.1

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

      associate-*r* [<=]63.1

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

      *-commutative [<=]63.1

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

      associate-*r* [=>]63.1

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

      *-commutative [<=]63.1

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

      fma-neg [=>]62.0

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

      \[\leadsto \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}}} \]
    4. Simplified33.9

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

      [Start]33.9

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x} + 2 \cdot {t}^{2}}} \]

      distribute-lft-out [=>]33.9

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

      +-commutative [=>]33.9

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

      unpow2 [=>]33.9

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

      fma-udef [<=]33.9

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

      unpow2 [=>]33.9

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

      unpow2 [=>]33.9

      \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + \color{blue}{t \cdot t}\right)}} \]
    5. Applied egg-rr9.9

      \[\leadsto \color{blue}{\frac{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)}} \]
    6. Simplified9.9

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

      [Start]9.9

      \[ \frac{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)} \]

      *-inverses [=>]9.9

      \[ \frac{\frac{t}{\color{blue}{1}}}{\mathsf{hypot}\left(t, \sqrt{\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}}\right)} \]
    7. Taylor expanded in t around 0 13.3

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

    if 4.50000000000000026e-160 < t < 4.3999999999999998e54

    1. Initial program 27.7

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

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

      [Start]27.7

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

      associate-*l/ [<=]27.7

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

      +-commutative [=>]27.7

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

      fma-def [=>]27.7

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

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

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

      [Start]9.5

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

      associate--l+ [=>]9.5

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

      unpow2 [=>]9.5

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

      distribute-lft-out [=>]9.5

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

      unpow2 [=>]9.5

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

      unpow2 [=>]9.5

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

      mul-1-neg [=>]9.5

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

      +-commutative [=>]9.5

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

      unpow2 [=>]9.5

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

      fma-udef [<=]9.5

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

      unpow2 [=>]9.5

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

    if 4.3999999999999998e54 < t

    1. Initial program 45.2

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

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

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

      [Start]55.8

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

      *-commutative [=>]55.8

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

      associate-/l* [=>]41.8

      \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \color{blue}{\frac{{t}^{2}}{\frac{x - 1}{1 + x}}}}} \]

      unpow2 [=>]41.8

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

      sub-neg [=>]41.8

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

      metadata-eval [=>]41.8

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

      +-commutative [=>]41.8

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

      +-commutative [=>]41.8

      \[ \frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \frac{t \cdot t}{\frac{-1 + x}{\color{blue}{x + 1}}}}} \]
    4. Taylor expanded in t around 0 3.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{+54}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]

Alternatives

Alternative 1
Error10.5
Cost13772
\[\begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-158}:\\ \;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\sqrt{\mathsf{fma}\left(t, t, \frac{\ell \cdot \ell}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
Alternative 2
Error11.5
Cost13576
\[\begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-55}:\\ \;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \ell \cdot \sqrt{\frac{1}{x}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
Alternative 3
Error11.5
Cost13448
\[\begin{array}{l} \mathbf{if}\;t \leq 1.4 \cdot 10^{-301}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-55}:\\ \;\;\;\;\frac{t}{\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
Alternative 4
Error13.2
Cost7236
\[\begin{array}{l} t_1 := \frac{\ell}{t} \cdot \frac{\ell}{x}\\ \mathbf{if}\;t \leq -1.5 \cdot 10^{-298}:\\ \;\;\;\;\frac{t}{-0.5 \cdot t_1 - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(0.5, t_1, t\right)}\\ \end{array} \]
Alternative 5
Error14.1
Cost6980
\[\begin{array}{l} \mathbf{if}\;t \leq 1.15 \cdot 10^{-307}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\ \end{array} \]
Alternative 6
Error14.2
Cost1096
\[\begin{array}{l} \mathbf{if}\;t \leq -3.05 \cdot 10^{-298}:\\ \;\;\;\;-1 + \left(\frac{1}{x} + \frac{-0.5}{x \cdot x}\right)\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-55}:\\ \;\;\;\;\frac{t}{t + 0.5 \cdot \frac{\frac{\ell \cdot \ell}{t}}{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 7
Error14.3
Cost964
\[\begin{array}{l} \mathbf{if}\;t \leq 4 \cdot 10^{-310}:\\ \;\;\;\;\frac{t}{-0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{x}\right) - t}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 8
Error15.7
Cost836
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\ \;\;\;\;-1 + \left(\frac{1}{x} + \frac{-0.5}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 9
Error15.6
Cost836
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\ \;\;\;\;-1 + \left(\frac{1}{x} + \frac{-0.5}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\ \end{array} \]
Alternative 10
Error16.0
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 11
Error15.8
Cost452
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\frac{1}{x} + -1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-1}{x}\\ \end{array} \]
Alternative 12
Error16.3
Cost196
\[\begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{-298}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 13
Error39.9
Cost64
\[-1 \]

Error

Reproduce

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