Average Error: 43.7 → 11.5
Time: 52.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 -2.984298100935431 \cdot 10^{+31}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq -1.458683861294613 \cdot 10^{-172}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\ \mathbf{elif}\;t \leq -4.4369086440200507 \cdot 10^{-305}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 1.524603857316903 \cdot 10^{-123}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{{\ell}^{2}}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 5.111159643392521 \cdot 10^{+84}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{3}} + \left(2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{2}} + \left(4 \cdot \frac{{t}^{2}}{{x}^{3}} + 4 \cdot \frac{{t}^{2}}{{x}^{2}}\right)\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \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 -2.984298100935431 \cdot 10^{+31}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\

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

\mathbf{elif}\;t \leq -4.4369086440200507 \cdot 10^{-305}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-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 -2.984298100935431e+31)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
   (if (<= t -1.458683861294613e-172)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* 2.0 (/ (pow l 2.0) x))
        (+ (* 4.0 (/ (pow t 2.0) x)) (* 2.0 (pow t 2.0))))))
     (if (<= t -4.4369086440200507e-305)
       (/
        (* t (sqrt 2.0))
        (-
         (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
       (if (<= t 1.524603857316903e-123)
         (/
          (* t (sqrt 2.0))
          (+
           (* t (sqrt 2.0))
           (+
            (* 2.0 (/ t (* (sqrt 2.0) x)))
            (/ (pow l 2.0) (* t (* (sqrt 2.0) x))))))
         (if (<= t 5.111159643392521e+84)
           (/
            (* t (sqrt 2.0))
            (sqrt
             (+
              (* 2.0 (/ (pow l 2.0) x))
              (+
               (* 4.0 (/ (pow t 2.0) x))
               (+
                (* 2.0 (/ (pow l 2.0) (pow x 3.0)))
                (+
                 (* 2.0 (pow t 2.0))
                 (+
                  (* 2.0 (/ (pow l 2.0) (pow x 2.0)))
                  (+
                   (* 4.0 (/ (pow t 2.0) (pow x 3.0)))
                   (* 4.0 (/ (pow t 2.0) (pow x 2.0)))))))))))
           (/
            (* t (sqrt 2.0))
            (*
             t
             (sqrt
              (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -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 <= -2.984298100935431e+31) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= -1.458683861294613e-172) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + (2.0 * pow(t, 2.0))));
	} else if (t <= -4.4369086440200507e-305) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= 1.524603857316903e-123) {
		tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + (pow(l, 2.0) / (t * (sqrt(2.0) * x)))));
	} else if (t <= 5.111159643392521e+84) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + ((2.0 * (pow(l, 2.0) / pow(x, 3.0))) + ((2.0 * pow(t, 2.0)) + ((2.0 * (pow(l, 2.0) / pow(x, 2.0))) + ((4.0 * (pow(t, 2.0) / pow(x, 3.0))) + (4.0 * (pow(t, 2.0) / pow(x, 2.0)))))))));
	} else {
		tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	}
	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 < -2.9842981009354311e31 or -1.45868386129461291e-172 < t < -4.4369086440200507e-305

    1. Initial program 47.6

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 12.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)}}\]

    if -2.9842981009354311e31 < t < -1.45868386129461291e-172

    1. Initial program 31.9

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

      \[\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)}}}\]

    if -4.4369086440200507e-305 < t < 1.52460385731690287e-123

    1. Initial program 57.8

      \[\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 24.0

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

    if 1.52460385731690287e-123 < t < 5.11115964339252127e84

    1. Initial program 28.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 12.7

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

    if 5.11115964339252127e84 < t

    1. Initial program 50.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. Taylor expanded around inf 2.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.984298100935431 \cdot 10^{+31}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq -1.458683861294613 \cdot 10^{-172}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\ \mathbf{elif}\;t \leq -4.4369086440200507 \cdot 10^{-305}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 1.524603857316903 \cdot 10^{-123}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{{\ell}^{2}}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 5.111159643392521 \cdot 10^{+84}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{3}} + \left(2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{{x}^{2}} + \left(4 \cdot \frac{{t}^{2}}{{x}^{3}} + 4 \cdot \frac{{t}^{2}}{{x}^{2}}\right)\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \end{array}\]

Reproduce

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