Average Error: 43.3 → 9.3
Time: 8.7s
Precision: 64
\[\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 \le -5.05520019591638835 \cdot 10^{126}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le -3.36283277804347352 \cdot 10^{-154}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{elif}\;t \le -1.47281951232424519 \cdot 10^{-263}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.68588570114635303 \cdot 10^{141}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \sqrt{2}, 2 \cdot \frac{t}{\sqrt{2} \cdot 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 \le -5.05520019591638835 \cdot 10^{126}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\

\mathbf{elif}\;t \le -3.36283277804347352 \cdot 10^{-154}:\\
\;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\

\mathbf{elif}\;t \le -1.47281951232424519 \cdot 10^{-263}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\

\mathbf{elif}\;t \le 1.68588570114635303 \cdot 10^{141}:\\
\;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \sqrt{2}, 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\

\end{array}
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 temp;
	if ((t <= -5.0552001959163884e+126)) {
		temp = ((sqrt(2.0) * t) / fma(2.0, (t / (pow(sqrt(2.0), 3.0) * pow(x, 2.0))), -fma(2.0, (t / (sqrt(2.0) * pow(x, 2.0))), fma(2.0, (t / (sqrt(2.0) * x)), (t * sqrt(2.0))))));
	} else {
		double temp_1;
		if ((t <= -3.3628327780434735e-154)) {
			temp_1 = ((sqrt(sqrt(sqrt(2.0))) * (sqrt(sqrt(sqrt(2.0))) * (sqrt(sqrt(2.0)) * t))) / sqrt(fma(2.0, pow(t, 2.0), fma(2.0, (fabs(l) * (fabs(l) / x)), (4.0 * (pow(t, 2.0) / x))))));
		} else {
			double temp_2;
			if ((t <= -1.4728195123242452e-263)) {
				temp_2 = ((sqrt(2.0) * t) / fma(2.0, (t / (pow(sqrt(2.0), 3.0) * pow(x, 2.0))), -fma(2.0, (t / (sqrt(2.0) * pow(x, 2.0))), fma(2.0, (t / (sqrt(2.0) * x)), (t * sqrt(2.0))))));
			} else {
				double temp_3;
				if ((t <= 1.685885701146353e+141)) {
					temp_3 = ((sqrt(sqrt(sqrt(2.0))) * (sqrt(sqrt(sqrt(2.0))) * (sqrt(sqrt(2.0)) * t))) / sqrt(fma(2.0, pow(t, 2.0), fma(2.0, (fabs(l) * (fabs(l) / x)), (4.0 * (pow(t, 2.0) / x))))));
				} else {
					temp_3 = ((sqrt(2.0) * t) / fma(t, sqrt(2.0), (2.0 * (t / (sqrt(2.0) * x)))));
				}
				temp_2 = temp_3;
			}
			temp_1 = temp_2;
		}
		temp = temp_1;
	}
	return temp;
}

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 < -5.0552001959163884e+126 or -3.3628327780434735e-154 < t < -1.4728195123242452e-263

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + t \cdot \sqrt{2}\right)\right)}}\]
    3. Simplified10.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}}\]

    if -5.0552001959163884e+126 < t < -3.3628327780434735e-154 or -1.4728195123242452e-263 < t < 1.685885701146353e+141

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{2}}{\color{blue}{1 \cdot x}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    6. Applied add-sqr-sqrt15.5

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\color{blue}{\sqrt{{\ell}^{2}} \cdot \sqrt{{\ell}^{2}}}}{1 \cdot x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    7. Applied times-frac15.5

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \color{blue}{\left|\ell\right|} \cdot \frac{\sqrt{{\ell}^{2}}}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    9. Simplified10.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \color{blue}{\frac{\left|\ell\right|}{x}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    10. Using strategy rm
    11. Applied add-sqr-sqrt10.7

      \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{2} \cdot \sqrt{2}}} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    12. Applied sqrt-prod10.8

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    13. Applied associate-*l*10.7

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    14. Using strategy rm
    15. Applied add-sqr-sqrt10.7

      \[\leadsto \frac{\sqrt{\sqrt{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    16. Applied sqrt-prod10.7

      \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    17. Applied sqrt-prod10.7

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}\right)} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    18. Applied associate-*l*10.6

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]

    if 1.685885701146353e+141 < t

    1. Initial program 59.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 59.4

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{2}}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}}\]
    4. Taylor expanded around inf 2.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}}}\]
    5. Simplified2.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5.05520019591638835 \cdot 10^{126}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le -3.36283277804347352 \cdot 10^{-154}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{elif}\;t \le -1.47281951232424519 \cdot 10^{-263}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.68588570114635303 \cdot 10^{141}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \sqrt{2}, 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020066 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  :precision binary64
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))