Average Error: 43.0 → 8.7
Time: 22.8s
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 -3.1493377557846525 \cdot 10^{+94}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.2243070715583163 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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 -1.037946830000933 \cdot 10^{-300}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}} + \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}\\ \mathbf{elif}\;t \leq 2.7803948899544386 \cdot 10^{-160}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 1.7408606400845876 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \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 -3.1493377557846525 \cdot 10^{+94}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\

\mathbf{elif}\;t \leq -1.2243070715583163 \cdot 10^{-124}:\\
\;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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 -1.037946830000933 \cdot 10^{-300}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}} + \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}\\

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

\mathbf{elif}\;t \leq 1.7408606400845876 \cdot 10^{+113}:\\
\;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \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 -3.1493377557846525e+94)
   (/
    (* t (sqrt 2.0))
    (- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
   (if (<= t -1.2243070715583163e-124)
     (/
      (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
      (sqrt
       (+ (* 2.0 (* l (/ l x))) (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
     (if (<= t -1.037946830000933e-300)
       (/
        (* t (sqrt 2.0))
        (-
         (+
          (* t (sqrt (+ 2.0 (* 4.0 (/ 1.0 x)))))
          (*
           (sqrt (/ 1.0 (+ 2.0 (* 4.0 (/ 1.0 x)))))
           (/ (pow l 2.0) (* t x))))))
       (if (<= t 2.7803948899544386e-160)
         (/
          (* t (sqrt 2.0))
          (+
           (* t (sqrt 2.0))
           (+
            (* 2.0 (/ t (* (sqrt 2.0) x)))
            (/ (* l l) (* t (* (sqrt 2.0) x))))))
         (if (<= t 1.7408606400845876e+113)
           (/
            (* (sqrt (sqrt 2.0)) (* t (sqrt (sqrt 2.0))))
            (sqrt
             (+
              (* 2.0 (* l (/ l x)))
              (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
           (/ (* t (sqrt 2.0)) (* t (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 <= -3.1493377557846525e+94) {
		tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
	} else if (t <= -1.2243070715583163e-124) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((2.0 * (l * (l / x))) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else if (t <= -1.037946830000933e-300) {
		tmp = (t * sqrt(2.0)) / -((t * sqrt(2.0 + (4.0 * (1.0 / x)))) + (sqrt(1.0 / (2.0 + (4.0 * (1.0 / x)))) * (pow(l, 2.0) / (t * x))));
	} else if (t <= 2.7803948899544386e-160) {
		tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / (t * (sqrt(2.0) * x)))));
	} else if (t <= 1.7408606400845876e+113) {
		tmp = (sqrt(sqrt(2.0)) * (t * sqrt(sqrt(2.0)))) / sqrt((2.0 * (l * (l / x))) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
	} else {
		tmp = (t * sqrt(2.0)) / (t * 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 5 regimes
  2. if t < -3.1493377557846525e94

    1. Initial program 50.4

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

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

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

    if -3.1493377557846525e94 < t < -1.2243070715583163e-124 or 2.78039488995443864e-160 < t < 1.7408606400845876e113

    1. Initial program 25.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 9.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. Simplified9.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. Using strategy rm
    5. Applied *-un-lft-identity_binary64_789.8

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

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

      \[\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)}}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt_binary64_1005.1

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\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)}}\]
    10. Applied associate-*l*_binary64_195.0

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\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)}}\]

    if -1.2243070715583163e-124 < t < -1.0379468300009329e-300

    1. Initial program 58.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 29.3

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

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

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

    if -1.0379468300009329e-300 < t < 2.78039488995443864e-160

    1. Initial program 62.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 25.4

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

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

    if 1.7408606400845876e113 < t

    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 3.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1493377557846525 \cdot 10^{+94}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\ \mathbf{elif}\;t \leq -1.2243070715583163 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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 -1.037946830000933 \cdot 10^{-300}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(t \cdot \sqrt{2 + 4 \cdot \frac{1}{x}} + \sqrt{\frac{1}{2 + 4 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}\\ \mathbf{elif}\;t \leq 2.7803948899544386 \cdot 10^{-160}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\ \mathbf{elif}\;t \leq 1.7408606400845876 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\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{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2}}\\ \end{array}\]

Reproduce

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