Average Error: 43.2 → 9.5
Time: 10.0s
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.8055396062121203 \cdot 10^{+120}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{2}} - \left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right)}\\ \mathbf{elif}\;t \leq 7.744619413220778 \cdot 10^{+100}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\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}}{\left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right) - \frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{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}
\mathbf{if}\;t \leq -1.8055396062121203 \cdot 10^{+120}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{2}} - \left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right)}\\

\mathbf{elif}\;t \leq 7.744619413220778 \cdot 10^{+100}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\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}}{\left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right) - \frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{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
 (if (<= t -1.8055396062121203e+120)
   (/
    (* t (sqrt 2.0))
    (-
     (* (/ t (* x x)) (/ 1.0 (sqrt 2.0)))
     (+
      (* t (sqrt 2.0))
      (* 2.0 (+ (/ t (* (sqrt 2.0) (* x x))) (/ t (* (sqrt 2.0) x)))))))
   (if (<= t 7.744619413220778e+100)
     (/
      (* t (sqrt 2.0))
      (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (* l (/ l x)))))))
     (/
      (* t (sqrt 2.0))
      (-
       (+
        (* t (sqrt 2.0))
        (* 2.0 (+ (/ t (* (sqrt 2.0) (* x x))) (/ t (* (sqrt 2.0) x)))))
       (* (/ t (* x x)) (/ 1.0 (sqrt 2.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 <= -1.8055396062121203e+120) {
		tmp = (t * sqrt(2.0)) / (((t / (x * x)) * (1.0 / sqrt(2.0))) - ((t * sqrt(2.0)) + (2.0 * ((t / (sqrt(2.0) * (x * x))) + (t / (sqrt(2.0) * x))))));
	} else if (t <= 7.744619413220778e+100) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l * (l / x)))));
	} else {
		tmp = (t * sqrt(2.0)) / (((t * sqrt(2.0)) + (2.0 * ((t / (sqrt(2.0) * (x * x))) + (t / (sqrt(2.0) * x))))) - ((t / (x * x)) * (1.0 / sqrt(2.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 3 regimes
  2. if t < -1.80556e120

    1. Initial program 53.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 2.4

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

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

    if -1.80556e120 < t < 7.74466e100

    1. Initial program 38.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 18.0

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

      \[\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_binary6418.0

      \[\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_binary6413.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. Simplified13.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)}}\]

    if 7.74466e100 < t

    1. Initial program 50.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8055396062121203 \cdot 10^{+120}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{2}} - \left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right)}\\ \mathbf{elif}\;t \leq 7.744619413220778 \cdot 10^{+100}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\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}}{\left(t \cdot \sqrt{2} + 2 \cdot \left(\frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} + \frac{t}{\sqrt{2} \cdot x}\right)\right) - \frac{t}{x \cdot x} \cdot \frac{1}{\sqrt{2}}}\\ \end{array}\]

Reproduce

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