Average Error: 42.8 → 10.6
Time: 44.5s
Precision: binary64
\[\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 -17682194664272242:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -3.8518359656331984 \cdot 10^{-165}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\right)}}\\ \mathbf{elif}\;t \leq -4.571719205972361 \cdot 10^{-278}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}\right) - \sqrt{\frac{1}{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 3.425085433279833 \cdot 10^{+34}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{x}{x - 1} + 2 \cdot \frac{1}{x - 1}}}\\ \end{array}\]
\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 -17682194664272242:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

\mathbf{elif}\;t \leq -3.8518359656331984 \cdot 10^{-165}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\right)}}\\

\mathbf{elif}\;t \leq -4.571719205972361 \cdot 10^{-278}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}\right) - \sqrt{\frac{1}{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}\right)}\\

\mathbf{elif}\;t \leq 3.425085433279833 \cdot 10^{+34}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\

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

\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 -17682194664272242.0)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -3.8518359656331984e-165)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* 2.0 (/ (pow l 2.0) x))
        (+
         (* 4.0 (/ (pow t 2.0) x))
         (+
          (* 4.0 (/ (pow t 2.0) (pow x 2.0)))
          (+ (* 2.0 (pow t 2.0)) (* 2.0 (/ (pow l 2.0) (pow x 2.0)))))))))
     (if (<= t -4.571719205972361e-278)
       (/
        (* t (sqrt 2.0))
        (-
         (- (* t (sqrt (+ (/ 4.0 (* x x)) (+ 2.0 (/ 4.0 x))))))
         (*
          (sqrt (/ 1.0 (+ (/ 4.0 (* x x)) (+ 2.0 (/ 4.0 x)))))
          (+ (/ (* l l) (* t x)) (/ (* l l) (* t (* x x)))))))
       (if (<= t 3.425085433279833e+34)
         (/
          (* t (sqrt 2.0))
          (sqrt
           (+
            (* 2.0 (/ (* l l) x))
            (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
         (/
          (* t (sqrt 2.0))
          (*
           t
           (sqrt (+ (* 2.0 (/ x (- x 1.0))) (* 2.0 (/ 1.0 (- x 1.0))))))))))))
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 <= -17682194664272242.0) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -3.8518359656331984e-165) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / pow(x, 2.0))) + ((2.0 * pow(t, 2.0)) + (2.0 * (pow(l, 2.0) / pow(x, 2.0)))))));
	} else if (t <= -4.571719205972361e-278) {
		tmp = (t * sqrt(2.0)) / (-(t * sqrt((4.0 / (x * x)) + (2.0 + (4.0 / x)))) - (sqrt(1.0 / ((4.0 / (x * x)) + (2.0 + (4.0 / x)))) * (((l * l) / (t * x)) + ((l * l) / (t * (x * x))))));
	} else if (t <= 3.425085433279833e+34) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else {
		tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 * (x / (x - 1.0))) + (2.0 * (1.0 / (x - 1.0)))));
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 5 regimes
  2. if t < -17682194664272242

    1. Initial program 41.4

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

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

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

    if -17682194664272242 < t < -3.85183596563319838e-165

    1. Initial program 30.5

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

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

    if -3.85183596563319838e-165 < t < -4.5717192059723608e-278

    1. Initial program 63.3

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

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

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

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

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

    if -4.5717192059723608e-278 < t < 3.4250854332798328e34

    1. Initial program 44.1

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

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

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

    if 3.4250854332798328e34 < t

    1. Initial program 44.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 around inf 4.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -17682194664272242:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -3.8518359656331984 \cdot 10^{-165}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\right)}}\\ \mathbf{elif}\;t \leq -4.571719205972361 \cdot 10^{-278}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}\right) - \sqrt{\frac{1}{\frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 3.425085433279833 \cdot 10^{+34}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{x}{x - 1} + 2 \cdot \frac{1}{x - 1}}}\\ \end{array}\]

Reproduce

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