Average Error: 43.1 → 11.5
Time: 25.2s
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 -9.342725470987389 \cdot 10^{+21}:\\ \;\;\;\;\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.8982460853244696 \cdot 10^{+94}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x}{-1 + x} + \frac{2}{-1 + x}}}\right)}\\ \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 -9.342725470987389 \cdot 10^{+21}:\\
\;\;\;\;\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.8982460853244696 \cdot 10^{+94}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x}{-1 + x} + \frac{2}{-1 + x}}}\right)}\\

\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 -9.342725470987389e+21)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
   (if (<= t 1.8982460853244696e+94)
     (/
      (* 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))))))
     (exp
      (log
       (/
        (sqrt 2.0)
        (sqrt (+ (* 2.0 (/ x (+ -1.0 x))) (/ 2.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 <= -9.342725470987389e+21) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= 1.8982460853244696e+94) {
		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 {
		tmp = exp(log(sqrt(2.0) / sqrt((2.0 * (x / (-1.0 + x))) + (2.0 / (-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 3 regimes
  2. if t < -9.3427254709873887e21

    1. Initial program 41.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.3

      \[\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 -9.3427254709873887e21 < t < 1.8982460853244696e94

    1. Initial program 41.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 18.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)}}}\]

    if 1.8982460853244696e94 < t

    1. Initial program 50.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 3.1

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
    4. Using strategy rm
    5. Applied add-exp-log_binary64_1163.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{t \cdot \color{blue}{e^{\log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}}\]
    6. Applied add-exp-log_binary64_1169.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{e^{\log t}} \cdot e^{\log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}\]
    7. Applied prod-exp_binary64_1279.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{e^{\log t + \log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}}\]
    8. Applied add-exp-log_binary64_1169.4

      \[\leadsto \frac{\sqrt{2} \cdot \color{blue}{e^{\log t}}}{e^{\log t + \log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}\]
    9. Applied add-exp-log_binary64_1169.4

      \[\leadsto \frac{\color{blue}{e^{\log \left(\sqrt{2}\right)}} \cdot e^{\log t}}{e^{\log t + \log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}\]
    10. Applied prod-exp_binary64_1273.3

      \[\leadsto \frac{\color{blue}{e^{\log \left(\sqrt{2}\right) + \log t}}}{e^{\log t + \log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)}}\]
    11. Applied div-exp_binary64_1293.2

      \[\leadsto \color{blue}{e^{\left(\log \left(\sqrt{2}\right) + \log t\right) - \left(\log t + \log \left(\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\right)\right)}}\]
    12. Simplified3.0

      \[\leadsto e^{\color{blue}{\log \left(\frac{\sqrt{2}}{\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.342725470987389 \cdot 10^{+21}:\\ \;\;\;\;\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.8982460853244696 \cdot 10^{+94}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{2 \cdot \frac{x}{-1 + x} + \frac{2}{-1 + x}}}\right)}\\ \end{array}\]

Reproduce

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