Average Error: 42.8 → 12.4
Time: 12.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} \mathbf{if}\;t \leq -3.064774607274823 \cdot 10^{+89}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -2.9474172478993817 \cdot 10^{-150}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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}{\frac{x}{\frac{\ell}{x}}}\right)\right)}}\\ \mathbf{elif}\;t \leq -2.9041377634221667 \cdot 10^{-241}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq 2.1011173123428155 \cdot 10^{-259}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{2 \cdot \left(\frac{t \cdot t}{\ell \cdot \left(x \cdot x\right)} \cdot \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\right) + \left(\sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}} \cdot \left(2 \cdot \frac{t \cdot t}{x \cdot \ell} + \frac{t \cdot t}{\ell}\right) + \ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\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 -3.064774607274823 \cdot 10^{+89}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

\mathbf{elif}\;t \leq -2.9474172478993817 \cdot 10^{-150}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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}{\frac{x}{\frac{\ell}{x}}}\right)\right)}}\\

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

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

\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\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 -3.064774607274823e+89)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -2.9474172478993817e-150)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+
        (* 2.0 (/ (* l l) x))
        (+
         (* 4.0 (+ (/ (* t t) x) (/ (* t t) (* x x))))
         (* 2.0 (+ (* t t) (/ l (/ x (/ l x)))))))))
     (if (<= t -2.9041377634221667e-241)
       (/
        (* t (sqrt 2.0))
        (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
       (if (<= t 2.1011173123428155e-259)
         (/
          (* t (sqrt 2.0))
          (+
           (*
            2.0
            (*
             (/ (* t t) (* l (* x x)))
             (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x))))))
           (+
            (*
             (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x))))
             (+ (* 2.0 (/ (* t t) (* x l))) (/ (* t t) l)))
            (* l (sqrt (+ (/ 2.0 (* x x)) (/ 2.0 x)))))))
         (exp
          (log
           (/
            (sqrt 2.0)
            (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- 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 <= -3.064774607274823e+89) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -2.9474172478993817e-150) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((4.0 * (((t * t) / x) + ((t * t) / (x * x)))) + (2.0 * ((t * t) + (l / (x / (l / x)))))));
	} else if (t <= -2.9041377634221667e-241) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= 2.1011173123428155e-259) {
		tmp = (t * sqrt(2.0)) / ((2.0 * (((t * t) / (l * (x * x))) * sqrt(1.0 / ((2.0 / (x * x)) + (2.0 / x))))) + ((sqrt(1.0 / ((2.0 / (x * x)) + (2.0 / x))) * ((2.0 * ((t * t) / (x * l))) + ((t * t) / l))) + (l * sqrt((2.0 / (x * x)) + (2.0 / x)))));
	} else {
		tmp = exp(log(sqrt(2.0) / sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (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 4 regimes
  2. if t < -3.064774607274823e89 or -2.9474172478993817e-150 < t < -2.9041377634221667e-241

    1. Initial program 52.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 9.5

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

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

    if -3.064774607274823e89 < t < -2.9474172478993817e-150

    1. Initial program 26.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 10.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. Simplified10.3

      \[\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. Using strategy rm
    5. Applied associate-/l*_binary649.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{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 + \color{blue}{\frac{\ell}{\frac{x \cdot x}{\ell}}}\right)\right)}}\]
    6. Simplified9.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{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}{\color{blue}{\frac{x}{\frac{\ell}{x}}}}\right)\right)}}\]

    if -2.9041377634221667e-241 < t < 2.10111731234281555e-259

    1. Initial program 62.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 36.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. Simplified36.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 32.6

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

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

    if 2.10111731234281555e-259 < t

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

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

      \[\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_binary6412.4

      \[\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_binary6416.8

      \[\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_binary6416.9

      \[\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_binary6416.7

      \[\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_binary6416.7

      \[\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_binary6412.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.064774607274823 \cdot 10^{+89}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -2.9474172478993817 \cdot 10^{-150}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{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}{\frac{x}{\frac{\ell}{x}}}\right)\right)}}\\ \mathbf{elif}\;t \leq -2.9041377634221667 \cdot 10^{-241}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq 2.1011173123428155 \cdot 10^{-259}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{2 \cdot \left(\frac{t \cdot t}{\ell \cdot \left(x \cdot x\right)} \cdot \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\right) + \left(\sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}} \cdot \left(2 \cdot \frac{t \cdot t}{x \cdot \ell} + \frac{t \cdot t}{\ell}\right) + \ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt{2}}{\sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\right)}\\ \end{array}\]

Reproduce

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