Average Error: 43.0 → 8.7
Time: 17.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 -7.615343830721626 \cdot 10^{+85}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.7409387658712402 \cdot 10^{-154}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq -9.389286983336258 \cdot 10^{-219}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\ \mathbf{elif}\;t \leq 9.1409758728292 \cdot 10^{+91}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}} + t \cdot \left(t \cdot \left(2 + \frac{4}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \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 -7.615343830721626 \cdot 10^{+85}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

\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 -7.615343830721626e+85)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -1.7409387658712402e-154)
     (/
      (* t (sqrt 2.0))
      (sqrt
       (+ (* 2.0 (* l (/ l x))) (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
     (if (<= t -9.389286983336258e-219)
       (/
        (* t (sqrt 2.0))
        (-
         (- (* t (sqrt (+ 2.0 (/ 4.0 x)))))
         (* (sqrt (/ 1.0 (+ 2.0 (/ 4.0 x)))) (/ (* l l) (* t x)))))
       (if (<= t 9.1409758728292e+91)
         (/
          (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
          (sqrt (+ (* 2.0 (/ l (/ x l))) (* t (* t (+ 2.0 (/ 4.0 x)))))))
         (/
          (* t (sqrt 2.0))
          (* t (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 <= -7.615343830721626e+85) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -1.7409387658712402e-154) {
		tmp = (t * sqrt(2.0)) / sqrt((2.0 * (l * (l / x))) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else if (t <= -9.389286983336258e-219) {
		tmp = (t * sqrt(2.0)) / (-(t * sqrt(2.0 + (4.0 / x))) - (sqrt(1.0 / (2.0 + (4.0 / x))) * ((l * l) / (t * x))));
	} else if (t <= 9.1409758728292e+91) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((2.0 * (l / (x / l))) + (t * (t * (2.0 + (4.0 / x)))));
	} else {
		tmp = (t * sqrt(2.0)) / (t * 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 5 regimes
  2. if t < -7.6153438307216259e85

    1. Initial program 49.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 3.1

      \[\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. Simplified3.1

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

    if -7.6153438307216259e85 < t < -1.7409387658712402e-154

    1. Initial program 26.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 10.2

      \[\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. Simplified10.2

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

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

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

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

    if -1.7409387658712402e-154 < t < -9.3892869833362582e-219

    1. Initial program 61.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 33.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. Simplified33.8

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

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

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

    if -9.3892869833362582e-219 < t < 9.14097587282920064e91

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/l*_binary64_2315.7

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

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

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

      \[\leadsto \frac{\sqrt{\sqrt{2}} \cdot \color{blue}{\left(t \cdot \sqrt{\sqrt{2}}\right)}}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\]
    10. Taylor expanded around 0 15.8

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

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

    if 9.14097587282920064e91 < t

    1. Initial program 49.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 3.0

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification8.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.615343830721626 \cdot 10^{+85}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.7409387658712402 \cdot 10^{-154}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right) + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\ \mathbf{elif}\;t \leq -9.389286983336258 \cdot 10^{-219}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\ \mathbf{elif}\;t \leq 9.1409758728292 \cdot 10^{+91}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}} + t \cdot \left(t \cdot \left(2 + \frac{4}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \end{array}\]

Reproduce

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