Average Error: 43.3 → 10.3
Time: 25.2s
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 -2.6033349029003832 \cdot 10^{-37}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot x}\right) - t \cdot \sqrt{2}}\\ \mathbf{elif}\;t \le 1.0155485322712369 \cdot 10^{-231}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 2.76976294781541042 \cdot 10^{-161} \lor \neg \left(t \le 1.70506510457761007 \cdot 10^{47}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2}, t, 2 \cdot \left(\frac{t}{\sqrt{2} \cdot x} - \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right) \cdot 2\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 -2.6033349029003832 \cdot 10^{-37}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot x}\right) - t \cdot \sqrt{2}}\\

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

\mathbf{elif}\;t \le 2.76976294781541042 \cdot 10^{-161} \lor \neg \left(t \le 1.70506510457761007 \cdot 10^{47}\right):\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2}, t, 2 \cdot \left(\frac{t}{\sqrt{2} \cdot x} - \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)\right)}\\

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

\end{array}
double f(double x, double l, double t) {
        double r32017 = 2.0;
        double r32018 = sqrt(r32017);
        double r32019 = t;
        double r32020 = r32018 * r32019;
        double r32021 = x;
        double r32022 = 1.0;
        double r32023 = r32021 + r32022;
        double r32024 = r32021 - r32022;
        double r32025 = r32023 / r32024;
        double r32026 = l;
        double r32027 = r32026 * r32026;
        double r32028 = r32019 * r32019;
        double r32029 = r32017 * r32028;
        double r32030 = r32027 + r32029;
        double r32031 = r32025 * r32030;
        double r32032 = r32031 - r32027;
        double r32033 = sqrt(r32032);
        double r32034 = r32020 / r32033;
        return r32034;
}

double f(double x, double l, double t) {
        double r32035 = t;
        double r32036 = -2.603334902900383e-37;
        bool r32037 = r32035 <= r32036;
        double r32038 = 2.0;
        double r32039 = sqrt(r32038);
        double r32040 = r32039 * r32035;
        double r32041 = 3.0;
        double r32042 = pow(r32039, r32041);
        double r32043 = x;
        double r32044 = 2.0;
        double r32045 = pow(r32043, r32044);
        double r32046 = r32042 * r32045;
        double r32047 = r32035 / r32046;
        double r32048 = r32039 * r32043;
        double r32049 = r32035 / r32048;
        double r32050 = r32047 - r32049;
        double r32051 = r32038 * r32050;
        double r32052 = r32035 * r32039;
        double r32053 = r32051 - r32052;
        double r32054 = r32040 / r32053;
        double r32055 = 1.0155485322712369e-231;
        bool r32056 = r32035 <= r32055;
        double r32057 = 4.0;
        double r32058 = pow(r32035, r32044);
        double r32059 = r32058 / r32043;
        double r32060 = l;
        double r32061 = r32060 / r32043;
        double r32062 = r32060 * r32061;
        double r32063 = fma(r32035, r32035, r32062);
        double r32064 = r32038 * r32063;
        double r32065 = fma(r32057, r32059, r32064);
        double r32066 = sqrt(r32065);
        double r32067 = r32040 / r32066;
        double r32068 = 2.7697629478154104e-161;
        bool r32069 = r32035 <= r32068;
        double r32070 = 1.70506510457761e+47;
        bool r32071 = r32035 <= r32070;
        double r32072 = !r32071;
        bool r32073 = r32069 || r32072;
        double r32074 = r32049 - r32047;
        double r32075 = r32038 * r32074;
        double r32076 = fma(r32039, r32035, r32075);
        double r32077 = r32040 / r32076;
        double r32078 = r32043 / r32060;
        double r32079 = r32060 / r32078;
        double r32080 = fma(r32035, r32035, r32079);
        double r32081 = r32080 * r32038;
        double r32082 = fma(r32057, r32059, r32081);
        double r32083 = sqrt(r32082);
        double r32084 = r32052 / r32083;
        double r32085 = r32073 ? r32077 : r32084;
        double r32086 = r32056 ? r32067 : r32085;
        double r32087 = r32037 ? r32054 : r32086;
        return r32087;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -2.603334902900383e-37

    1. Initial program 39.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. Simplified39.9

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 35.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)}}}\]
    4. Simplified35.6

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

      \[\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} + t \cdot \sqrt{2}\right)}}\]
    6. Simplified6.4

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

    if -2.603334902900383e-37 < t < 1.0155485322712369e-231

    1. Initial program 51.5

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

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 23.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)}}}\]
    4. Simplified23.7

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, 2 \cdot \mathsf{fma}\left(t, t, \frac{{\color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}}^{2}}{1 \cdot x}\right)\right)}}\]
    8. Applied unpow-prod-down44.3

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

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

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

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

    if 1.0155485322712369e-231 < t < 2.7697629478154104e-161 or 1.70506510457761e+47 < t

    1. Initial program 47.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. Simplified47.4

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 42.1

      \[\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)}}}\]
    4. Simplified42.1

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

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

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

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

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

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

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

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

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

    if 2.7697629478154104e-161 < t < 1.70506510457761e+47

    1. Initial program 29.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. Simplified29.2

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right) \cdot \frac{x + 1}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 10.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)}}}\]
    4. Simplified10.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.6033349029003832 \cdot 10^{-37}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot x}\right) - t \cdot \sqrt{2}}\\ \mathbf{elif}\;t \le 1.0155485322712369 \cdot 10^{-231}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 2.76976294781541042 \cdot 10^{-161} \lor \neg \left(t \le 1.70506510457761007 \cdot 10^{47}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2}, t, 2 \cdot \left(\frac{t}{\sqrt{2} \cdot x} - \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right) \cdot 2\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))