Average Error: 42.5 → 12.8
Time: 10.3s
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} t_1 := \sqrt{2} \cdot t\\ t_2 := \ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}\\ \mathbf{if}\;\ell \leq -1.344174783853972 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_1}{-t_2}\\ \mathbf{elif}\;\ell \leq -7.737943713271532 \cdot 10^{+63}:\\ \;\;\;\;\frac{t_1}{\sqrt{2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{x \cdot x}\right) + 4 \cdot \left(\frac{t \cdot t}{x \cdot x} + t \cdot \frac{t}{x}\right)}}\\ \mathbf{elif}\;\ell \leq 9.258573850466912 \cdot 10^{+180}:\\ \;\;\;\;\frac{t_1}{\left|t_1\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t_2}\\ \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}
t_1 := \sqrt{2} \cdot t\\
t_2 := \ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}\\
\mathbf{if}\;\ell \leq -1.344174783853972 \cdot 10^{+154}:\\
\;\;\;\;\frac{t_1}{-t_2}\\

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

\mathbf{elif}\;\ell \leq 9.258573850466912 \cdot 10^{+180}:\\
\;\;\;\;\frac{t_1}{\left|t_1\right|}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_2}\\


\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
 (let* ((t_1 (* (sqrt 2.0) t))
        (t_2 (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
   (if (<= l -1.344174783853972e+154)
     (/ t_1 (- t_2))
     (if (<= l -7.737943713271532e+63)
       (/
        t_1
        (sqrt
         (+
          (* 2.0 (+ (+ (* t t) (/ (* l l) x)) (/ (* l l) (* x x))))
          (* 4.0 (+ (/ (* t t) (* x x)) (* t (/ t x)))))))
       (if (<= l 9.258573850466912e+180) (/ t_1 (fabs t_1)) (/ t_1 t_2))))))
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 t_1 = sqrt(2.0) * t;
	double t_2 = l * sqrt((2.0 / x) + (2.0 / (x * x)));
	double tmp;
	if (l <= -1.344174783853972e+154) {
		tmp = t_1 / -t_2;
	} else if (l <= -7.737943713271532e+63) {
		tmp = t_1 / sqrt((2.0 * (((t * t) + ((l * l) / x)) + ((l * l) / (x * x)))) + (4.0 * (((t * t) / (x * x)) + (t * (t / x)))));
	} else if (l <= 9.258573850466912e+180) {
		tmp = t_1 / fabs(t_1);
	} else {
		tmp = t_1 / t_2;
	}
	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 4 regimes
  2. if l < -1.34417478385397196e154

    1. Initial program 64.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 in x around inf 56.1

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

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

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

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

    if -1.34417478385397196e154 < l < -7.737943713271532e63

    1. Initial program 53.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 in x around inf 22.8

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

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{x \cdot x}\right) + 4 \cdot \left(\frac{t \cdot t}{x \cdot x} + \frac{t \cdot t}{x}\right)}}} \]
    4. Using strategy rm
    5. Applied *-un-lft-identity_binary6422.8

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

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

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

    if -7.737943713271532e63 < l < 9.2585738504669123e180

    1. Initial program 36.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 in x around inf 33.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2}}}} \]
    3. Simplified9.4

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\left|\sqrt{2} \cdot t\right|}} \]

    if 9.2585738504669123e180 < l

    1. Initial program 64.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 in x around inf 55.8

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\ell \cdot \sqrt{2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{{x}^{2}}}}} \]
    5. Simplified21.5

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.344174783853972 \cdot 10^{+154}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{-\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\ \mathbf{elif}\;\ell \leq -7.737943713271532 \cdot 10^{+63}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\left(t \cdot t + \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{x \cdot x}\right) + 4 \cdot \left(\frac{t \cdot t}{x \cdot x} + t \cdot \frac{t}{x}\right)}}\\ \mathbf{elif}\;\ell \leq 9.258573850466912 \cdot 10^{+180}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left|\sqrt{2} \cdot t\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\ \end{array} \]

Reproduce

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