Average Error: 43.1 → 9.9
Time: 12.4s
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.0935259900820818 \cdot 10^{+117}:\\ \;\;\;\;\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 -1.468126820238527 \cdot 10^{-295}:\\ \;\;\;\;\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{elif}\;t \leq 3.9813591624873726 \cdot 10^{-203} \lor \neg \left(t \leq 3.958443330902987 \cdot 10^{+80}\right):\\ \;\;\;\;\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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}} \cdot \sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}}\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 -1.0935259900820818 \cdot 10^{+117}:\\
\;\;\;\;\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 -1.468126820238527 \cdot 10^{-295}:\\
\;\;\;\;\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{elif}\;t \leq 3.9813591624873726 \cdot 10^{-203} \lor \neg \left(t \leq 3.958443330902987 \cdot 10^{+80}\right):\\
\;\;\;\;\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)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}} \cdot \sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}}\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 -1.0935259900820818e+117)
   (/
    (* 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 -1.468126820238527e-295)
     (/
      (* t (sqrt 2.0))
      (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (* l (/ l x)))))))
     (if (or (<= t 3.9813591624873726e-203) (not (<= t 3.958443330902987e+80)))
       (/
        (* t (sqrt 2.0))
        (+
         (* (/ 2.0 (sqrt 2.0)) (+ (/ t (* x x)) (/ t x)))
         (- (* t (sqrt 2.0)) (/ t (* (sqrt 2.0) (* x x))))))
       (/
        (* t (sqrt 2.0))
        (sqrt
         (+
          (* 4.0 (/ (* t t) x))
          (*
           2.0
           (*
            (sqrt (+ (* t t) (* l (/ l x))))
            (sqrt (+ (* t t) (* l (/ l 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.0935259900820818e+117) {
		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 <= -1.468126820238527e-295) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l * (l / x)))));
	} else if ((t <= 3.9813591624873726e-203) || !(t <= 3.958443330902987e+80)) {
		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)))));
	} else {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * (sqrt((t * t) + (l * (l / x))) * sqrt((t * t) + (l * (l / 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 4 regimes
  2. if t < -1.09352599008208182e117

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

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

      \[\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 -1.09352599008208182e117 < t < -1.468126820238527e-295

    1. Initial program 36.2

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

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

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

      \[\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 -1.468126820238527e-295 < t < 3.98135916248737259e-203 or 3.95844333090298696e80 < t

    1. Initial program 51.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.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. Simplified12.8

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

    if 3.98135916248737259e-203 < t < 3.95844333090298696e80

    1. Initial program 33.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 13.7

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.0935259900820818 \cdot 10^{+117}:\\ \;\;\;\;\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 -1.468126820238527 \cdot 10^{-295}:\\ \;\;\;\;\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{elif}\;t \leq 3.9813591624873726 \cdot 10^{-203} \lor \neg \left(t \leq 3.958443330902987 \cdot 10^{+80}\right):\\ \;\;\;\;\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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(\sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}} \cdot \sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}}\right)}}\\ \end{array}\]

Reproduce

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