Average Error: 42.6 → 9.5
Time: 7.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.1260799277907824 \cdot 10^{+131}:\\ \;\;\;\;\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 -7.2168921486126805 \cdot 10^{-202}:\\ \;\;\;\;\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq -1.6798737234628474 \cdot 10^{-285}:\\ \;\;\;\;\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 9.961236427203297 \cdot 10^{+70}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\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 -1.1260799277907824 \cdot 10^{+131}:\\
\;\;\;\;\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 -7.2168921486126805 \cdot 10^{-202}:\\
\;\;\;\;\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\\

\mathbf{elif}\;t \leq -1.6798737234628474 \cdot 10^{-285}:\\
\;\;\;\;\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 9.961236427203297 \cdot 10^{+70}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\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 -1.1260799277907824e+131)
   (/
    (* 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 -7.2168921486126805e-202)
     (/
      (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
      (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
     (if (<= t -1.6798737234628474e-285)
       (/
        (* 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 9.961236427203297e+70)
         (/
          (* t (sqrt 2.0))
          (sqrt (+ (* 4.0 (/ (* t t) x)) (* 2.0 (+ (* t t) (/ l (/ x l)))))))
         (/
          (* 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 <= -1.1260799277907824e+131) {
		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 <= -7.2168921486126805e-202) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
	} else if (t <= -1.6798737234628474e-285) {
		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 <= 9.961236427203297e+70) {
		tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + (l / (x / l)))));
	} 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 4 regimes
  2. if t < -1.1260799277907824e131 or -7.21689214861268053e-202 < t < -1.6798737234628474e-285

    1. Initial program 57.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 9.7

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

      \[\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.1260799277907824e131 < t < -7.21689214861268053e-202

    1. Initial program 28.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 13.6

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

      \[\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 associate-/l*_binary648.4

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

      \[\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\]
    8. Applied associate-*l*_binary648.5

      \[\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\]
    9. Simplified8.5

      \[\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\]

    if -1.6798737234628474e-285 < t < 9.96123642720329744e70

    1. Initial program 40.8

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

      \[\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.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 associate-/l*_binary6415.1

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

    if 9.96123642720329744e70 < t

    1. Initial program 46.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 3.9

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

      \[\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 4 regimes into one program.
  4. Final simplification9.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.1260799277907824 \cdot 10^{+131}:\\ \;\;\;\;\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 -7.2168921486126805 \cdot 10^{-202}:\\ \;\;\;\;\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 + \frac{\ell}{\frac{x}{\ell}}\right)}}\\ \mathbf{elif}\;t \leq -1.6798737234628474 \cdot 10^{-285}:\\ \;\;\;\;\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 9.961236427203297 \cdot 10^{+70}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\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 2020233 
(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)))))