Average Error: 24.4 → 6.0
Time: 17.7s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.387037513954152204793629697523518119099 \cdot 10^{152}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 2.81109844001032311849514459419925746028 \cdot 10^{123}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{{z}^{2} - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -1.387037513954152204793629697523518119099 \cdot 10^{152}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \le 2.81109844001032311849514459419925746028 \cdot 10^{123}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{{z}^{2} - a \cdot t}}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r180889 = x;
        double r180890 = y;
        double r180891 = r180889 * r180890;
        double r180892 = z;
        double r180893 = r180891 * r180892;
        double r180894 = r180892 * r180892;
        double r180895 = t;
        double r180896 = a;
        double r180897 = r180895 * r180896;
        double r180898 = r180894 - r180897;
        double r180899 = sqrt(r180898);
        double r180900 = r180893 / r180899;
        return r180900;
}

double f(double x, double y, double z, double t, double a) {
        double r180901 = z;
        double r180902 = -1.3870375139541522e+152;
        bool r180903 = r180901 <= r180902;
        double r180904 = x;
        double r180905 = y;
        double r180906 = -r180905;
        double r180907 = r180904 * r180906;
        double r180908 = 2.811098440010323e+123;
        bool r180909 = r180901 <= r180908;
        double r180910 = 2.0;
        double r180911 = pow(r180901, r180910);
        double r180912 = a;
        double r180913 = t;
        double r180914 = r180912 * r180913;
        double r180915 = r180911 - r180914;
        double r180916 = sqrt(r180915);
        double r180917 = r180901 / r180916;
        double r180918 = r180905 * r180917;
        double r180919 = r180904 * r180918;
        double r180920 = r180904 * r180905;
        double r180921 = r180909 ? r180919 : r180920;
        double r180922 = r180903 ? r180907 : r180921;
        return r180922;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.4
Target7.5
Herbie6.0
\[\begin{array}{l} \mathbf{if}\;z \lt -3.192130590385276419686361646843883646209 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894210257945708950453212935 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.3870375139541522e+152

    1. Initial program 52.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*52.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied div-inv52.1

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    6. Simplified52.1

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{z}{\sqrt{{z}^{2} - a \cdot t}}}\]
    7. Using strategy rm
    8. Applied associate-*l*52.1

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{{z}^{2} - a \cdot t}}\right)}\]
    9. Taylor expanded around -inf 1.5

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot y\right)}\]
    10. Simplified1.5

      \[\leadsto x \cdot \color{blue}{\left(-y\right)}\]

    if -1.3870375139541522e+152 < z < 2.811098440010323e+123

    1. Initial program 10.7

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*8.7

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied div-inv8.7

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    6. Simplified8.5

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\frac{z}{\sqrt{{z}^{2} - a \cdot t}}}\]
    7. Using strategy rm
    8. Applied associate-*l*8.4

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

    if 2.811098440010323e+123 < z

    1. Initial program 47.9

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*45.9

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Taylor expanded around inf 1.7

      \[\leadsto \color{blue}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.387037513954152204793629697523518119099 \cdot 10^{152}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 2.81109844001032311849514459419925746028 \cdot 10^{123}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{{z}^{2} - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))