Average Error: 43.1 → 9.2
Time: 8.1s
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.4895486145830267 \cdot 10^{+119}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} - \left(t \cdot \sqrt{2} + \frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right)\right)}\\ \mathbf{elif}\;t \leq -8.216739562820036 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -1.2658084059740561 \cdot 10^{-244}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} - \left(t \cdot \sqrt{2} + \frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right)\right)}\\ \mathbf{elif}\;t \leq 6.081297735023138 \cdot 10^{+25}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\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 -2.4895486145830267 \cdot 10^{+119}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} - \left(t \cdot \sqrt{2} + \frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right)\right)}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\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 -2.4895486145830267e+119)
   (/
    (* t (sqrt 2.0))
    (-
     (/ t (* (sqrt 2.0) (* x x)))
     (+ (* t (sqrt 2.0)) (* (/ 2.0 (sqrt 2.0)) (+ (/ t (* x x)) (/ t x))))))
   (if (<= t -8.216739562820036e-164)
     (/
      (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
      (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (* l (/ l x)))))))
     (if (<= t -1.2658084059740561e-244)
       (/
        (* t (sqrt 2.0))
        (-
         (/ t (* (sqrt 2.0) (* x x)))
         (+
          (* t (sqrt 2.0))
          (* (/ 2.0 (sqrt 2.0)) (+ (/ t (* x x)) (/ t x))))))
       (if (<= t 6.081297735023138e+25)
         (/
          (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
          (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (* l (/ l x)))))))
         (/
          (* t (sqrt 2.0))
          (+
           (* (/ 2.0 (sqrt 2.0)) (+ (/ t (* x x)) (/ t x)))
           (- (* t (sqrt 2.0)) (/ t (* (sqrt 2.0) (* x 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.4895486145830267e+119) {
		tmp = (t * sqrt(2.0)) / ((t / (sqrt(2.0) * (x * x))) - ((t * sqrt(2.0)) + ((2.0 / sqrt(2.0)) * ((t / (x * x)) + (t / x)))));
	} else if (t <= -8.216739562820036e-164) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l * (l / x)))));
	} else if (t <= -1.2658084059740561e-244) {
		tmp = (t * sqrt(2.0)) / ((t / (sqrt(2.0) * (x * x))) - ((t * sqrt(2.0)) + ((2.0 / sqrt(2.0)) * ((t / (x * x)) + (t / x)))));
	} else if (t <= 6.081297735023138e+25) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l * (l / x)))));
	} else {
		tmp = (t * sqrt(2.0)) / (((2.0 / sqrt(2.0)) * ((t / (x * x)) + (t / x))) + ((t * sqrt(2.0)) - (t / (sqrt(2.0) * (x * 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 < -2.48954861458302668e119 or -8.21673956282003623e-164 < t < -1.2658084059740561e-244

    1. Initial program 56.3

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

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

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

    if -2.48954861458302668e119 < t < -8.21673956282003623e-164 or -1.2658084059740561e-244 < t < 6.0812977350231383e25

    1. Initial program 37.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 15.8

      \[\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)}}}\]
    3. Simplified15.8

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \color{blue}{\ell} \cdot \frac{\ell}{x}\right)}}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt_binary6411.9

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\]
    10. Applied associate-*l*_binary6411.8

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

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

    if 6.0812977350231383e25 < t

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\left(t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{{x}^{2} \cdot \sqrt{2}} + 2 \cdot \frac{t}{x \cdot \sqrt{2}}\right)\right) - 2 \cdot \frac{t}{{x}^{2} \cdot {\left(\sqrt{2}\right)}^{3}}}}\]
    3. Simplified4.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4895486145830267 \cdot 10^{+119}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} - \left(t \cdot \sqrt{2} + \frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right)\right)}\\ \mathbf{elif}\;t \leq -8.216739562820036 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{elif}\;t \leq -1.2658084059740561 \cdot 10^{-244}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} - \left(t \cdot \sqrt{2} + \frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right)\right)}\\ \mathbf{elif}\;t \leq 6.081297735023138 \cdot 10^{+25}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left(t \cdot \sqrt{2} - \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)}\right)}\\ \end{array}\]

Reproduce

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