Average Error: 43.6 → 11.5
Time: 28.8s
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 -1.1973600433919266 \cdot 10^{-60}:\\ \;\;\;\;\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.9467168161159385 \cdot 10^{-200}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -1.0903340959230167 \cdot 10^{-263}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 7.544659758222255 \cdot 10^{-07}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\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 -1.1973600433919266 \cdot 10^{-60}:\\
\;\;\;\;\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.9467168161159385 \cdot 10^{-200}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\right)}}\\

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

\mathbf{elif}\;t \leq 7.544659758222255 \cdot 10^{-07}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\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 -1.1973600433919266e-60)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
   (if (<= t -1.9467168161159385e-200)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* (/ (* t t) x) (+ 4.0 (/ 4.0 x)))
        (* 2.0 (+ (+ (* t t) (/ l (/ x (/ l x)))) (/ (* l l) x))))))
     (if (<= t -1.0903340959230167e-263)
       (/
        (* t (sqrt 2.0))
        (-
         (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 (/ x (+ -1.0 x))))))))
       (if (<= t 7.544659758222255e-07)
         (/
          (* t (sqrt 2.0))
          (sqrt
           (+
            (* (/ (* t t) x) (+ 4.0 (/ 4.0 x)))
            (* 2.0 (+ (+ (* t t) (/ l (/ x (/ l x)))) (/ (* l l) x))))))
         (/
          (* 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 <= -1.1973600433919266e-60) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= -1.9467168161159385e-200) {
		tmp = (t * sqrt(2.0)) / sqrt((((t * t) / x) * (4.0 + (4.0 / x))) + (2.0 * (((t * t) + (l / (x / (l / x)))) + ((l * l) / x))));
	} else if (t <= -1.0903340959230167e-263) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * (x / (-1.0 + x)))));
	} else if (t <= 7.544659758222255e-07) {
		tmp = (t * sqrt(2.0)) / sqrt((((t * t) / x) * (4.0 + (4.0 / x))) + (2.0 * (((t * t) + (l / (x / (l / x)))) + ((l * l) / x))));
	} 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 3 regimes
  2. if t < -1.1973600433919266e-60 or -1.94671681611593846e-200 < t < -1.0903340959230167e-263

    1. Initial program 42.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 9.6

      \[\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 -1.1973600433919266e-60 < t < -1.94671681611593846e-200 or -1.0903340959230167e-263 < t < 7.5446597582222554e-7

    1. Initial program 46.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 21.3

      \[\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. Simplified21.3

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x \cdot x}\right) + \frac{\ell \cdot \ell}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/l*_binary64_2319.1

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

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

    if 7.5446597582222554e-7 < t

    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.9

      \[\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 3 regimes into one program.
  4. Final simplification11.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.1973600433919266 \cdot 10^{-60}:\\ \;\;\;\;\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.9467168161159385 \cdot 10^{-200}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -1.0903340959230167 \cdot 10^{-263}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot \frac{x}{-1 + x}}}\\ \mathbf{elif}\;t \leq 7.544659758222255 \cdot 10^{-07}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{t \cdot t}{x} \cdot \left(4 + \frac{4}{x}\right) + 2 \cdot \left(\left(t \cdot t + \frac{\ell}{\frac{x}{\frac{\ell}{x}}}\right) + \frac{\ell \cdot \ell}{x}\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}\]

Alternatives

Reproduce

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